Control an RLC Circuit Modeled as a Descriptor System
Control an RLC Circuit Modeled as a Descriptor System
This resistor-inductor-capacitor circuit can easily be modeled from the component equations using a descriptor state-space model.
{ind, cap, res} = {l i'[t] == Subscript[v, l][t], Subscript[v, c]'[t] == 1 / c i[t], r i[t] == Subscript[v, r][t]};
kirchhoff = Subscript[v, l][t] + Subscript[v, c][t] + Subscript[v, r][t] == Subscript[v, s][t];circuit = StateSpaceModel[{ind, cap, res, kirchhoff}, {i[t], Subscript[v, l][t], Subscript[v, c][t], Subscript[v, r][t]}, {Subscript[v, s][t]}, {Subscript[v, r][t]}, t]circuit = circuit /. {r -> 4, c -> 1 / 1000, l -> 1 / 100};y0 = OutputResponse[circuit, Sin[2 Pi 60 t], {t, 0, .3}, Method -> {"NDSolve", AccuracyGoal -> 7}];
Plot[y0, {t, 0, .1}, ImageSize -> Medium]k = Simplify@StateFeedbackGains[circuit, {re + I im, re - I im}];
csys = SystemsModelStateFeedbackConnect[circuit, k];TransferFunctionPoles[circuit]y1 = OutputResponse[csys /. {re -> -800, im -> 100 Sqrt[6]}, Sin[2 π 60 t], {t, 0, .2}];
y2 = OutputResponse[csys /. {re -> -200, im -> 800}, Sin[2 π 60 t], {t, 0, .2}];Moving the poles either further to the left or away from the real axis decreases the magnitude response:
Plot[{y0, y1, y2}, {t, 0, .1}, PlotRange -> All, PlotStyle -> {Dashed, Thick, Thick, Thick}, PlotLegends -> {"OpenLoop", "Increased Re", "Increased Im"}, ImageSize -> Medium]