How Does Euler's Method Work with Non-Zero Starting Points?

  • Thread starter Thread starter Ready2GoXtr
  • Start date Start date
  • Tags Tags
    Method
Ready2GoXtr
Messages
74
Reaction score
0
Every single example i have seen of eulers method starts with a range of 0 to some number, what if you had it going from like 2 to some number?

for example

if we had
x'=2x^2 + tx x(2)=1
and our range was
2 <= t <= 2.5 with h = .25

would I do this?

x(2.25)=x(2)+f(x(2),0)*.25 = 1.5

or would i do this

x(2.25)=x(2)+f(x(2),2)*.25 = 2
 
Physics news on Phys.org
Ready2GoXtr said:
Every single example i have seen of eulers method starts with a range of 0 to some number, what if you had it going from like 2 to some number?

for example

if we had
x'=2x^2 + tx x(2)=1
and our range was
2 <= t <= 2.5 with h = .25

would I do this?

x(2.25)=x(2)+f(x(2),0)*.25 = 1.5

or would i do this

x(2.25)=x(2)+f(x(2),2)*.25 = 2

You do the latter one. The idea is that at each step (tn,xn) have the point approximately on the curve and the slope at that point x' = f(tn,xn). So the new value xn+1 = xn + hf(tn,xn) where h is the step size.
 
Back
Top