# How to plot the differential equation in spherical coordinates with maple

I want to plot the position of Spherical pendulum. there are differential equation for spherical pendulum in Spherical Coordinates.

sys := {((D@@2)(phi))(t) = -2*(D(phi))(t)*(D(theta))(t)*cos(theta(t))/sin(phi(t)),
((D@@2)(theta))(t) = (D(phi))(t)^2*cos(theta(t))*sin(theta(t))-9.8*sin(theta(t))}


$$\theta ''(t)=\sin (\theta (t))\cos (\theta (t)) \phi '(t)^2- 9.8\sin (\theta (t))$$

$$\phi''(t)=\frac{-2 \phi'(t)\theta'(t)\cos(\theta(t))}{\sin(\theta(t))}$$

with initial conditions

 theta(0) = (1/2)*Pi, (D(theta))(0) = 0, phi(0) = (1/2)*Pi, (D(phi))(0) = 1


I tried:

eq := dsolve([((D@@2)(theta))(t) = (D(phi))(t)^2*cos(theta(t))-9.8*sin(theta(t)),
((D@@2)(phi))(t) = -2*(D(phi))(t)*(D(theta))(t)*cos(theta(t))/sin(phi(t)),
theta(0) = (1/2)*Pi, (D(theta))(0) = 0, phi(0) = (1/2)*Pi, (D(phi))(0) = 1],numeric)


how to change coordinates

x(t) = sin(theta(t))*cos(phi(t))
y(t) = sin(theta(t))*sin(phi(t))
z(t) = cos(theta(t))


and how to plot it from t=0 to 10?

• Can you write out the equations instead of putting them in Maple format? – Moo Apr 2 '16 at 19:46
• @Moo ok, I edit my question – vito Apr 2 '16 at 20:11
• One of the terms in your Maple code for sys has sin(phi(t)) in the denominator, but your corresponding inlined formula has it as sin(theta(t)) instead (as pointed out by Preben Alsholm on www.mapleprimes.com). – acer Apr 5 '16 at 17:58

After solving and finding spherical $(\theta , \phi)$ just plug in, find out $(x,y,z)$ and plot the locus points.