1
$\begingroup$

I am trying to solve this equation:

DSolve[{y''[x] + y'[x]* 0.002 + 4*Sin[2*y[x]] == 0, 
  y[0] == 0.005*n*(30 - n), y'[0] == 0 }, y[x], x]

However, it keeps giving this result:

Solve::ifun :
Inverse functions are being used by Solve, so some solutions may not be found;
use Reduce for complete solution information.
$\endgroup$
  • $\begingroup$ That's a warning message and not a result. What do you get as the actual output? $\endgroup$ – J. M. will be back soon Sep 26 '17 at 7:15
  • $\begingroup$ I don't know why my output is also my input ? is it because it can not solve my equation? $\endgroup$ – vatly tienganh Sep 26 '17 at 7:19
  • 1
    $\begingroup$ That means that Mma does not know the result. Nothing to do. Not all equations exhibit a solution that can be expressed in analytical functions, the more, the dissipative version of the Sine-Gordon. Try to solve it numerically. $\endgroup$ – Alexei Boulbitch Sep 26 '17 at 7:59
1
$\begingroup$

Do the numerical version

ndsol = NDSolve[{Derivative[2, 0][y][x, n] + 
 Derivative[1, 0][y][x, n]*0.002 + 4*Sin[2*y[x, n]] == 0, 
    y[0, n] == 0.005*n*(30 - n), Derivative[1, 0][y][0, n] == 0}, 
    y, {x, -10, 10}, {n, -40, 50}]

Plot3D[y[x, n] /. First@ndsol, {x, -10, 10}, {n, -40, 50}, 
    ImageSize -> 600]

enter image description here

$\endgroup$
1
$\begingroup$

Following Alexei Boulbitch's hint:

sol = ParametricNDSolve[{y''[x] + y'[x]*0.002 + 4*Sin[2*y[x]] == 0, 
       y[0] == 0.005*n*(30 - n), y'[0] == 0}, y, {x, 0, 1}, {n}]

Plot[Evaluate[Table[y[n][x] /. sol, {n, -1, 1, .5}]], {x, 0, 1}, 
 PlotRange -> All, PlotLegends -> {# & @@@ Range[-1, 1, 0.5]}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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