Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc;
- clear all;
- tau = 0.0001;
- L = 9.8;
- g = 9.8;
- alpha(1) = 1.4;
- omega(1) = 0.0;
- x(1) = L * cos(alpha(1)) / 2;
- y(1) = L * sin(alpha(1)) / 2;
- i = 1;
- while (alpha(i) > 0.0)
- alpha(i + 1) = alpha(i) + omega(i) * tau;
- omega(i + 1) = omega(i) - g / L * tau * cos(alpha(i + 1));
- x(i + 1) = L * cos(alpha(i + 1)) / 2;
- y(i + 1) = L * sin(alpha(i + 1)) / 2;
- i = i + 1;
- end
- plot(x,y);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement