Message Boards Message Boards

0
|
2824 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

use parameter of ParametricNDSolve as a variable of a function to FindRoot?

Posted 9 years ago
v0 = 10.;
d = 12.;
m = 5.5;
pot[x_] := v0 - v0*(Exp[-(x + 2)^2] + Exp[-(x - 2)^2/m]);
Plot[{0., pot[x]}, {x, -d, d}, PlotRange -> {Automatic, {-2, 10}}]
p[e_] := Sqrt[v0 - e];
sol1[e_] := 
  ParametricNDSolve[{sy''[x] + sy[x]*(e - (pot[x])) == 0, sy[0] == 1, 
    sy'[0] == 0},
   {sy}, {x, 0, d}, {e}];
u1[e_] := sy[d] /. sol1[e]; pu1[e_] := sy'[d] /. sol1[e];
one[e_] := p[e]*u1[e] + pu1[e];
FindRoot[one[e] == 0, {e, 1.}]
POSTED BY: Dhruv Sharma
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract