\( \DeclareMathOperator{\abs}{abs} \)

Buck Converter, cmc

state 1 matrices

(%i1) A1: matrix([0, -1/L], [1/c, 0]);
\[\mathrm{\tt (\%o1) }\quad \begin{pmatrix}0 & -\frac{1}{L}\cr \frac{1}{c} & 0\end{pmatrix}\]
(%i2) B1: matrix([1/L, 0], [0, -1/c]);
\[\mathrm{\tt (\%o2) }\quad \begin{pmatrix}\frac{1}{L} & 0\cr 0 & -\frac{1}{c}\end{pmatrix}\]
(%i3) C1: matrix([0, 1], [1, 0]);
\[\mathrm{\tt (\%o3) }\quad \begin{pmatrix}0 & 1\cr 1 & 0\end{pmatrix}\]
(%i4) D1: matrix([0, 0], [0, 0]);
\[\mathrm{\tt (\%o4) }\quad \begin{pmatrix}0 & 0\cr 0 & 0\end{pmatrix}\]

state 2 matrices

(%i5) A2: matrix([0, -1/L], [1/c, 0]);
\[\mathrm{\tt (\%o5) }\quad \begin{pmatrix}0 & -\frac{1}{L}\cr \frac{1}{c} & 0\end{pmatrix}\]
(%i6) B2: matrix([0, 0], [0, -1/c]);
\[\mathrm{\tt (\%o6) }\quad \begin{pmatrix}0 & 0\cr 0 & -\frac{1}{c}\end{pmatrix}\]
(%i7) C2: matrix([0, 1], [0, 0]);
\[\mathrm{\tt (\%o7) }\quad \begin{pmatrix}0 & 1\cr 0 & 0\end{pmatrix}\]
(%i8) D2: matrix([0, 0], [0, 0]);
\[\mathrm{\tt (\%o8) }\quad \begin{pmatrix}0 & 0\cr 0 & 0\end{pmatrix}\]

state variables, dc

(%i9) X0: matrix([Il], [Vc]);
\[\mathrm{\tt (\%o9) }\quad \begin{pmatrix}\mathit{Il}\cr \mathit{Vc}\end{pmatrix}\]

input variables, dc

(%i10) U0: matrix([Vin], [Iout]);
\[\mathrm{\tt (\%o10) }\quad \begin{pmatrix}\mathit{Vin}\cr \mathit{Iout}\end{pmatrix}\]

basic computation; keep it as it is

(%i11) A: D0 * A1 + (1 - D0) * A2;
\[\mathrm{\tt (\%o11) }\quad \begin{pmatrix}0 & -\frac{\mathit{D0}}{L}-\frac{1-\mathit{D0}}{L}\cr \frac{\mathit{D0}}{c}+\frac{1-\mathit{D0}}{c} & 0\end{pmatrix}\]
(%i12) A: ratsimp(A);
\[\mathrm{\tt (\%o12) }\quad \begin{pmatrix}0 & -\frac{1}{L}\cr \frac{1}{c} & 0\end{pmatrix}\]
(%i13) B: D0 * B1 + (1 - D0) * B2;
\[\mathrm{\tt (\%o13) }\quad \begin{pmatrix}\frac{\mathit{D0}}{L} & 0\cr 0 & -\frac{\mathit{D0}}{c}-\frac{1-\mathit{D0}}{c}\end{pmatrix}\]
(%i14) B: ratsimp(B);
\[\mathrm{\tt (\%o14) }\quad \begin{pmatrix}\frac{\mathit{D0}}{L} & 0\cr 0 & -\frac{1}{c}\end{pmatrix}\]
(%i15) C: D0 * C1 + (1 - D0) * C2;
\[\mathrm{\tt (\%o15) }\quad \begin{pmatrix}0 & 1\cr \mathit{D0} & 0\end{pmatrix}\]
(%i16) C: ratsimp(C);
\[\mathrm{\tt (\%o16) }\quad \begin{pmatrix}0 & 1\cr \mathit{D0} & 0\end{pmatrix}\]
(%i17) D: D0 * D1 + (1 - D0) * D2;
\[\mathrm{\tt (\%o17) }\quad \begin{pmatrix}0 & 0\cr 0 & 0\end{pmatrix}\]
(%i18) D: ratsimp(D);
\[\mathrm{\tt (\%o18) }\quad \begin{pmatrix}0 & 0\cr 0 & 0\end{pmatrix}\]

dc computation, still without d hat, keep it as it is

(%i19) iA: invert(A);
\[\mathrm{\tt (\%o19) }\quad \begin{pmatrix}0 & c\cr -L & 0\end{pmatrix}\]
(%i20) iA: ratsimp(iA);
\[\mathrm{\tt (\%o20) }\quad \begin{pmatrix}0 & c\cr -L & 0\end{pmatrix}\]
(%i21) x0: -iA . B . U0;
\[\mathrm{\tt (\%o21) }\quad \begin{pmatrix}\mathit{Iout}\cr \mathit{Vin}\cdot \mathit{D0}\end{pmatrix}\]
(%i22) x0: ratsimp(x0);
\[\mathrm{\tt (\%o22) }\quad \begin{pmatrix}\mathit{Iout}\cr \mathit{Vin}\cdot \mathit{D0}\end{pmatrix}\]
(%i23) y0: (D - C . iA . B) . U0;
\[\mathrm{\tt (\%o23) }\quad \begin{pmatrix}\mathit{Vin}\cdot \mathit{D0}\cr \mathit{Iout}\cdot \mathit{D0}\end{pmatrix}\]
(%i24) y0: ratsimp(y0);
\[\mathrm{\tt (\%o24) }\quad \begin{pmatrix}\mathit{Vin}\cdot \mathit{D0}\cr \mathit{Iout}\cdot \mathit{D0}\end{pmatrix}\]

ac computation, keep it as it is

(%i25) E: (A1 - A2) . X0 + (B1 - B2) . U0;
\[\mathrm{\tt (\%o25) }\quad \begin{pmatrix}\frac{\mathit{Vin}}{L}\cr 0\end{pmatrix}\]
(%i26) E: ratsimp(E);
\[\mathrm{\tt (\%o26) }\quad \begin{pmatrix}\frac{\mathit{Vin}}{L}\cr 0\end{pmatrix}\]
(%i27) F: (C1 - C2) . X0 + (D1 - D2) . U0;
\[\mathrm{\tt (\%o27) }\quad \begin{pmatrix}0\cr \mathit{Il}\end{pmatrix}\]
(%i28) F: ratsimp(F);
\[\mathrm{\tt (\%o28) }\quad \begin{pmatrix}0\cr \mathit{Il}\end{pmatrix}\]

merging E and F; keep it as it is

(%i29) B: addcol(B, E);
\[\mathrm{\tt (\%o29) }\quad \begin{pmatrix}\frac{\mathit{D0}}{L} & 0 & \frac{\mathit{Vin}}{L}\cr 0 & -\frac{1}{c} & 0\end{pmatrix}\]
(%i30) D: addcol(D, F);
\[\mathrm{\tt (\%o30) }\quad \begin{pmatrix}0 & 0 & 0\cr 0 & 0 & \mathit{Il}\end{pmatrix}\]

computing transfer functions; keep it as it is

(%i31) S0: s * diagmatrix(2, 1) - A;
\[\mathrm{\tt (\%o31) }\quad \begin{pmatrix}s & \frac{1}{L}\cr -\frac{1}{c} & s\end{pmatrix}\]
(%i32) S: invert(S0);
\[\mathrm{\tt (\%o32) }\quad \begin{pmatrix}\frac{s}{\frac{1}{c\cdot L}+{{s}^{2}}} & -\frac{1}{\left( \frac{1}{c\cdot L}+{{s}^{2}}\right) \cdot L}\cr \frac{1}{c\cdot \left( \frac{1}{c\cdot L}+{{s}^{2}}\right) } & \frac{s}{\frac{1}{c\cdot L}+{{s}^{2}}}\end{pmatrix}\]
(%i33) S: ratsimp(S);
\[\mathrm{\tt (\%o33) }\quad \begin{pmatrix}\frac{c\cdot s\cdot L}{c\cdot {{s}^{2}}\cdot L+1} & -\frac{c}{c\cdot {{s}^{2}}\cdot L+1}\cr \frac{L}{c\cdot {{s}^{2}}\cdot L+1} & \frac{c\cdot s\cdot L}{c\cdot {{s}^{2}}\cdot L+1}\end{pmatrix}\]
(%i34) S: facsum(S, s);
\[\mathrm{\tt (\%o34) }\quad \begin{pmatrix}\frac{c\cdot s\cdot L}{c\cdot {{s}^{2}}\cdot L+1} & -\frac{c}{c\cdot {{s}^{2}}\cdot L+1}\cr \frac{L}{c\cdot {{s}^{2}}\cdot L+1} & \frac{c\cdot s\cdot L}{c\cdot {{s}^{2}}\cdot L+1}\end{pmatrix}\]
(%i35) tox: S . B;
\[\mathrm{\tt (\%o35) }\quad \begin{pmatrix}\frac{c\cdot s\cdot \mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{1}{c\cdot {{s}^{2}}\cdot L+1} & \frac{c\cdot s\cdot \mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\cr \frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & -\frac{s\cdot L}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\end{pmatrix}\]
(%i36) tox: ratsimp(tox);
\[\mathrm{\tt (\%o36) }\quad \begin{pmatrix}\frac{c\cdot s\cdot \mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{1}{c\cdot {{s}^{2}}\cdot L+1} & \frac{c\cdot s\cdot \mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\cr \frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & -\frac{s\cdot L}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\end{pmatrix}\]
(%i37) tox: ev(tox, Il=x0[1, 1], Vc=x0[2, 1]);
\[\mathrm{\tt (\%o37) }\quad \begin{pmatrix}\frac{c\cdot s\cdot \mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{1}{c\cdot {{s}^{2}}\cdot L+1} & \frac{c\cdot s\cdot \mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\cr \frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & -\frac{s\cdot L}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\end{pmatrix}\]
(%i38) tox: ratsimp(tox);
\[\mathrm{\tt (\%o38) }\quad \begin{pmatrix}\frac{c\cdot s\cdot \mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{1}{c\cdot {{s}^{2}}\cdot L+1} & \frac{c\cdot s\cdot \mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\cr \frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & -\frac{s\cdot L}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\end{pmatrix}\]
(%i39) tox: facsum(tox, s);
\[\mathrm{\tt (\%o39) }\quad \begin{pmatrix}\frac{c\cdot s\cdot \mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{1}{c\cdot {{s}^{2}}\cdot L+1} & \frac{c\cdot s\cdot \mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\cr \frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & -\frac{s\cdot L}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\end{pmatrix}\]
(%i40) toy: C . S . B + D;
\[\mathrm{\tt (\%o40) }\quad \begin{pmatrix}\frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & -\frac{s\cdot L}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\cr \frac{c\cdot s\cdot {{\mathit{D0}}^{2}}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{c\cdot s\cdot \mathit{Vin}\cdot \mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1}+\mathit{Il}\end{pmatrix}\]
(%i41) toy: ratsimp(toy);
\[\mathrm{\tt (\%o41) }\quad \begin{pmatrix}\frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & -\frac{s\cdot L}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\cr \frac{c\cdot s\cdot {{\mathit{D0}}^{2}}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Il}+c\cdot s\cdot \mathit{Vin}\cdot \mathit{D0}+c\cdot \mathit{Il}\cdot {{s}^{2}}\cdot L}{c\cdot {{s}^{2}}\cdot L+1}\end{pmatrix}\]
(%i42) toy: ev(toy, Il=x0[1, 1], Vc=x0[2, 1]);
\[\mathrm{\tt (\%o42) }\quad \begin{pmatrix}\frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & -\frac{s\cdot L}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\cr \frac{c\cdot s\cdot {{\mathit{D0}}^{2}}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Iout}+c\cdot s\cdot \mathit{Vin}\cdot \mathit{D0}+c\cdot \mathit{Iout}\cdot {{s}^{2}}\cdot L}{c\cdot {{s}^{2}}\cdot L+1}\end{pmatrix}\]
(%i43) toy: ratsimp(toy);
\[\mathrm{\tt (\%o43) }\quad \begin{pmatrix}\frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & -\frac{s\cdot L}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\cr \frac{c\cdot s\cdot {{\mathit{D0}}^{2}}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Iout}+c\cdot s\cdot \mathit{Vin}\cdot \mathit{D0}+c\cdot \mathit{Iout}\cdot {{s}^{2}}\cdot L}{c\cdot {{s}^{2}}\cdot L+1}\end{pmatrix}\]
(%i44) toy: facsum(toy, s);
\[\mathrm{\tt (\%o44) }\quad \begin{pmatrix}\frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & -\frac{s\cdot L}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\cr \frac{c\cdot s\cdot {{\mathit{D0}}^{2}}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1} & \frac{\mathit{Iout}+c\cdot s\cdot \mathit{Vin}\cdot \mathit{D0}+c\cdot \mathit{Iout}\cdot {{s}^{2}}\cdot L}{c\cdot {{s}^{2}}\cdot L+1}\end{pmatrix}\]

current mode control

(%i45) Hiv: tox[1, 1];
\[\mathrm{\tt (\%o45) }\quad \frac{c\cdot s\cdot \mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1}\]
(%i46) Hii: tox[1, 2];
\[\mathrm{\tt (\%o46) }\quad \frac{1}{c\cdot {{s}^{2}}\cdot L+1}\]
(%i47) Hid: tox[1, 3];
\[\mathrm{\tt (\%o47) }\quad \frac{c\cdot s\cdot \mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\]
(%i48) Hvv: toy[1, 1];
\[\mathrm{\tt (\%o48) }\quad \frac{\mathit{D0}}{c\cdot {{s}^{2}}\cdot L+1}\]
(%i49) Hvi: toy[1, 2];
\[\mathrm{\tt (\%o49) }\quad -\frac{s\cdot L}{c\cdot {{s}^{2}}\cdot L+1}\]
(%i50) Hvd: toy[1, 3];
\[\mathrm{\tt (\%o50) }\quad \frac{\mathit{Vin}}{c\cdot {{s}^{2}}\cdot L+1}\]

Gvv

(%i51) Gvv: Hvv - Hvd * Hiv / Hid;
\[\mathrm{\tt (\%o51) }\quad 0\]
(%i52) Gvv:ratsimp(Gvv);
\[\mathrm{\tt (\%o52) }\quad 0\]
(%i53) Gvv: facsum(Gvv, s);
\[\mathrm{\tt (\%o53) }\quad 0\]

Gvi

(%i54) Gvi: Hvi - Hvd * Hii / Hid;
\[\mathrm{\tt (\%o54) }\quad -\frac{s\cdot L}{c\cdot {{s}^{2}}\cdot L+1}-\frac{1}{c\cdot s\cdot \left( c\cdot {{s}^{2}}\cdot L+1\right) }\]
(%i55) Gvi: ratsimp(Gvi);
\[\mathrm{\tt (\%o55) }\quad -\frac{1}{c\cdot s}\]
(%i56) Gvi: facsum(Gvi, s);
\[\mathrm{\tt (\%o56) }\quad -\frac{1}{c\cdot s}\]

Gvc

(%i57) Gvc: Hvd / Hid;
\[\mathrm{\tt (\%o57) }\quad \frac{1}{c\cdot s}\]
(%i58) Gvc: ratsimp(Gvc);
\[\mathrm{\tt (\%o58) }\quad \frac{1}{c\cdot s}\]
(%i59) Gvc: facsum(Gvc, s);
\[\mathrm{\tt (\%o59) }\quad \frac{1}{c\cdot s}\]

numerical values

(%i60) Hvvn: ev(Hvv, Vin=10, Vout=5, Iout=2, D0=0.5, L=10e-6, c=0.5e-3);
\[\mathrm{\tt (\%o60) }\quad \frac{0.5}{5.0\cdot {{10}^{-9}}\cdot {{s}^{2}}+1}\]
(%i61) Hvin: ev(Hvi, Vin=10, Vout=5, Iout=2, D0=0.5, L=10e-6, c=0.5e-3);
\[\mathrm{\tt (\%o61) }\quad -\frac{1.0\cdot {{10}^{-5}}\cdot s}{5.0\cdot {{10}^{-9}}\cdot {{s}^{2}}+1}\]
(%i62) Hvdn: ev(Hvd, Vin=10, Vout=5, Iout=2, D0=0.5, L=10e-6, c=0.5e-3);
\[\mathrm{\tt (\%o62) }\quad \frac{10}{5.0\cdot {{10}^{-9}}\cdot {{s}^{2}}+1}\]
(%i63) Gvvn: ev(Gvv, Vin=10, Vout=5, Iout=2, D0=0.5, L=10e-6, c=0.5e-3);
\[\mathrm{\tt (\%o63) }\quad 0\]
(%i64) Gvin: ev(Gvi, Vin=10, Vout=5, Iout=2, D0=0.5, L=10e-6, c=0.5e-3);
\[\mathrm{\tt (\%o64) }\quad -\frac{2000.0}{s}\]
(%i65) Gvcn: ev(Gvc, Vin=10, Vout=5, Iout=2, D0=0.5, L=10e-6, c=0.5e-3);
\[\mathrm{\tt (\%o65) }\quad \frac{2000.0}{s}\]
Created with wxMaxima.