Question on Euler's method - Calculations using rounded numbers? HELP

joshuad
Messages
5
Reaction score
0

Homework Statement



Taking step size h = 0.2, use Euler’s Method to determine y(1.6), given that
dy/dx = ln(2y+x) ; y(1)=1.2
Record your results to 5 decimal places at each step.

Homework Equations



N/A

The Attempt at a Solution



My question is to do with the method, not the solution, specifically the 'Record your results to 5 decimal places at each step' part. I know that basically you need to use 2 iterations to get an approximation for y(1.6). In the calculations themselves do I use the full values displayed on my calculator, or do I use the value rounded to 5 decimal places?

For example:

y'(1,1.2) = 1.22377543162

then to get y(1.2) we use y[n+1] = y[n] + hy'[n]

so y(1.2) = 1.2 + 0.2( y'[n] )

My question is at this point, do I use 1.22377543162 -or- do I use 1.22378 for y'[n] to calculate y(1.2)?

Please Help! :)
 
Physics news on Phys.org
You are always using rounded values in this sort of calculation - proceed as normal.
Record 5dp ... but calculate to all the dp you have.
 
So I would write down (in this case) y'[n]=1.22378 in my table, but actually use 1.22377543162 in the calculation to work out y(1.2)?
 
That's right - you are over thinking this ... imagine your calculator gave you 1000 digits each time, would you want to write them all down?
I use GNU Octave - it does its calculations to 8dp, but only actually reports 4dp.
At each stage it stores the whole precision numbers and uses the whole precision in calculations.

Write down 5dp, but use all the dp in the next iteration.
Otherwise you'll accumulate rounding errors.

If you are still nervous, do it both ways and see what difference it makes.
 
  • Like
Likes 1 person
Prove $$\int\limits_0^{\sqrt2/4}\frac{1}{\sqrt{x-x^2}}\arcsin\sqrt{\frac{(x-1)\left(x-1+x\sqrt{9-16x}\right)}{1-2x}} \, \mathrm dx = \frac{\pi^2}{8}.$$ Let $$I = \int\limits_0^{\sqrt 2 / 4}\frac{1}{\sqrt{x-x^2}}\arcsin\sqrt{\frac{(x-1)\left(x-1+x\sqrt{9-16x}\right)}{1-2x}} \, \mathrm dx. \tag{1}$$ The representation integral of ##\arcsin## is $$\arcsin u = \int\limits_{0}^{1} \frac{\mathrm dt}{\sqrt{1-t^2}}, \qquad 0 \leqslant u \leqslant 1.$$ Plugging identity above into ##(1)## with ##u...
Back
Top