Exercise 16
As humans we sometimes take for granted that time can only move forwards, but when we’re working with differential equations time can move both ways. We’ll explore this in this problem, where we put the “backwards” in “backwards Euler method”.
Consider the differential equation [t y' - y = t^4 - 3 ,,] with “terminal condition” (y(1) = 0) . Use the implicit Euler method [y_n = y_ - hf(t_, y_)] with step size (h = frac<1><2>) to estimate (y(0)) .
Solve the initial value problem and determine what value of (y(0)) would lead to a solution which has a root at (t=1) . [Do you even need the specific solution to determine (y(0)) ? Is something weird going on here?]
Check that upping the number of steps from two to four improves the accuracy of the approximation.
Qaror
We have (f(t,y) = frac). We treat (t=1) , (y=0) as the end conditions (i.e., (t_2 = 1) , (y_2 = 0) ) and we’ll compute (y_1) to go with (t_1 = frac<1><2>) and (y_0) to go with (t_0 = 0) . The nice thing about using backward Euler is that when time is reversed the method is explicit! We’re told just how to calculate (y_) from (y_). Doing so, we get (f(t_2, y_2) = -2) , so (y_1 = 1) , and then (f(t_1, y_1) = -3.875) , so (y_0 = 2.9375) . Our estimate is around two and a half.
In normal form the equation is (y'-frac<1>,y = t^3 - frac<3>). The proper integrating factor is (mu(t) = frac<1>) , so we get (y(t) = frac <3>+ 3 + ct) . At this point we can stop: whatever (c) is, the solution is going to have (y(0) = 3) . This looks like a gross failure of uniqueness when (t=0) , and indeed there is such a failure because the coefficients are not continuous at (t=0) .
The algorithm produces the following table I’ll put the numbers in the order we get the numbers, rather than in order of increasing time. [oshlanishi t & 1 & 0.75 & 0.5 & 0.25 & 0 hline y & 0 & 0.5 & 1.2278 & 2.0827 & 2.9961 end] We get much closer to the (3) we were expecting.
Exercise 17
Let (y(t)) be the solution to the differential equation (y' - 3y = t^2) with (y(1) = 1) . Use the explicit Euler method with a step size of (frac<1><2>) to estimate (y(0)) . Was this easier or harder than the previous problem?
Qaror
This is going to be harder because the so-called explicit Euler method is implicit when working in reverse. The method says [y_ = y_n + h f(t_n, y_n) ,,] but the thing that we want is (y_n) . So we’ll have to solve this for (y_n) so that we can get “past” information from the “future” data. The function is (f(t,y) = t^2 + 3y) , and our step size is (h = frac<1><2>) . So we need to rearrange [y_ = y_n + frac<1> <2>left( t_n^2 + 3y_n ight) ,,] and doing so gives us [y_n = frac <5>+ frac<2y_> <5>,.] Now we plug in (t_n = 0.5) , (y_ = 1) , then in the next iteration we plug in (t_n = 0) and (y_ = ext). Doing so, the method tells us (y(0.5) approx 0.45) and (y(0) approx 0.18) .
Exercise 18
You’ve estimated the error of a fourth order method on an interval ([0,10]) with (20) time steps. If you increase to (60) time steps, by what factor will the error go down?
5>5>2>1>2>1>2>1>3>1>3>1>2>1>2>1>
Do'stlaringiz bilan baham: |