Skip to main content
edited tags
Link
bbgodfrey
  • 63k
  • 18
  • 94
  • 169
further improved format
Source Link
bbgodfrey
  • 63k
  • 18
  • 94
  • 169

I want to plot the position of Spherical pendulum.

First I tried to plot the simple pendulum:

DSolve[{y''[t] == -y[t], y[0] == Pi/2, y'[0] == 0}, y[t], t]   (* {{y[t] -> 1/2 Pi Cos[t]}} *) 

then manipulate $t$

Manipulate[ ParametricPlot[{Sin[ 1/2 Pi Cos[t]], -Cos[1/2 Pi Cos[t]]}, {t, 0, n},  PlotRange -> 1,PlotStyle -> Red], {n, 0.1, 2Pi, 0.01}] 

enter image description here

I want to do same thing for spherical pendulum.

thereThese are differentialdifferential equations of the spherical pendulum page,3

sys := {\[Theta]''[t]θ''[t] == \[Phi]'[t]^2ϕ'[t]^2 Cos[\[Theta][t]]Cos[θ[t]] - g/l Sin[\[Theta][t]]Sin[θ[t]], \[Phi]''[t] ϕ''[t] ==  (-2 \[Phi]'[t]ϕ'[t] \[Theta]'[t]θ'[t] Cos[\[Theta][t]]Cos[θ[t]])/Sin[\[Theta][t]]Sin[θ[t]]} 

with initial condition

ic := {\[Theta][0]θ[0] == \[Pi]π/2, \[Theta]'[0]θ'[0] == 0, \[Phi][0]ϕ[0] == \[Pi]π/  2, \[Phi]'[0]==1ϕ'[0] == 1}  

I tried:

sol = NDSolve[{\[Theta]''[t]θ''[t] == \[Phi]'[t]^2ϕ'[t]^2 Cos[\[Theta][t]]Cos[θ[t]] -  g/l Sin[\[Theta][t]]Sin[θ[t]], \[Phi]''[ t] ϕ''[t] == (-2 \[Phi]'[t]ϕ'[t] \[Theta]'[t]θ'[t] Cos[\[Theta][t]]Cos[θ[t]])/ Sin[\[Theta][t]]Sin[θ[t]], \[Theta][0]θ[0] == \[Pi]π/2, \[Theta]'[0]   ==     θ'[0] == 0, \[Phi][0]ϕ[0] == \[Pi]π/2, \[Phi]'[0]ϕ'[0] == 1} /. {g -> 9.81,  l -> 1}, {\[Theta]θ, \[Phi]ϕ}, {t, 0, 10}]    x[t_] := Evaluate[(Sin[\[Theta][t]]Sin[θ[t]] Cos[\[Phi][t]]Cos[ϕ[t]]) /. sol]  y[t_] := Evaluate[(Sin[\[Theta][t]]Sin[θ[t]] Sin[\[Phi][t]]Sin[ϕ[t]]) /. sol]  z[t_] := Evaluate[Cos[\[Theta]]Evaluate[Cos[θ] /. sol]   ParametricPlot3D[{x[t], y[t], z[t]}, {\[Theta]θ, 0, 2 \[Pi]π}, {\[Phi]ϕ, -\[Pi]π, \[Pi]π}] 

but it doesn't work

I want to plot the position of Spherical pendulum.

First I tried to plot the simple pendulum:

DSolve[{y''[t] == -y[t], y[0] == Pi/2, y'[0] == 0}, y[t], t]   (* {{y[t] -> 1/2 Pi Cos[t]}} *) 

then manipulate $t$

Manipulate[ ParametricPlot[{Sin[ 1/2 Pi Cos[t]], -Cos[1/2 Pi Cos[t]]}, {t, 0, n}, PlotRange -> 1,PlotStyle -> Red], {n, 0.1, 2Pi, 0.01}] 

enter image description here

I want to do same thing for spherical pendulum

there are differential equations of the spherical pendulum page,3

sys := {\[Theta]''[t] == \[Phi]'[t]^2 Cos[\[Theta][t]] - g/l Sin[\[Theta][t]], \[Phi]''[t] == (-2 \[Phi]'[t] \[Theta]'[t] Cos[\[Theta][t]])/Sin[\[Theta][t]]} 

with initial condition

ic:={\[Theta][0] == \[Pi]/2, \[Theta]'[0] == 0, \[Phi][0] == \[Pi]/  2, \[Phi]'[0]==1} 

I tried:

sol = NDSolve[{\[Theta]''[t] == \[Phi]'[t]^2 Cos[\[Theta][t]] -  g/l Sin[\[Theta][t]], \[Phi]''[ t] == (-2 \[Phi]'[t] \[Theta]'[t] Cos[\[Theta][t]])/ Sin[\[Theta][t]], \[Theta][0] == \[Pi]/2, \[Theta]'[0] ==    0, \[Phi][0] == \[Pi]/2, \[Phi]'[0] == 1} /. {g -> 9.81,  l -> 1}, {\[Theta], \[Phi]}, {t, 0, 10}]   x[t_] := Evaluate[(Sin[\[Theta][t]] Cos[\[Phi][t]]) /. sol] y[t_] := Evaluate[(Sin[\[Theta][t]] Sin[\[Phi][t]]) /. sol]  z[t_] := Evaluate[Cos[\[Theta]] /. sol]   ParametricPlot3D[{x[t], y[t], z[t]}, {\[Theta], 0, 2 \[Pi]}, {\[Phi], -\[Pi], \[Pi]}] 

but it doesn't work

I want to plot the position of Spherical pendulum.

First I tried to plot the simple pendulum:

DSolve[{y''[t] == -y[t], y[0] == Pi/2, y'[0] == 0}, y[t], t] (* {{y[t] -> 1/2 Pi Cos[t]}} *) 

then manipulate $t$

Manipulate[ ParametricPlot[{Sin[ 1/2 Pi Cos[t]], -Cos[1/2 Pi Cos[t]]}, {t, 0, n},  PlotRange -> 1,PlotStyle -> Red], {n, 0.1, 2Pi, 0.01}] 

enter image description here

I want to do same thing for spherical pendulum.

These are differential equations of the spherical pendulum page,3

sys := {θ''[t] == ϕ'[t]^2 Cos[θ[t]] - g/l Sin[θ[t]], ϕ''[t] ==  (-2 ϕ'[t] θ'[t] Cos[θ[t]])/Sin[θ[t]]} 

with initial condition

ic := {θ[0] == π/2, θ'[0] == 0, ϕ[0] == π/2, ϕ'[0] == 1}  

I tried:

sol = NDSolve[{θ''[t] == ϕ'[t]^2 Cos[θ[t]] - g/l Sin[θ[t]],  ϕ''[t] == (-2 ϕ'[t] θ'[t] Cos[θ[t]])/Sin[θ[t]], θ[0] == π/2,      θ'[0] == 0, ϕ[0] == π/2, ϕ'[0] == 1} /. {g -> 9.81, l -> 1}, {θ, ϕ}, {t, 0, 10}]  x[t_] := Evaluate[(Sin[θ[t]] Cos[ϕ[t]]) /. sol]  y[t_] := Evaluate[(Sin[θ[t]] Sin[ϕ[t]]) /. sol] z[t_] := Evaluate[Cos[θ] /. sol] ParametricPlot3D[{x[t], y[t], z[t]}, {θ, 0, 2 π}, {ϕ, -π, π}] 

but it doesn't work

improved format
Source Link
bbgodfrey
  • 63k
  • 18
  • 94
  • 169

I want to plot the position of Spherical pendulum.

First I tried to plot the simple pendulum:

DSolve[{y''[t] == -y[t], y[0] == Pi/2, y'[0] == 0}, y[t], t] (* {{y[t] -> 1/2 Pi Cos[t]}} *) 

then manipulate $t$

Manipulate[ ParametricPlot[{Sin[ 1/2 Pi Cos[t]], -Cos[1/2 \[Pi]Pi Cos[t]]}, {t, 0, n}, PlotRange -> 1,PlotStyle -> Red], {n, 0.1, 2Pi, 0.01}] 

enter image description here

I want to do same thing for spherical pendulum

there are differential equations of the spherical pendulum page,3

sys := {\[Theta]''[t] == \[Phi]'[t]^2 Cos[\[Theta][t]] - g/l Sin[\[Theta][t]], \[Phi]''[t] == (-2 \[Phi]'[t] \[Theta]'[t] Cos[\[Theta][t]])/Sin[\[Theta][t]]} 

with initial condition

ic:={\[Theta][0] == \[Pi]/2, \[Theta]'[0] == 0, \[Phi][0] == \[Pi]/ 2, \[Phi]'[0]==1} 

I tried:

sol = NDSolve[{\[Theta]''[t] == \[Phi]'[t]^2 Cos[\[Theta][t]] - g/l Sin[\[Theta][t]], \[Phi]''[ t] == (-2 \[Phi]'[t] \[Theta]'[t] Cos[\[Theta][t]])/ Sin[\[Theta][t]], \[Theta][0] == \[Pi]/2, \[Theta]'[0] == 0, \[Phi][0] == \[Pi]/2, \[Phi]'[0] == 1} /. {g -> 9.81, l -> 1}, {\[Theta], \[Phi]}, {t, 0, 10}] x[t_] := Evaluate[(Sin[\[Theta][t]] Cos[\[Phi][t]]) /. sol] y[t_] := Evaluate[(Sin[\[Theta][t]] Sin[\[Phi][t]]) /. sol] z[t_] := Evaluate[Cos[\[Theta]] /. sol] ParametricPlot3D[{x[t], y[t], z[t]}, {\[Theta], 0, 2 \[Pi]}, {\[Phi], -\[Pi], \[Pi]}] 

but it doesn't work

I want to plot the position of Spherical pendulum.

First I tried to plot the simple pendulum:

DSolve[{y''[t] == -y[t], y[0] == Pi/2, y'[0] == 0}, y[t], t] {{y[t] -> 1/2 Pi Cos[t]}} 

then manipulate $t$

Manipulate[ ParametricPlot[{Sin[ 1/2 Pi Cos[t]], -Cos[1/2 \[Pi] Cos[t]]}, {t, 0, n}, PlotRange -> 1,PlotStyle -> Red], {n, 0.1, 2Pi, 0.01}] 

enter image description here

I want to do same thing for spherical pendulum

there are differential equations of the spherical pendulum page,3

sys := {\[Theta]''[t] == \[Phi]'[t]^2 Cos[\[Theta][t]] - g/l Sin[\[Theta][t]], \[Phi]''[t] == (-2 \[Phi]'[t] \[Theta]'[t] Cos[\[Theta][t]])/Sin[\[Theta][t]]} 

with initial condition

ic:={\[Theta][0] == \[Pi]/2, \[Theta]'[0] == 0, \[Phi][0] == \[Pi]/ 2, \[Phi]'[0]==1} 

I tried:

sol = NDSolve[{\[Theta]''[t] == \[Phi]'[t]^2 Cos[\[Theta][t]] - g/l Sin[\[Theta][t]], \[Phi]''[ t] == (-2 \[Phi]'[t] \[Theta]'[t] Cos[\[Theta][t]])/ Sin[\[Theta][t]], \[Theta][0] == \[Pi]/2, \[Theta]'[0] == 0, \[Phi][0] == \[Pi]/2, \[Phi]'[0] == 1} /. {g -> 9.81, l -> 1}, {\[Theta], \[Phi]}, {t, 0, 10}] x[t_] := Evaluate[(Sin[\[Theta][t]] Cos[\[Phi][t]]) /. sol] y[t_] := Evaluate[(Sin[\[Theta][t]] Sin[\[Phi][t]]) /. sol] z[t_] := Evaluate[Cos[\[Theta]] /. sol] ParametricPlot3D[{x[t], y[t], z[t]}, {\[Theta], 0, 2 \[Pi]}, {\[Phi], -\[Pi], \[Pi]}] 

but it doesn't work

I want to plot the position of Spherical pendulum.

First I tried to plot the simple pendulum:

DSolve[{y''[t] == -y[t], y[0] == Pi/2, y'[0] == 0}, y[t], t] (* {{y[t] -> 1/2 Pi Cos[t]}} *) 

then manipulate $t$

Manipulate[ ParametricPlot[{Sin[ 1/2 Pi Cos[t]], -Cos[1/2 Pi Cos[t]]}, {t, 0, n}, PlotRange -> 1,PlotStyle -> Red], {n, 0.1, 2Pi, 0.01}] 

enter image description here

I want to do same thing for spherical pendulum

there are differential equations of the spherical pendulum page,3

sys := {\[Theta]''[t] == \[Phi]'[t]^2 Cos[\[Theta][t]] - g/l Sin[\[Theta][t]], \[Phi]''[t] == (-2 \[Phi]'[t] \[Theta]'[t] Cos[\[Theta][t]])/Sin[\[Theta][t]]} 

with initial condition

ic:={\[Theta][0] == \[Pi]/2, \[Theta]'[0] == 0, \[Phi][0] == \[Pi]/ 2, \[Phi]'[0]==1} 

I tried:

sol = NDSolve[{\[Theta]''[t] == \[Phi]'[t]^2 Cos[\[Theta][t]] - g/l Sin[\[Theta][t]], \[Phi]''[ t] == (-2 \[Phi]'[t] \[Theta]'[t] Cos[\[Theta][t]])/ Sin[\[Theta][t]], \[Theta][0] == \[Pi]/2, \[Theta]'[0] == 0, \[Phi][0] == \[Pi]/2, \[Phi]'[0] == 1} /. {g -> 9.81, l -> 1}, {\[Theta], \[Phi]}, {t, 0, 10}] x[t_] := Evaluate[(Sin[\[Theta][t]] Cos[\[Phi][t]]) /. sol] y[t_] := Evaluate[(Sin[\[Theta][t]] Sin[\[Phi][t]]) /. sol] z[t_] := Evaluate[Cos[\[Theta]] /. sol] ParametricPlot3D[{x[t], y[t], z[t]}, {\[Theta], 0, 2 \[Pi]}, {\[Phi], -\[Pi], \[Pi]}] 

but it doesn't work

Source Link
vito
  • 9.1k
  • 1
  • 31
  • 74
Loading