a a a a a
4 ビュー (過去 30 日間)
古いコメントを表示
a a a a
2 件のコメント
John D'Errico
2016 年 8 月 18 日
When you remove the question, you make the answer useless to anyone else who might want to ask that question. This is an insult to the person who bothered to waste their time to help you.
Star Strider
2016 年 8 月 18 日
John — TMW will re-post the original if you request them to. Apparently they keep back-up copies.
回答 (1 件)
Mischa Kim
2016 年 8 月 5 日
編集済み: Mischa Kim
2016 年 8 月 5 日
Kenneth, check out and run this:
g = 9.81;
L = linspace(1,10,14);
theta_0 = 30;
for t = 0:0.1:60 %time in seconds
theta = theta_0*sin(sqrt(g./L)*t);
x = L.*sind(theta);
y = -L.*cosd(theta);
%creating a rope
r = plot(x,y,'*');
%creating a bob
hold on
b = plot(x(length(x)),y(length(y)),'or','markersize',30,'markerfacecolor','r');
axis([-max(L) max(L) -max(L) 0])
drawnow
delete(r)
delete(b)
end
Code needs to be cleaned up but I think you get the drift.
Also note that I changed your equation for theta to show the non-linear behavior of pendula.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!