21.04.2015 Views

Lecture Notes in Differential Equations - Bruce E. Shapiro

Lecture Notes in Differential Equations - Bruce E. Shapiro

Lecture Notes in Differential Equations - Bruce E. Shapiro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

360 LESSON 33. NUMERICAL METHODS<br />

Matlab have an extensive number of functions built <strong>in</strong> for this purpose, so<br />

<strong>in</strong> general, you will never actually need to implement the methods we will<br />

discuss <strong>in</strong> the next several sections if you conf<strong>in</strong>e yourself to those environments.<br />

Sometimes, however, the built-<strong>in</strong> rout<strong>in</strong>es don’t provide enough<br />

generality and you will have to go <strong>in</strong> and modify them. In this case it helps<br />

to understand the basics of the numerical solution of differential equations.<br />

By a numerical solution of the <strong>in</strong>itial value problem<br />

we mean a sequence of values<br />

a correspond<strong>in</strong>g mesh or grid M by<br />

and a grid spac<strong>in</strong>g as<br />

y ′ = f(t, y), y(t 0 ) = y 0 (33.4)<br />

y 0 , y 1 , y 2 , ..., y n−1 , y n ; (33.5)<br />

M = {t 0 < t 1 < t 2 < · · · < t n−1 < t n }; (33.6)<br />

h j = t j+1 − t j (33.7)<br />

Then the numerical solution or numerical approximation to the solution is<br />

the sequence of po<strong>in</strong>ts<br />

(t 0 , y 0 ), (t 1 , y 1 ), . . . , (t n−1 , y n−1 ), (t n , y n ) (33.8)<br />

In this solution the po<strong>in</strong>t (t j , y j ) represents the numerical approximation<br />

to the solution po<strong>in</strong>t y(t j ). We can imag<strong>in</strong>e plott<strong>in</strong>g the po<strong>in</strong>ts (33.8) and<br />

then “connect<strong>in</strong>g the dots” to represent an approximate image of the graph<br />

of y(t), t 0 ≤ t ≤ t n . We will use the convenient notation<br />

y n ≈ y(t n ) (33.9)<br />

which is read as “y n is the numerical approximation to y(t) at t = t n .”<br />

Euler’s Method or the Forward Euler’s Method is constructed as<br />

illustrated <strong>in</strong> figure 33.1. At grid po<strong>in</strong>t t n , y(t) ≈ y n , and the slope of the<br />

solution is given by exactly y ′ = f(t n , y(t n )). If we approximate the slope<br />

by the straight l<strong>in</strong>e segment between the numerical solution at t n and the<br />

numerical solution at t n+1 then<br />

y ′ n(t n ) ≈ y n+1 − y n<br />

t n+1 − t n<br />

= y n+1 − y n<br />

h n<br />

(33.10)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!