Message Boards Message Boards

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

Solve a 2nd Order ODE with NDsolve? (get a high precision result)

Posted 8 years ago

Hello, I am trying to create a simple example for high precision/accuracy (I know that I can't really use them interchangeably) . I am trying to get 25 digit accurate result. Because this is just a simple show case problem I choose a known function. But I only was able to reach 10^-10 accuracy. How can I obtain a better result? Why I can't increase the accuracy goal to 17?

Uwol = Cos[(Pi xwol)^4];
L = -1; R = 1;
Plot[Uwol, {xwol, L, R}]
dUwol = D[Uwol, xwol];
d2Uwol = D[dUwol, xwol];
Bc1 = SetAccuracy[Uwol /. xwol -> L, 75];
Bc2 = SetAccuracy[dUwol /. xwol -> R, 75];
xeval = Range[L, R, (R - L)/100];
s = NDSolve[{Unum''[xwol] - d2Uwol == 0, Unum[L] == Bc1, 
   Unum'[R] == Bc2}, Unum, {xwol, L, R}, AccuracyGoal -> 16, 
  PrecisionGoal -> 50, WorkingPrecision -> 60]
Plot[Evaluate[Unum[xwol] /. s], {xwol, L, R}, PlotRange -> All]
converge = Unum[xeval] /. s[[1]];
realU = Uwol /. xwol -> xeval;
error = Abs[converge - realU];
lister = Transpose[{xeval, error}];
ListPlot[lister]

Thank you

Erdem

POSTED BY: Erdem Uguz
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