### 1.12 View steady state error of 2nd order LTI system with changing undamped natural frequency

1.12.1 Mathematica

Problem: Given the transfer function $H\left ( s\right ) =\frac {\omega _{n}^{2}}{s^{2}+2\xi \omega _{n}s+\omega _{n}^{2}}$

Display the output and input on the same plot showing how the steady state error changes as the un damped natural frequency $$\omega _{n}$$ changes. Do this for ramp and step input.

The steady state error is the diﬀerence between the input and output for large time. In other words, it the diﬀerence between the input and output at the time when the response settles down and stops changing.

Displaying the curve of the output and input on the same plot allows one to visually see steady state error.

Use maximum time of $$10$$ seconds and $$\xi =0.707$$ and change $$\omega _{n}$$ from $$0.2$$ to $$1.2$$.

Do this for ramp input and for unit step input. It can be seen that with ramp input, the steady state do not become zero even at steady state. While with step input, the steady state error can become zero.

#### 1.12.1 Mathematica

1.12.1.1 ramp input
1.12.1.2 step input

##### 1.12.1.1 ramp input
Remove["Global*"];
sys = TransferFunctionModel[w^2 /(s^2+2 z w  s+w^2 ),s];
z   = .707;
nTrials = 6;
maxTime = 10;

tb = Table[Plot[
Evaluate@{t,OutputResponse[sys/.w->0.2*i,t,t]},
{t,0,maxTime},
Frame->True,
PlotRange->All,
FrameLabel->{
{"y(t)",None},
{"t","Subscript[\[Omega], n]="<>ToString[0.2*i]}
}
],
{i,1,nTrials}];
Grid[Partition[tb,2]]



##### 1.12.1.2 step input
tb = Table[Plot[
Evaluate@{UnitStep[t],
OutputResponse[sys/.w->0.2*i,UnitStep[t],t]},
{t,0,maxTime},
Frame->True,
PlotRange->All,
FrameLabel->{
{"y(t)",None},
{"t","Subscript[\[Omega], n]="<>ToString[0.2*i]}
}
],
{i,1,nTrials}];

Grid[Partition[tb,2]]

`