Message Boards Message Boards

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

NDSolve input value lies outside interpolation range

Hello everyone! I have a problem with NDSolve. I'm trying to solve a quite complicated system of ODE (4 equations with the needf for 6 initial conditions). These are 4 Einstein's equations, second order in 2 of the 4 functions. Here is a piece of my code:

    Asol[Ah0_?NumberQ, \[Phi]h0_?NumberQ, \[Chi]h0_?NumberQ] := 
     A /. NDSolve[{EOM[[1]] == 0, EOM[[2]] == 0, EOM[[3]] == 0, 
         EOM[[4]] == 0, 
         A[1 - \[Epsilon]] == 
          Ahor[Ah0, \[Phi]h0, \[Chi]h0][1 - \[Epsilon]], 
         A'[1 - \[Epsilon]] == 
          Ahor[Ah0, \[Phi]h0, \[Chi]h0]'[1 - \[Epsilon]], \[Phi][
           1 - \[Epsilon]] == \[Phi]hor[Ah0, \[Phi]h0, \[Chi]h0][
           1 - \[Epsilon]], \[Phi]'[
           1 - \[Epsilon]] == \[Phi]hor[Ah0, \[Phi]h0, \[Chi]h0]'[
           1 - \[Epsilon]], 
         f[1 - \[Epsilon]] == 
          fhor[Ah0, \[Phi]h0, \[Chi]h0][1 - \[Epsilon]], \[Chi][
           1 - \[Epsilon]] == \[Chi]hor[Ah0, \[Phi]h0, \[Chi]h0][
           1 - \[Epsilon]]}, {A, \[Phi], f, \[Chi]}, {z, 
         1 - \[Epsilon], \[Delta]}, WorkingPrecision -> 20][[1]]
Where I defined delta = 10^-8.
Now, if I call my solution as:

    Asol[1, 1, 1][\[Delta]]

Then I obtain the following error message:

InterpolatingFunction::dmval: Input value {1.*10^-8} lies outside the range of data in the interpolating function. Extrapolation will be used. >>

It seems weird to me since I integrated up to delta. I also tried to ask the function at, for example, 10*delta but the same error pops up. Any idea of what I'm doing wrong?

Thanks a lot! Cheers Angelo

POSTED BY: Angelo Esposito
2 Replies

I am really sorry but unfortunately I can't since it is a very long and involved notebook. I can try to explain it a little bit better though. I have four coupled differential equations (EOM[[i]]) for four unkown functions (A[z], phi[z], f[z], chi[z]). They must be computed for z between 1-epsilon and a certain small delta. To solve the equations I need to specify 6 conditions at z=1-epsilon. Now, 3 of them are know while the other 3 are unkown. This is why my NDSolve has three variables. All the complication in the code I posted is due to the difficulty in finding the initial conditions with a good accuracy.

The code I posted only concerns one of the functions, A[z], but the same thing happens for all the solutions. When I try to evaluate the solution at the other extremum, delta, by inputing three explicit values for the intial conditions I find the error. It seems pretty odd since I explicitely ask NDSolve to integrate from 1-epsilon to delta.

I'm sorry if I can't provide more code. Thanks anyway!

POSTED BY: Angelo Esposito
Posted 10 years ago

If you start Mathematica, scrape and paste exactly and only what you have shown above into the notebook, and evaluate the notebook then I don't think you get the error you are describing.

Would it be possible to edit what you have posted to make it possible to exactly reproduce the problem you are seeing? Would it be possible to do that without making the problem more complicated?

Thank you

POSTED BY: Bill Simpson
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