\( \DeclareMathOperator{\abs}{abs} \newcommand{\ensuremath}[1]{\mbox{$#1$}} \)
Averaged Models
(%i1) | A1 : matrix([ 0, − 1 / L],[ 1 / C, 0]) ; |
(%i2) | B1 : matrix([ 1 / L, 0],[ 0, − 1 / C]) ; |
(%i3) | C1 : matrix([ 0, 1],[ 1, 0]) ; |
(%i4) | D1 : matrix([ 0, 0],[ 0, 0]) ; |
(%i5) | A2 : matrix([ 0, − 1 / L],[ 1 / C, 0]) ; |
(%i6) | B2 : matrix([ 0, 0],[ 0, − 1 / C]) ; |
(%i7) | C2 : matrix([ 0, 1],[ 0, 0]) ; |
(%i8) | D2 : matrix([ 0, 0],[ 0, 0]) ; |
Averaged model matrices
(%i9) | a : ratsimp( A1· D0 + A2·( 1 − D0)) ; |
(%i10) | b : ratsimp( B1· D0 + B2·( 1 − D0)) ; |
(%i11) | c : ratsimp( C1· D0 + C2·( 1 − D0)) ; |
(%i12) | d : ratsimp( D1· D0 + D2·( 1 − D0)) ; |
DC model, needs to be done first
(%i13) | U0 : matrix([ Vin],[ Iout]) ; |
(%i14) | X0 : − invert( a). b. U0 ; |
(%i15) | Y0 :( d − c. invert( a). b). U0 ; |
Remaining AC model vectors
(%i16) | e :( A1 − A2). X0 +( B1 − B2). U0 ; |
(%i17) | f :( C1 − C2). X0 +( D1 − D2). U0 ; |
AC model, just define the input vector and expand B and D
(%i18) | u : matrix([ vin],[ iout],[ dhat]) ; |
(%i19) | b : addcol( b, e) ; |
(%i20) | d : addcol( d, f) ; |
Transfer functions
(%i21) | S : s· diagmatrix( 2, 1) − a ; |
(%i22) | Si : ratsimp( invert( S)) ; |
(%i23) | x : ratsimp( Si. b. u) ; |
(%i24) | x : expand( x) ; |
(%i25) | x : collectterms( x, vin, iout, dhat) ; |
(%i26) | y : collectterms( expand( ratsimp( c. Si. b + d). u), vin, iout, dhat) ; |
(%i27) | tf : y[ 1][ 1] ; |
(%i28) | Hvv : coeff( tf, vin) ; |
(%i29) | Hvi : coeff( tf, iout) ; |
(%i30) | Hvd : coeff( tf, dhat) ; |
Created with wxMaxima.
Enter state-space model matrices for both of the states