nengolib.signal.balance

nengolib.signal.balance(sys)[source]

Transforms a linear system to its balanced realization.

Parameters:
sys : linear_system_like

Linear system representation.

Returns:
balanced_sys : LinearSystem

Balanced linear system in state-space form.

References

[1]https://www.mathworks.com/help/control/ref/balreal.html

Examples

See Linear System Model Reduction for a notebook example.

>>> from nengolib.signal import balance, s
>>> before = 10 / ((s + 10) * (s + 20) * (s + 30) * (s + 40))
>>> after = balance(before)

Effect of balancing some arbitrary system:

>>> import matplotlib.pyplot as plt
>>> length = 500
>>> plt.subplot(211)
>>> plt.title("Impulse - Before")
>>> plt.plot(before.ntrange(length), before.X.impulse(length))
>>> plt.subplot(212)
>>> plt.title("Impulse - After")
>>> plt.plot(after.ntrange(length), after.X.impulse(length))
>>> plt.xlabel("Time (s)")
>>> plt.show()

(Source code)

_images/nengolib-signal-balance-1.png