Message Boards Message Boards

0
|
4234 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Singularity in NDSolve?

Posted 6 years ago

Hi, I am trying to plot the angles of a spherical pendulum fixed to a oscillating cart. I have derived the equations of motion, when I try to solve the equations using "NDSolve", following error occurs:

NDSolve::ndsz: At t == 0.1374350849846401, step size is effectively zero; singularity or stiff system suspected.`

Have you got an idea?

(*Equations of motion for spherical pendulum fixed to oscillating cart*)

Remove[x, L, w , A]

(*Define equations of motion*)

eq1 = ?''[t] - ?'[t]^2*Sin[?[t]]*Cos[?[t]] - x''[t]/L*Cos[?[t]]*Cos[?[t]] - (g*Sin[?[t]])/L;

eq2 = L*x''[t]*Sin[?[t]]*Sin[?[t]] - L^2*Sin[?[t]]*(?''[t]*Sin[?[t]] + 2*?'[t]^2*Cos[?[t]]);

eq3 = -A*w^2*Cos[w*t] - x''[t];

(*x is the cart-position, ? and ? the angles of the pendulum*)

(*Give numerical values for constants*)

A = 1;
g = 9.81;
L = 1;
w = 7;

(*Solve the equations using NDSOlve*)

sol = NDSolve[{eq1 == 0, eq2 == 0, eq3 == 0, ?[0] == 1, ?'[0] == 0, 
?[0] == 1, ?'[0] == 0, x[0] == 0, x'[0] == 0}, {?, ?}, {t, 0, 10}];


Plot[{Evaluate[?[t] /. sol], Evaluate[?[t] /. sol]}, {t, 0, 10}]
POSTED BY: Jonas Hamp
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract