alchemyst / Skogestad-Python

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

Clone Merge - Exercise 4.6 & 4.7 #302

Closed JPIvan closed 6 years ago

JPIvan commented 6 years ago

Clone in Exercise_04_06 and Exercise_04_07 merged into utils.py ssr_solve() function. The following

Ig = np.zeros_like(M)
d = np.arange(A.shape[0])
Ig[d, d] = 1
Ig = sympy.Matrix(Ig)

was replaced with:

I_A = sympy.eye(A.shape[0])
Ig = sympy.BlockMatrix(
    [[I_A, Z_B],
    [Z_C, Z_D]]
)

Where I and Z are the Identity matrix and Zero matrix of the same shape as A, B, C,and D. I believe this is clearer.

JPIvan commented 6 years ago

As explained in my email to you, please forgive the 10 commits. Only 1 is relevant - the files changed tab is more useful.

JPIvan commented 6 years ago

As requested.