Euler's method.
Solve the decay equation in Example 12.3.2 in the text analytically. That is, find the formula for the solution to
dtdy=−0.5y,y(0)=100
in terms of a decaying exponential, and then use a calculator to compare your values to the approximate solution values y1 and, y2 computed with Euler's method in Table 12.4 in the text.
Comparing approximate and true solutions. For this question, you may use a calculator.
Use Euler's method to find an
approximate solution to the differential equation
dxdy=y
with y(0)=1. Use a step size h=0.1 and find the values of y
up to x=0.5. Compare the value you have calculated for y(0.5) using Euler's
method with the true solution of this differential equation. What is the
error i.e. the difference between the true solution and the
approximation?
Now use Euler's method on the differential equation
dxdy=−y
with y(0)=1. Use a step size h=0.1 again and find the values of y
up to x=0.5. Compare the value you have calculated for y(0.5) using Euler's
method with the true solution of this differential equation. What is the
error this time?
use Euler's method with two steps to approximate y(1).
Answer+
y(1)≈0 (actually: y(1)=0)
Full solution+
To get from x=0 to x=1 in two steps, we'll use Δx=21.
t0211y00+21(0)=00+21(0)=0y′00
Note: what's happened is that we chanced upon a steady state solution: the constant solution y=0 is the solution to the initial value problem. So in this case, our approximation is actually exact.
Remark: the exact solution to this initial value problem is y(t)=7710t, which is a line (and so has constant slope). Note the slopes in the table are constant as well. Furthermore, our `approximate' value for y(1.5) turns out to be the exact value of y(1.5).
Source
Questions 1 through 3 are from Keshet, Chaper 12, which intentionally omits some answers. Other questions are original content.