# DE URGENT Help

• February 11th 2009, 08:59 AM
Happy Dancer
DE URGENT Help
Ok, I have to solve this using a computer program but if someone can just explain the question to me that would be a start.

y'(t)=-20y+e^-t

Solve for 0£t£10 using the forward Euler with time-step 0.1, i.e. write the derivative in terms of y(t) and y(t+dt), with the time set to t on the right hand side, and solve y(t+dt) to set up the update scheme.

I've read up on the Euler's forward scheme but still don't understand what the question is asking or how to go about it!
• February 11th 2009, 10:13 AM
danothy
$\mathsf{f(t,y)=\frac{dy}{dt}=-20y+e^{-t}}$

Eulers method basically boils down to:

$\mathsf{y_{i+1}=y_i+f(y_i,t_i)\cdot \Delta t}$

Where your $\mathsf{\Delta t}$ is your time step and each forward y value is calculated from the current time t, the current y value and the time step.

For the specific case you've stated:

$\mathsf{y_{i+1}=y_i+\left(-20y_i+e^{-t_i}\right)\cdot \Delta t}$

If put that into a spreadsheet with an initial value for y when t=0 it'll produce the estimated values
• February 11th 2009, 10:31 AM
Happy Dancer
Ok for the backward one my tutor gave me this

y=(y+dt e^(-n dt))/(1+20 dt)

I don't understand how he's got that. Any ideas?
• February 11th 2009, 01:05 PM
danothy
Well for a backwards step approach the equation just becomes:

$\mathsf{y_{i-1}=y_i-f(y_i,t_i)\cdot \Delta t}$ and needs an initial value for y when t=10.

I'm not really sure what the n represents in that equation, I may have learnt the method with different notation to the way your tutor is teaching it.