FUNCTION function[yp]=funwsh(y,t) yp=y; m=5;l=6;D=5;g=10; yp(1)=y(2); yp(2)=(-D*y(2)-m*g*l*sin(y(1)))/(m*l.^2); OCTAVE: >> t=0:0.01:300; >> y=lsode('funwsh',[pi/2,0],t); >> y=lsode('funwsh',[pi/2;0],t); >> plot(t,y(:,1)) >> xlabel('t') >> ylabel('fi') >> grid on >> plot(t,y(:,2)) >> xlabel('t') >> ylabel('w') >>
plazik21