# How can I solve this non linear system of ODEs using NDSolve?

I want to find solutions to the system:

\begin{align*} -2b'(s)\sin(b(s)) &= \sin(b(s))(a'(s)b''(s) - a''(s)b'(s)) - (a'(s))^3 \sin^2(b(s))\cos(b(s)) \\ &(a'(s))^2\sin^2(b(s))+(b'(s))^2 = 1\end{align*}

using NDSolve (I want to use the functions $$a$$ and $$b$$ later). I tried it the way I solved some non linear systems before but it didn't work and I got a lot of errors. Can someone help me?

• sol={a[s],b[s]}/.NDSolve[{-2 b'[s]Sin[b[s]]==Sin[b[s]](a'[s]b''[s]-a''[s]b'[s])-a'[s]^3 Sin[b[s]]^2 Cos[b[s]], a'[s]^2 Sin[b[s]]^2+ b'[s]^2==1, a'[0]==1/2,a[0]==1, b'[0]==1, b[0]==0},{a[s],b[s]}, {s,0,1}]; Plot[sol,{s,0,1}] Change the initial conditions to match your actual conditions. Please report what errors remain.
– Bill
Oct 8, 2018 at 6:09
• @Bill when I try to do: ParametricPlot{{a[s], b[s]}, {s, 0, 1}} it doesn't work, what's happening there? Oct 8, 2018 at 6:18
• sol={a[s],b[s]}/.NDSolve[{-2 b'[s]Sin[b[s]]==Sin[b[s]](a'[s]b''[s]-a''[s]b'[s])-a'[s]^3 Sin[b[s]]^2 Cos[b[s]], a'[s]^2 Sin[b[s]]^2+ b'[s]^2==1, a'[0]==1/2,a[0]==1, b'[0]==1, b[0]==0},{a[s],b[s]}, {s,0,1}][[1]]; ParametricPlot[sol, {s, 0, 1}]
– Bill
Oct 8, 2018 at 6:28
• You might also study whether you can justify dividing both sides of your first equation by Sin[b[s]]
– Bill
Oct 8, 2018 at 17:11

You may try this:

Clear[eq1, eq2, initConds, sol];
eq1 = -2 b'[s] Sin[b[s]] ==
Sin[b[s]] (a'[s] b''[s] - a''[s] b'[s]) -
a'[s]^3 Sin[b[s]]^2 Cos[b[s]];
eq2 = a'[s]^2 Sin[b[s]]^2 + b'[s]^2 == 1;
initConds = {a[0] == 1, a'[0] == 1/2, b[0] == 0, b'[0] == 1};

sol = NDSolve[{eq1, eq2, initConds}, {a, b}, {s, 0, 5}]
ParametricPlot[Evaluate[{a[s], b[s]} /. sol], {s, 0, 5}]


There is a warning though:

NDSolve::ntdvdae: Cannot solve to find an explicit formula for the derivatives. NDSolve will try solving the system as differential-algebraic equations.


The plot is: