alchemyst / Skogestad-Python

Python code for "Multivariable Feedback Control"
111 stars 88 forks source link

Removed unused code from utils.py and fixed utils.minimal_realisation #283

Closed NicVDMey closed 7 years ago

NicVDMey commented 7 years ago

As discussed, removed unused code after poly_gcd and poly_lcm fixes.

Also, fixed the issue with minimal realisation by using kalman_observable and kalman_controllable to remove the states. I had to modify the examples to get no errors on run utils.py because the values of the minimal realisation were different with this approach. I checked that the examples are equivalent and correct by using the condition A2 = T^-1 A1 T, B2 = T^-1 B, C2 = C1 T with T = contrabillity_matrix(A1,B1) controlabillity_matrix_transpose(A2,B2) (controlabillity_matrix(A2,B2) * controlabillity_matrix_transpose(A2,B2))^-1 and by comparing the results with equivalent results obtained on wolfram alpha, just to be sure. This resolves the issue I posted.

In the last commit I fixed a typo, I had accidentally re-used a variable name I wasn't supposed to...