1
$\begingroup$

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?

$\endgroup$
4
  • $\begingroup$ 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. $\endgroup$
    – Bill
    Commented Oct 8, 2018 at 6:09
  • $\begingroup$ @Bill when I try to do: ParametricPlot{{a[s], b[s]}, {s, 0, 1}} it doesn't work, what's happening there? $\endgroup$ Commented Oct 8, 2018 at 6:18
  • $\begingroup$ 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}] $\endgroup$
    – Bill
    Commented Oct 8, 2018 at 6:28
  • $\begingroup$ You might also study whether you can justify dividing both sides of your first equation by Sin[b[s]] $\endgroup$
    – Bill
    Commented Oct 8, 2018 at 17:11

1 Answer 1

2
$\begingroup$

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:

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.