Expand description
Auto-generated module
🤖 Generated with SplitRS
Functions§
- bode_
data - Bode plot data: returns (frequencies, magnitude_dB, phase_deg).
- cohen_
coon_ pid - Cohen-Coon PID tuning from plant parameters.
- controllability_
matrix - Compute the controllability matrix [B, AB, A^2B, …].
- discretize_
tustin - Discretize a transfer function using Tustin (bilinear) transform.
- discretize_
zoh - Discretize a state-space model using Zero-Order Hold (ZOH).
- h2_norm
- Compute the H2 norm of a stable SISO system via numerical integration.
- h_
infinity_ norm_ bound - Approximate the H-infinity norm (peak of |H(jw)|) over given frequencies.
- impulse_
response - Impulse response of a transfer function.
- is_
controllable - Check if the system is controllable (rank of controllability matrix == n).
- is_
observable - Check if the system is observable (rank of observability matrix == n).
- lag_
compensator - Design a lag compensator for steady-state error reduction.
- lead_
compensator - Design a lead compensator for a desired phase margin boost at crossover frequency.
- logspace_
omega - Generate logarithmically spaced frequencies.
- lqr_
cost - Compute the LQR cost: J = x’Qx + u’Ru.
- lyapunov_
stable_ 2x2 - Check Lyapunov stability for a 2x2 system by examining eigenvalues of A.
- mat_add
- Add two n-by-m matrices.
- mat_eye
- Identity matrix of size n.
- mat_
inv_ small - Invert a small matrix (up to 3x3) using cofactors.
- mat_mul
- Multiply n-by-k matrix A by k-by-m matrix B, returning n-by-m.
- mat_
scale - Scale matrix by scalar.
- mat_sub
- Subtract two n-by-m matrices: a - b.
- mat_
transpose - Transpose n-by-m matrix to m-by-n.
- matrix_
rank - Estimate the rank of an n-by-m matrix via column pivoting.
- nyquist_
data - Nyquist plot data: returns (real_parts, imag_parts).
- nyquist_
encirclements - Check Nyquist stability: counts encirclements of -1+0j.
- observability_
matrix - Compute the observability matrix [C; CA; CA^2; …].
- observer_
gain_ ackermann - Observer gain via Ackermann’s formula (works for 1-D systems).
- pid_
reset - Reset PID controller state.
- pid_
update - Update PID controller and return the control output.
- pole_
placement_ check - Check if all poles have negative real part (stable).
- poly_
add - Add two polynomials (may differ in length).
- poly_
deriv - Derivative of polynomial coefficients
[a_n, ..., a_0]. - poly_
eval - Evaluate polynomial at real x using Horner’s method.
- poly_
eval_ complex - Evaluate a polynomial with coefficients
[a_n, a_{n-1}, ..., a_0]at complex z. - poly_
mul - Multiply two polynomials (convolution of coefficient arrays).
- poly_
roots - Find polynomial roots using Durand-Kerner method.
- root_
locus - Compute root locus: poles of 1 + K*H(s) for varying gain K.
- root_
locus_ breakpoints - Find the break-away/break-in points on the real axis for root locus.
- routh_
hurwitz_ stable - Routh-Hurwitz stability test.
- solve_
lyapunov_ 1x1 - Solve continuous Lyapunov equation AP + PA’ + Q = 0 for 1x1 system.
- ss_
output - Compute output: y = Cx + Du.
- ss_
simulate - Simulate state-space model over time steps, returning state history.
- ss_step
- Advance state by one Euler step: x_{k+1} = x_k + dt*(Ax_k + Bu_k).
- stability_
margins - Compute gain margin and phase margin from Bode data.
- step_
response - Step response of a transfer function (via state-space simulation).
- ziegler_
nichols_ pid - Ziegler-Nichols PID tuning from ultimate gain and period.