# numerical solution to differencial equation

• May 8th 2007, 07:25 PM
numerical solution to differencial equation
dy/dx = y' = f(x,y(x)) = 2e^(-x^2)

Solve this differential equation using Heun's method and plot solution over -5 < x < 5. You'll need to derive the appropriate initial condition y(x0) = y0

:confused:
• May 9th 2007, 12:06 AM
CaptainBlack
Quote:

dy/dx = y' = f(x,y(x)) = 2e^(-x^2)

Solve this differential equation using Heun's method and plot solution over -5 < x < 5. You'll need to derive the appropriate initial condition y(x0) = y0

:confused:

Heun's method is the basic Predictor Corrector method. This uses the Euler
step to predict the value of y(x+h) using y(x) and y'(x). Then using the
prediction of y(x+h) calculate the derivative y'(x+h), then a new estimate
of the derivative over the interval is taken as the average of the two
derivatives found and y(x+h) is then found using an Euler step with this
new estimate of the derivative.

Here f(x,y(x)) is independent of y so that makes things a bit simpler, since
now we can calculate y'(x+h) without having to estimate y(x+h). So in
this case the Heun step is:

y(x+h) = y(x) + h [y'(x) + y'(x+h)]/2

RonL
• May 9th 2007, 12:20 AM
CaptainBlack
Quote:

dy/dx = y' = f(x,y(x)) = 2e^(-x^2)

Solve this differential equation using Heun's method and plot solution over -5 < x < 5. You'll need to derive the appropriate initial condition y(x0) = y0

:confused:

Quote:

Originally Posted by CaptainBlack
Heun's method is the basic Predictor Corrector method. This uses the Euler
step to predict the value of y(x+h) using y(x) and y'(x). Then using the
prediction of y(x+h) calculate the derivative y'(x+h), then a new estimate
of the derivative over the interval is taken as the average of the two
derivatives found and y(x+h) is then found using an Euler step with this
new estimate of the derivative.

Here f(x,y(x)) is independent of y so that makes things a bit simpler, since
now we can calculate y'(x+h) without having to estimate y(x+h). So in
this case the Heun step is:

y(x+h) = y(x) + h [y'(x) + y'(x+h)]/2

RonL

So now we can do the integration, lets assume the initial condition is y(-5)=0.

A table showing the calculation is shown in the attachment.

RonL