Boost ZVT PWM Converter

Load the Package

SetDirectory["C:/Documents and Settings/sunj/My \
Documents/Collins/Mathematica/Symap3e/Package"];
<< NodAl.m
<< Average.m
<< KBM.m
<< Graphic.m

Circuit Description

NetList = {{VoltageSource, {1, 0}, vg},
           {Resistor, {1, 2}, rL},
           {Inductor, {2, 3}, L},
           {Switch, {3, 0}, S0},
           {Capacitor, {3, 0}, Cr},
           {Inductor, {3, 4}, Lr},
           {Switch, {3, 5}, D0},
           {Switch, {4, 5}, Dr},
           {Switch, {4, 0}, Sr},
           {Capacitor, {5, 0}, C},
           {Resistor, {5, 0}, R}};
InputVars = {vg};

State-Space Model

Switching Sequence

SwitchStates = {{S0 -> 0, D0 -> 1, Sr -> 1, Dr -> 0},
                {S0 -> 0, D0 -> 0, Sr -> 1, Dr -> 0},
                {S0 -> 1, D0 -> 0, Sr -> 1, Dr -> 0},
                {S0 -> 1, D0 -> 0, Sr -> 0, Dr -> 1},
                {S0 -> 1, D0 -> 0, Sr -> 0, Dr -> 0},
                {S0 -> 0, D0 -> 0, Sr -> 0, Dr -> 0},
                {S0 -> 0, D0 -> 1, Sr -> 0, Dr -> 0}};

{A,  B,  StateVars}  =  
      StateSpaceModel[NetList,  InputVars,  SwitchStates]

MatrixForm[A[[1]]]

MatrixForm[B[[1]]]

Averaged Model

Additional Inputs

SlowFast = {{1,4},{2,3}};
ns = Length[SlowFast[[1]]];
nf = Length[SlowFast[[2]]];
SlowVars = Table[StateVars[[SlowFast[[1, i]]]] /. {t -> t0}, {i, 1, ns}];
FastVars = If[nf==0, {},Table[StateVars[[SlowFast[[2, i]]]], {i, 1, nf}]];
BCs = {0, {FastVars[[1]], SlowVars[[1]]}, {FastVars[[2]], 
        0}, {Td}, {FastVars[[1]], 0}, (d Ts),{FastVars[[2]], SlowVars[[2]]}, 
      Ts};
IV = {0, SlowVars[[2]]};

Averaged Modeling

FastSolus  =  
        Relaxation[A,  B,  InputVars,  SlowFast,  SlowVars,  FastVars,  
          BCs,  IV];
SlowEqus  =  
        Decoupling[FastSolus,  A,  B,  SlowFast,  SlowVars,  
          InputVars,  FastSolus[[3]]];
AveragedModel  =  
        Averaging[SlowEqus,  BCs[[-1]]];

Simplify[
      AveragedModel  /.  {x[1][t0]  ->  iL,  x[4][t0]  ->  
            vC}]