Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for i=
- t=0:0.1:10;
- x0= [i;0]
- [t,x]=ode45(@dynamika,t,x0)
- hold on
- plot(x(:,1),x(:,2),'o-')
- xlabel('theta')
- ylabel('dtheta')
- end
- function dx = dynamika(t,x)
- theta=x(1)
- dtheta=x(2)
- g=9.81
- m=1
- r=1
- f=1
- ddtheta= -g/r * cos(theta) - f/m * dtheta;
- dx=[dtheta;...
- ddtheta];
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement