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

Click For Summary

Homework Help Overview

The discussion revolves around the application of Euler's Method for approximating the value of a function at a specific point, given a differential equation and an initial condition. The original poster seeks clarification on how to handle rounding during calculations, specifically whether to use rounded values or full precision values at each step.

Discussion Character

  • Exploratory, Assumption checking

Approaches and Questions Raised

  • The original poster questions the proper approach to rounding during calculations, specifically whether to use rounded values or full precision values when applying Euler's Method. Some participants suggest using full precision for calculations while recording rounded values.

Discussion Status

Participants are exploring the implications of rounding in numerical methods. Guidance has been offered regarding the use of full precision in calculations to minimize rounding errors, while still recording results to the specified decimal places. There is no explicit consensus, but a productive direction has been provided.

Contextual Notes

The original poster is working under the constraint of recording results to five decimal places, which raises questions about the impact of rounding on the accuracy of the iterative method being used.

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   Reactions: 1 person

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
9
Views
3K
  • · Replies 7 ·
Replies
7
Views
5K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
1
Views
1K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
4
Views
4K