0
$\begingroup$

i have to solve some solitons scattering through this coupled equations. i need to get two different graph, but still the graph did not come out. and also the equations quite complicated containing hyperbolic trigo . (maybe just for me). i dont know whether the problems come from the hyperbolic equations that i used, or becoz of initial condition.the coding as below:

u = 0.05;
g = 0.2;
s = NDSolve[{x''[t] == 4/(\[Pi]^2 x[t]^3) - 10/(\[Pi]^2 x[t]^2) - (80 g)/(3 
\[Pi]^2 x[t]^3) - ((6 u)/(\[Pi]^2 x[t]^2))[1/Cosh[y[t]/x[t]]^2 - (2 
y[t])/x[t] Sinh[y[t]/x[t]]/Cosh[y[t]/x[t]]^3], 
y''[t] == u (y[t]/(x[t]^3))[Sinh[y[t]/x[t]]/Cosh[y[t]/x[t]]^3], 
x[1] == -3, x'[1] == 0, y[0] == 1, y'[0] == 3}, {x, y}, {t, 0,100}]
Plot[Evaluate[{x[t], y[t]} /. %], {t, 0, 100}, PlotRange -> All, PlotPoints -> 200]
$\endgroup$
2
  • $\begingroup$ There's a bigger problem at the moment NDSolve::ndnum: Encountered non-numerical value for a derivative at t == 0.. You should review your equations. $\endgroup$
    – Sektor
    Commented Jun 18, 2014 at 10:47
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Michael E2
    Commented Oct 16, 2014 at 14:54

1 Answer 1

3
$\begingroup$

First, your code contains simple mistake, you should distinguish [] from (), then your equations still can't be solved, it's a common problem for the boundary value problem (BVP) of nonlinear ODE(s), and the almost only solution as far as I know is "shooting method":

u = 5/100; 
g = 2/10; 
s = NDSolve[{x''[t] == 4/(π^2 x[t]^3) - 10/(π^2 x[t]^2) - 
             (80 g)/(3 π^2 x[t]^3) - ((6 u)/(π^2 x[t]^2))(1/Cosh[y[t]/x[t]]^2 - 
             (2 y[t])/x[t] Sinh[y[t]/x[t]]/Cosh[y[t]/x[t]]^3), 
             y''[t] == u (y[t]/(x[t]^3))(Sinh[y[t]/x[t]]/Cosh[y[t]/x[t]]^3), 
             x[1] == -3, x'[1] == 0, y[0] == 1, y'[0] == 3}, {x, y}, {t, 0, 100}, 
    Method -> {"Shooting", "StartingInitialConditions" -> 
                           {x[0] == -3, x'[0] == 0, y[0] == 1, y'[0] == 3}}]

Plot[{x[t], y[t]} /. s, {t, 0, 100}, PlotRange -> All, Evaluated -> True]

enter image description here

$\endgroup$
2
  • $\begingroup$ at first, the initial condition used were x[1] == -3, x'[1] == 0, y[0] == 1, y'[0] == 3 then why at the shooting command, we must change t value to 0 for both x and x'? "Shooting", "StartingInitialConditions" -> {x[0] == -3, x'[0] == 0, y[0] == 1, y'[0] == 3} $\endgroup$
    – ameera
    Commented Jun 23, 2014 at 4:31
  • $\begingroup$ @ameera "StartingInitialConditions" is just a guess, here I just choose it casually. For your equations there're many available "StartingInitialConditions", for example {x[0] == -1, x'[0] == -1, y[0] == 0, y'[0] == 0}, but it's also worth to mention that it can be really hard to choose proper initial conditions for some equations, for example this one. $\endgroup$
    – xzczd
    Commented Jun 25, 2014 at 3:03

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.