How to simulate a spherical pendulum in matlab?
조회 수: 13 (최근 30일)
이전 댓글 표시
Hi,
I want to simulate a spherical pendulum in matlab. So far, I have found the equation of motion of the spherical pendulum:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147091/image.png)
But I haven't a clue how to simulate this. Any help whil be useful.
Kind regards, Bas
댓글 수: 0
채택된 답변
Roger Stafford
2015년 2월 11일
편집: Roger Stafford
2015년 2월 11일
Bas, you have a sign error in the gravity term. It should be:
-g*sin(phi)/L
Use one of matlab's 'ode' solvers to numerically solve these equations. Read about how to use them at:
http://www.mathworks.com/help/matlab/math/ordinary-differential-equations.html
Note that you would have numerical accuracy difficulty if the angle phi approaches near zero because of the division by sin(phi) in the first equation. At that point theta would change very rapidly. That is inherent in the physical situation as measured by the two angles.
댓글 수: 5
Roger Stafford
2015년 2월 26일
Yes, there is a way. If you (carefully!) transform your coordinate system to cartesian coordinates, this problem should not occur. That will require three dependent variables, x, y, and z. A third equation will express the constraint that the distance from the support point is the value 'L'.
As I mentioned, the problem is caused by the nature of the definition of the two angles - when phi is near zero, a small motion can change theta by large amounts. That is an artificial difficulty.
추가 답변 (1개)
Youssef Khmou
2015년 2월 11일
편집: Youssef Khmou
2015년 2월 11일
You can look for solution in this link :
댓글 수: 0
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!