Message Boards Message Boards

GROUPS:

Singularity in NDSolve?

Posted 7 months ago
509 Views
|
0 Replies
|
0 Total Likes
|

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}]
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