Simple pendulum motion equation

de={θ''[t]+θ[t]0,θ[0]π/6,θ'[0]1}(*Thishereisthemotionequationforthesimplependlum.InitialvalueswereaddedjusttousedeDSolvecommand*)
Out[]=
θ[t]+
′′
θ
[t]0,θ[0]
π
6
,
′
θ
[0]1
In[]:=
sol=DSolve[de,θ,{t,-2π,2π}]​​
Out[]=
θFunction{t},
1
6
πCos[t]+Sin[t]
In[]:=
Plot[θ[t]/.sol,{t,-2π,2π}]​​
Out[]=

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]
π
12
,
′
ϕ
[0]0
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]
π
12
,
′
ω
[0]0
In[]:=
ans=DSolve[{f,g},{ϕ,ω},{t,-2π,2π}]
In[]:=
NDSolve2Sin[ϕ[t]]+Sin[ϕ[t]-ω[t]]
′
ω
[t]+2
′′
ϕ
[t]+Cos[ϕ[t]-ω[t]]
′′
ω
[t]0,ϕ[0]
π
12
,
′
ϕ
[0]0,Sin[ω[t]]-Sin[ϕ[t]-ω[t]]
′
ϕ
[t]+Cos[ϕ[t]-ω[t]]
′′
ϕ
[t]+
′′
ω
[t]0,ω[0]
π
12
,
′
ω
[0]0,{ϕ,ω},{t,-2π,2π}
Out[]=
ϕInterpolatingFunction
Domain: {{-6.28,6.28}}
Output: scalar
,ωInterpolatingFunction
Domain: {{-6.28,6.28}}
Output: scalar

In[]:=
Plot[{ϕ[t],ω[t]}/.ans,{t,-2π,2π}]
Out[]=
​
​