plot response for a step change in input

1 view (last 30 days)
Jason
Jason on 27 Sep 2013
Answered: Youssef Khmou on 27 Sep 2013
I am a little confused for a question, I have to modify code to see the response for a step change in input, should I be getting an oscillation where the waves 'fizzle' out, or a step like a square wave. zeta1 as to be between 1.0 >1.5, whilst zeta2: 0.0>1.0, with wn the natural frequency been varied code below:
y0=0.15 ; wn=1.44;
zeta1=3/(2*sqrt(2)); zeta2=1/(2*sqrt(2));
t=[0:0.1:10]; %
t1=acos(zeta1)*ones(1,length(t));
t2=acos(zeta2)*ones(1,length(t)); %
c1=(y0/sqrt(1-(zeta1*zeta1))); c2=(y0/sqrt(1-(zeta2*zeta2)));
y1=c1*exp(-zeta1*wn*t).*sin(wn*sqrt(1-(zeta1*zeta1))*t+t1);
y2=c2*exp(-zeta2*wn*t).*sin(wn*sqrt(1-(zeta2*zeta2))*t+t2);
bu=c2*exp(-zeta2*wn*t);bl=bu;
plot(t,y1,'-',t,y2,'-',t,bu,'-',t,bl,'-'),grid
xlabel('Time[sec]'),ylabel('y(t) Displacement[m]')
text(0.2,0.85,['overdamped zeta1=',num2str(zeta1)],'sc')
text(0.2,0.80,['underdamped zeta2=',num2str(zeta2)],'sc')
should I get rid of the 'grid' and replace with 'step' at the end of the plot. thanks

Answers (1)

Youssef  Khmou
Youssef Khmou on 27 Sep 2013
Jason, You did not give details about the nature of the system, ( low pass, high pass,...). The Fourier transform of the square wave ( beginning of step) is cardinal sinusoidal , so your code seems correct to me.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!