Simple pendulum motion equation
Simple pendulum motion equation
de={θ''[t]+θ[t]0,θ[0]π/6,θ'[0]1}(*Thishereisthemotionequationforthesimplependlum.InitialvalueswereaddedjusttousedeDSolvecommand*)
Out[]=
θ[t]+[t]0,θ[0],[0]1
′′
θ
π
6
′
θ
In[]:=
sol=DSolve[de,θ,{t,-2π,2π}]
Out[]=
θFunction{t},πCos[t]+Sin[t]
1
6
In[]:=
Plot[θ[t]/.sol,{t,-2π,2π}]
Out[]=
Double pendulum
Double pendulum
f={2ϕ''[t]+ω''[t]Cos[ϕ[t]-ω[t]]+ω'[t]Sin[ϕ[t]-ω[t]]+2Sin[ϕ[t]]0,ϕ[0]π/12,ϕ'[0]0}(*Firstequationofmotion*)
Out[]=
2Sin[ϕ[t]]+Sin[ϕ[t]-ω[t]][t]+2[t]+Cos[ϕ[t]-ω[t]][t]0,ϕ[0],[0]0
′
ω
′′
ϕ
′′
ω
π
12
′
ϕ
g={ω''[t]+ϕ''[t]Cos[ϕ[t]-ω[t]]-ϕ'[t]Sin[ϕ[t]-ω[t]]+Sin[ω[t]]0,ω[0]π/12,ω'[0]0}(*Secondequationofmotion*)
Out[]=
Sin[ω[t]]-Sin[ϕ[t]-ω[t]][t]+Cos[ϕ[t]-ω[t]][t]+[t]0,ω[0],[0]0
′
ϕ
′′
ϕ
′′
ω
π
12
′
ω
In[]:=
ans=DSolve[{f,g},{ϕ,ω},{t,-2π,2π}]
In[]:=
NDSolve2Sin[ϕ[t]]+Sin[ϕ[t]-ω[t]][t]+2[t]+Cos[ϕ[t]-ω[t]][t]0,ϕ[0],[0]0,Sin[ω[t]]-Sin[ϕ[t]-ω[t]][t]+Cos[ϕ[t]-ω[t]][t]+[t]0,ω[0],[0]0,{ϕ,ω},{t,-2π,2π}
′
ω
′′
ϕ
′′
ω
π
12
′
ϕ
′
ϕ
′′
ϕ
′′
ω
π
12
′
ω
Out[]=
ϕInterpolatingFunction,ωInterpolatingFunction
In[]:=
Plot[{ϕ[t],ω[t]}/.ans,{t,-2π,2π}]
Out[]=
