Message Boards Message Boards

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

Visualizing result of ParametricNDSolve

Posted 9 years ago

I want to solve and visualize system with a parameter using the following code:

L = 10
sol = ParametricNDSolve[{y'[t] == Sqrt[(k^4)/(y[t]^4) - 1], 
   y[0] == 0, Integrate[y[x]^(-2), {x, 0, L0}] == L/(k^2)}, {y[t], 
   k}, {t, 0, L0}, {L0}]
Manipulate[Plot[Evaluate[y[L0][t] /. sol], {t, 0, L}], {L0, 2, 3}]

However, I got an empty plot and no error or warning message. Why can it happen? If there is no solution, should not there be an error message?

4 Replies

Well, I have Mma 7, it doesn't know PrametricNDSolve. But may be you should give the Parameter explicitly according th the synthax

sol = ParametricNDSolve[{y'[t] == Sqrt[(k^4)/(y[t]^4) - 1],    y[0] == 0}, {y[t], k}, {t, 0, L0}, {L0,    k /. Flatten[
     Solve[Integrate[y[x]^(-2), {x, 0, L0}] == L/(k^2), k]]}]

But I can't test ihat with my old version.

POSTED BY: Hans Dolhaine

Unfortunately this does not work. The error is: << expression for k >> cannot be used as a parameter.

What is the value of k? Did you define it somewhere?

POSTED BY: Hans Dolhaine

It should be defined from the second equation.

Integrate[y[x]^(-2), {x, 0, L0}] == L/(k^2)

On the other hand, it can be defined as y(L0), but with this expression it does not work either.

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