plant= TransferFunctionModel[1/(s^2 + 2*s + 1),s];
kip = 10; ki = 3.7; kid = 0.7;
pid = TransferFunctionModel[
(kip*s + ki + kid*s^2)/s, s];
openLoop = SystemsModelSeriesConnect[
TransferFunctionModel[plant], pid];
closedLoop = SystemsModelFeedbackConnect[
openLoop];
input = UnitStep[t];
output = OutputResponse[closedLoop, input, t];
Plot[{input, output}, {t, 0, 5}, PlotRange ->
All, GridLines -> Automatic,
GridLinesStyle -> Directive[LightGray, Dashed],
Frame -> True,
FrameLabel -> {{"y(t)", None},
{"t (sec)", "Step response"}},
BaseStyle -> 12]
|
|