Given the following system, sample the input and find and plot the plant output
Use sampling frequency \(f=1\) Hz and show the result for up to \(14\) seconds. Use as input the signal \(u(t)=\exp (-0.3 t) \sin (2 \pi (f/3) t)\).
Plot the input and output on separate plots, and also plot them on the same plot.
Mathematica
opts = {Joined->True,PlotRange->All, AspectRatio->1,InterpolationOrder->0, ImageSize->200,Frame->True, PlotRange->{{0,nSamples},{-0.5,0.5}}, GridLines->Automatic,GridLinesStyle->Dashed}; inputPlot = ListPlot[Table[ud[k],{k,0,nSamples}], Evaluate[opts], FrameLabel->{{"u(t)",None}, {"n","plant input u(nT)"}}, PlotStyle->{Thick,Red}]; plantPlot=ListPlot[OutputResponse[sysd,Table[ud[k], {k,0,nSamples}]], Evaluate[opts], FrameLabel->{{"y(t)",None}, {"n","plant output y(nT)"}}, PlotStyle->{Thick,Blue}]; Grid[{{inputPlot,plantPlot}}]
Show[{inputPlot,plantPlot}, PlotLabel->"input/output plot"]
Matlab