Buck-Boost Converter, cmc
state 1 matrices
(%i1) | A1: matrix([0, 0], [0, 0]); |
(%i2) | B1: matrix([1/L, 0], [0, -1/c]); |
(%i3) | C1: matrix([0, 1], [1, 0]); |
(%i4) | D1: matrix([0, 0], [0, 0]); |
state 2 matrices
(%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]); |
state variables, dc
(%i9) | X0: matrix([Il], [Vc]); |
input variables, dc
(%i10) | U0: matrix([Vin], [Iout]); |
basic computation; keep it as it is
(%i11) | A: D0 * A1 + (1 - D0) * A2; |
(%i12) | A: ratsimp(A); |
(%i13) | B: D0 * B1 + (1 - D0) * B2; |
(%i14) | B: ratsimp(B); |
(%i15) | C: D0 * C1 + (1 - D0) * C2; |
(%i16) | C: ratsimp(C); |
(%i17) | D: D0 * D1 + (1 - D0) * D2; |
(%i18) | D: ratsimp(D); |
dc computation, still without d hat, keep it as it is
(%i19) | iA: invert(A); |
(%i20) | iA: ratsimp(iA); |
(%i21) | x0: -iA . B . U0; |
(%i22) | x0: ratsimp(x0); |
(%i23) | y0: (D - C . iA . B) . U0; |
(%i24) | y0: ratsimp(y0); |
ac computation, keep it as it is
(%i25) | E: (A1 - A2) . X0 + (B1 - B2) . U0; |
(%i26) | E: ratsimp(E); |
(%i27) | F: (C1 - C2) . X0 + (D1 - D2) . U0; |
(%i28) | F: ratsimp(F); |
merging E and F; keep it as it is
(%i29) | B: addcol(B, E); |
(%i30) | D: addcol(D, F); |
computing transfer functions; keep it as it is
(%i31) | S0: s * diagmatrix(2, 1) - A; |
(%i32) | S: invert(S0); |
(%i33) | S: ratsimp(S); |
(%i34) | S: facsum(S, s); |
(%i35) | tox: S . B; |
(%i36) | tox: ratsimp(tox); |
(%i37) | tox: ev(tox, Il=x0[1, 1], Vc=x0[2, 1]); |
(%i38) | tox: ratsimp(tox); |
(%i39) | tox: facsum(tox, s); |
(%i40) | toy: C . S . B + D; |
(%i41) | toy: ratsimp(toy); |
(%i42) | toy: ev(toy, Il=x0[1, 1], Vc=x0[2, 1]); |
(%i43) | toy: ratsimp(toy); |
(%i44) | toy: facsum(toy, s); |
current mode control
(%i45) | Hiv: tox[1, 1]; |
(%i46) | Hii: tox[1, 2]; |
(%i47) | Hid: tox[1, 3]; |
(%i48) | Hvv: toy[1, 1]; |
(%i49) | Hvi: toy[1, 2]; |
(%i50) | Hvd: toy[1, 3]; |
Gvv
(%i51) | Gvv: Hvv - Hvd * Hiv / Hid; |
(%i52) | Gvv:ratsimp(Gvv); |
(%i53) | Gvv: facsum(Gvv, s); |
Gvi
(%i54) | Gvi: Hvi - Hvd * Hii / Hid; |
(%i55) | Gvi: ratsimp(Gvi); |
(%i56) | Gvi: facsum(Gvi, s); |
Gvc
(%i57) | Gvc: Hvd / Hid; |
(%i58) | Gvc: ratsimp(Gvc); |
(%i59) | Gvc: facsum(Gvc, s); |
numerical values
(%i60) | Hvvn: ev(Hvv, Vin=10, Vout=-10, Iout=-1, D0=0.5, L=10e-6, c=0.5e-3); |
(%i61) | Hvin: ev(Hvi, Vin=10, Vout=-10, Iout=-1, D0=0.5, L=10e-6, c=0.5e-3); |
(%i62) | Hvdn: ev(Hvd, Vin=10, Vout=-10, Iout=-1, D0=0.5, L=10e-6, c=0.5e-3); |
(%i63) | Gvvn: ev(Gvv, Vin=10, Vout=-10, Iout=-1, D0=0.5, L=10e-6, c=0.5e-3); |
(%i64) | Gvin: ev(Gvi, Vin=10, Vout=-10, Iout=-1, D0=0.5, L=10e-6, c=0.5e-3); |
(%i65) | Gvcn: ev(Gvc, Vin=10, Vout=-10, Iout=-1, D0=0.5, L=10e-6, c=0.5e-3); |