w2 = 6;
m = 2;
T = 2.0;
sol = NDSolveValue[{q'[t] == \[Zeta][t]ζ[t], \[Zeta]'[t]ζ'[t] + w2*Sin[q[t]] == 0,
0, q[0] == Pi/3., \[Zeta][0]ζ[0] == 0}, {q, \[Zeta]ζ}, {t, 0, T}]
Plot[sol[[1]]'[t], {t, 0, T}]
solFEM = NDSolveValue[{q'[t] == \[Zeta][t]ζ[t], \[Zeta]'[t]ζ'[t] + w2*Sin[q[t]] == 0,
DirichletCondition[{q[t] == Pi/3., \[Zeta][t]ζ[t] == 0},
t == 0]},
{q, \[Zeta]ζ}, t \[Element]∈ Line[{{0}, {T}}], Method -> {"FiniteElement"}]
Plot[solFEM[[1]]'[t], {t, 0, T}]
solFEM =
NDSolveValue[{q'[t] == \[Zeta][t]ζ[t], \[Zeta]'[t]ζ'[t] + w2*Sin[q[t]] == 0,
DirichletCondition[{q[t] == Pi/3., \[Zeta][t]ζ[t] == 0},
t == 0]},
{q, \[Zeta]ζ}, t \[Element]∈ Line[{{0}, {T}}],
Method -> {"FiniteElement",
"MeshOptions" -> {MaxCellMeasure -> 0.01}}]
In[26]:=FindMinimum[sol[[1]]'[t]FindMinimum[sol[[1]]'[t], {t, 0.5}]
Out[26]=(* {-2.44949, {t -> 0.688223}} *)
In[27]:=FindMinimum[solFEM[[1]]'[t]FindMinimum[solFEM[[1]]'[t], {t, 0.5}]
••• FindMinimum: The line search decreased the step size to within the tolerance specified by AccuracyGoal and PrecisionGoal but was unable to find a sufficient decrease in the function. You may need more than MachinePrecision digits of working precision to meet these
••• FindMinimum: The line search decreased the step size to within the tolerance specified by AccuracyGoal and PrecisionGoal but was unable to find a sufficient decrease in the function. You may need more than MachinePrecision digits of working precision to meet these tolerances.
(* tolerances.
Out[27]={-2.1981, {t -> 0.5}} *)
In[28]:=FindMinimum[solFEM[[1]]'[t]FindMinimum[solFEM[[1]]'[t], {t, 0.688223}]
••• FindMinimum: Line search unable to find a sufficient decrease in the function value with MachinePrecision digit
••• FindMinimum: Line search unable to find a sufficient decrease in the function value with MachinePrecision digit precision.
(* precision.
Out[28]={-2.45211, {t -> 0.69}} *)