Time response, frequency response, pole analysis, controllability and observability of LTI systems
for engg_math. Accepts StateSpace or TransferFunction from engg-math-continuous-analysis.
pip install engg-math-dynamical-systemsfrom engg_math.continuous_analysis import Domain, TransferFunction
from engg_math.dynamical_systems import bode, is_controllable, step_response
g = TransferFunction([1.0], [1.0, 2.0, 1.0]) # 1 / (s + 1)^2
step_response(g, Domain(0.0, 10.0, 201)).y[-1] # ~1.0
bode(g, [0.1, 1.0, 10.0]).magnitude_db
is_controllable(g) # True| Area | Names |
|---|---|
| Time domain | simulate, step_response, impulse_response, Response, dc_gain |
| Frequency domain | frequency_response, bode, FrequencyResponse, Bode |
| Poles | pole_modes, PoleModes (natural frequency, damping ratio) |
| Structure | controllability_matrix, observability_matrix, is_controllable, is_observable |
| Errors | DomainError (subclass of EnggMathError) |
- Arrays are indexed
[time, channel]:Response.yis(N, outputs),Response.xis(N, states). H(jw)anddc_gainuse linear solves, never inversion. A frequency on a pole, or a singularAfordc_gain, raisesDomainError.- The impulse response is the free motion from
x0 = B[:, j]; theD delta(t)term is omitted. - Rank tests use SVD rank from
engg-math-linear-systems. The Kalman matrices are ill-conditioned for high orders; passtolexplicitly when it matters. - Forced responses use the adaptive DOP853 solver of
LinearODE.
The legacy scipy lti wrapper and plotext plotters are not included; plotting returns with engg-math-viz.
uv sync
uv run pytest && uv run ruff check && uv run mypy && uv run lint-importsLicensed under Apache-2.0.