Buck Converter, esr
state 1 matrices
(%i1) | A1: matrix([-R/L, -1/L], [1/c, 0]); |
(%i2) | B1: matrix([1/L, R/L], [0, -1/c]); |
(%i3) | C1: matrix([R, 1]); |
(%i4) | D1: matrix([0, -R]); |
state 2 matrices
(%i5) | A2: matrix([-R/L, -1/L], [1/c, 0]); |
(%i6) | B2: matrix([0, R/L], [0, -1/c]); |
(%i7) | C2: matrix([R, 1]); |
(%i8) | D2: matrix([0, -R]); |
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: matrix([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: facsum(tox, s); |
(%i38) | tox: ev(tox, Il = x0[1, 1], Vc = x0[2, 1]); |
(%i39) | tox: ratsimp(tox); |
(%i40) | tox: facsum(tox, s); |
(%i41) | toy: C . S . B + D; |
(%i42) | toy: ratsimp(toy); |
(%i43) | toy: facsum(toy, s); |
(%i44) | toy: ev(toy, Il = x0[1, 1], Vc = x0[2, 1]); |
(%i45) | toy: ratsimp(toy); |
(%i46) | toy: facsum(toy, s); |
substituting values
(%i47) | tox0: ev(tox, R = 0); |
(%i48) | tox0: ratsimp(tox0); |
(%i49) | toy0: subst(0, R, toy); |
(%i50) | toy0: ratsimp(toy0); |
(%i51) | tox1: ev(tox, D0 = 0.5, Vin = 20, Iout = 1, L = 50e-6, c = 0.5e-3, R = 0); |
(%i52) | tox2: ev(tox, D0 = 0.5, Vin = 20, Iout = 1, L = 50e-6, c = 0.5e-3, R = 0.1); |
(%i53) | toy1: ev(toy, D0 = 0.5, Vin = 20, Iout = 1, L = 50e-6, c = 0.5e-3, R = 0); |
(%i54) | toy2: ev(toy, D0 = 0.5, Vin = 20, Iout = 1, L = 50e-6, c = 0.5e-3, R = 0.1); |