Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = 0:0.0001:1/180;
- kp = 10;
- kd = 1.3;
- eqn ='0.00072*D3x+0.07206*D2x+(0.7274*kd+0.44244)*Dx+0.7274*kp*x=(0.7274*kd*Dt+0.7274*kp*t)*60*t';
- inits = 'x(0)=0,Dx(0)=60,D2x(0)=0,t(0)=0';
- x = dsolve(eqn,inits,'t');
- z = eval(vectorize(x));
- plot(t,z),grid on
- sys = tf([8 2 32],[3 6 14 24]).
- subplot(2,1,1)
- step(sys) % step response
- subplot(2,1,2)
- impulse(sys) % impulse response
- t = 0:0.01:4;
- u = sin(10*t);
- lsim(sys,u,t) % u,t define the input signal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement