Buck-Boost Converter
state 1 matrices
(%i1) | A1: matrix([0, 0], [0, 0]); |
(%i2) | B1: matrix([1/L, 0], [0, -1/c]); |
(%i3) | C1: matrix([0, 1]); |
(%i4) | D1: matrix([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]); |
(%i8) | D2: matrix([0, 0]); |
basic computation; keep it as it is
(%i9) | A: D0 * A1 + (1 - D0) * A2; |
(%i10) | A: ratsimp(A); |
(%i11) | B: D0 * B1 + (1 - D0) * B2; |
(%i12) | B: ratsimp(B); |
(%i13) | C: D0 * C1 + (1 - D0) * C2; |
(%i14) | C: ratsimp(C); |
(%i15) | D: D0 * D1 + (1 - D0) * D2; |
(%i16) | D: ratsimp(D); |
(%i17) | X0: matrix([Il], [Vc]); |
(%i18) | U0: matrix([Vin], [Iout]); |
(%i19) | E: (A1 - A2) . X0 + (B1 - B2) . U0; |
(%i20) | E: ratsimp(E); |
(%i21) | F: (C1 - C2) . X0 + (D1 - D2) . U0; |
merging E and F; keep it as it is
(%i22) | B: addcol(B, E); |
(%i23) | D: addcol(D, matrix([F])); |
computing transfer functions; keep it as it is
(%i24) | S0: s * diagmatrix(2, 1) - A; |
(%i25) | S: invert(S0); |
(%i26) | S: ratsimp(S); |
(%i27) | tox: S . B; |
(%i28) | tox: ratsimp(tox); |
(%i29) | toy: C . S . B + D; |
(%i30) | toy: ratsimp(toy); |
substituting values
(%i31) | tox1: ev(tox, D0 = 0.5, Vin = 10, Iout = -1, Il = 2, Vc = -10, L = 100e-6, c = 1e-3); |
(%i32) | tox1: ratsimp(tox1); |
(%i33) | tox1: factor(tox1); |
(%i34) | tox2: ev(tox, D0 = 0.5, Vin = 10, Iout = -1, Il = 2, Vc = -10, L = 100e-6, c = 1e-3); |
(%i35) | toy1: ev(toy, D0 = 0.5, Vin = 10, Iout = -1, Il = 2, Vc = -10, L = 100e-6, c = 1e-3); |
(%i36) | toy1: ratsimp(toy1); |
(%i37) | toy1: factor(toy1); |