0
$\begingroup$

For such a equation

$$-y''(x) + x^2\cdot y(x) - |y(x)|^2\cdot y(x) = 0$$

with initial conditions: $y(-500) = 0$ and $y(500) = 0$.

I write in mathematica

ic1 = 0;
xmax = 500;
xmin = -500;
sol = NDSolve[{-y''[x] + x^2*y[x] - Abs[y[x]]^2*y[x] == 0, 
   y[xmax] == ic1, y[xmin] == ic1}, y[x], {x, xmin, xmax}]
Plot[y[x] /. sol, {x, xmin, xmax}]

but the graph is incorrect. Please help me

$\endgroup$
9
  • $\begingroup$ Can you show the output? It produces a straight zero line for me. $\endgroup$
    – m0nhawk
    May 24 '15 at 12:21
  • $\begingroup$ as far as i know, straight zero line is incorrect for this differential equation $\endgroup$
    – ssemish
    May 24 '15 at 12:25
  • 4
    $\begingroup$ Well, you can see pretty easily that y(x)=0 is a solution to the DE and the boundary conditions. $\endgroup$ May 24 '15 at 12:30
  • $\begingroup$ ok, let me correct my expression it is mistake to say incorrect, but are you saying it has only trivial solution ? $\endgroup$
    – ssemish
    May 24 '15 at 12:37
  • 1
    $\begingroup$ Solving for y[x], we can see that there is only one real root. (Solve[-y''[x] + x^2*y[x] - Abs[y[x]]^2*y[x] == 0, y[x]]). Moreover, your conditions suggestion that, there will be only trivial solution to this problem. Please paste a link, where we can see the equation ourselves. $\endgroup$
    – zhk
    May 24 '15 at 15:12
1
$\begingroup$

It seems that the ode under discussion has only trivial solution.

I checked it with both Mathematica and maple and got what was expected.

Mathematica output

Plot[y[x] /. sol, {x, xmin, xmax}]

enter image description here

Maple output

restart:with(plots):

ode:=-diff(y(x),x$2)+x^2*y(x)-abs(y(x))^2*y(x)=0;

ics:=y(-500)=0,y(500)=0;

p:=dsolve({ode,ics},numeric);

odeplot(p);

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks for all reply....@ Dr. Wolfgang Hintze yes i am searching for its eigenvalue problem as an exercise either, as you mentioned, with added the term like E*y(x) where E is eigenvalue, Do you have any idea? $\endgroup$
    – ssemish
    May 25 '15 at 9:14

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.