Chaim Ferguson

2022-10-23

Let's say I have solved an ODE with Euler's forward method, and also solved it using RK4, in both cases for varying decreasing step sizes h. Is there any way to look at the graphs and "see" the order of accuracy of the methods?

Adalyn Pitts

Beginner2022-10-24Added 15 answers

Yes, graph the differences of the results for stepsizes $h$ and $2h$h as double-logarithmic plot. The graph should be of lines, and the slopes correspond to the order of the method.

More precisely, the numerical result for step size $h$ is in first order of approximation

${y}_{h}={y}_{\ast}+C\xb7{h}^{p}+D/h$

where $C$ accumulates the derivative factors for the method error and $D$ accounts for the floating point errors in the evaluation of every single step.

Thus the mentioned difference gives

${y}_{2h}-{y}_{h}=({2}^{p}-1)\xb7C\xb7{h}^{p}-D/(2h)$

so that for moderately small $h\gg \sqrt[p+1]{D/C}$ one gets

$\mathrm{log}({y}_{2h}-{y}_{h})\approx \mathrm{log}(({2}^{p}-1)\xb7C)+p\xb7\mathrm{log}(h)$

More precisely, the numerical result for step size $h$ is in first order of approximation

${y}_{h}={y}_{\ast}+C\xb7{h}^{p}+D/h$

where $C$ accumulates the derivative factors for the method error and $D$ accounts for the floating point errors in the evaluation of every single step.

Thus the mentioned difference gives

${y}_{2h}-{y}_{h}=({2}^{p}-1)\xb7C\xb7{h}^{p}-D/(2h)$

so that for moderately small $h\gg \sqrt[p+1]{D/C}$ one gets

$\mathrm{log}({y}_{2h}-{y}_{h})\approx \mathrm{log}(({2}^{p}-1)\xb7C)+p\xb7\mathrm{log}(h)$

What is the area of the parallelogram with vertices A(-3, 0), B(-1, 5), C(7, 4), and D(5, -1)?

How to expand and simplify $2(3x+4)-3(4x-5)$?

Find an equation equivalent to ${x}^{2}-{y}^{2}=4$ in polar coordinates.

How to graph $r=5\mathrm{sin}\theta$?

How to find the length of a curve in calculus?

When two straight lines are parallel their slopes are equal.

A)True;

B)FalseIntegration of 1/sinx-sin2x dx

Converting percentage into a decimal. $8.5\%$

Arrange the following in the correct order of increasing density.

Air

Oil

Water

BrickWhat is the exact length of the spiraling polar curve $r=5{e}^{2\theta}$ from 0 to $2\pi$?

What is $\frac{\sqrt{7}}{\sqrt{11}}$ in simplest radical form?

What is the slope of the tangent line of $r=-2\mathrm{sin}\left(3\theta \right)-12\mathrm{cos}\left(\frac{\theta}{2}\right)$ at $\theta =\frac{-\pi}{3}$?

How many integers from 0 to 50, inclusive, have a remainder of 1 when divided by 3?

Use the summation formulas to rewrite the expression $\Sigma \frac{2i+1}{{n}^{2}}$ as i=1 to n without the summation notation and then use the result to find the sum for n=10, 100, 1000, and 10000.

How to calculate the right hand and left hand riemann sum using 4 sub intervals of f(x)= 3x on the interval [1,5]?