So I have a rather non-trivial differential equation. I can't solve it analytically so I want to solve it numerically using NDSolve. But the thing is that the output just becomes what I had as input, the command does not execute.
So, I have a Lagrangian given by: L2 = r^3 (((1/Pi)*Sqrt[(1^4)*(Sin[x[r]]^4) + (Pi*(800) - x[r] + (1/2)*Sin[2*x[r]])^2])*(1 + ((1/2)*(x'[r]^2))) + (1/Pi)*(Pi*(800) - x[r] + (1/2) Sin[2*x[r]]))
With some help from below (<3) I get:
eq={D[D[L2, x'[r]], r] == D[L2, x[r]], x[0] == 0, x'[0] == 0}
Then I use NDSolve to get
NDSolve[eq, x, {r, 0, Infinity}]
Where the range of x[r] is from zero to Pi and range of r is from zero to infinity.
But I get some errors:
1: "Power:Infinite expression $\frac{1}{0^3}$ encountered." 2: "Infinity: Indeterminate expression 0.π ComplexInfinity encountered." 3: "NDSolve: Encountered non-numerical value for a derivative atr==0."
I know that some people have solved this Lagrangian numerically in a paper so should be possible.
Are there any workarounds I could do to these error messages? Many thanks in advance!