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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

15<br />

that s<strong>in</strong>ce the slope of the solution y(t) at any po<strong>in</strong>t is dy/dt, and s<strong>in</strong>ce<br />

dy/dt = f, then the slope at (t, y) must be equal to f(t, y). We obta<strong>in</strong> the<br />

direction field but divid<strong>in</strong>g the plane <strong>in</strong>to a fixed grid of po<strong>in</strong>ts P i = (t i , y i )<br />

and then then draw<strong>in</strong>g a little arrow at each po<strong>in</strong>t P i with slope f(t i , y i ).<br />

The lengths of all the arrows should be the same. The general pr<strong>in</strong>cipal is<br />

illustrated by the follow<strong>in</strong>g example.<br />

Example 2.3. Construct the direction field of<br />

dy<br />

dt = t2 − y (2.11)<br />

on the region −3 ≤ t ≤ 3, −3 ≤ y ≤ 3, with a grid spac<strong>in</strong>g of 1.<br />

First we calculate the values of the slopes at different po<strong>in</strong>ts. The slope is<br />

given by f(t, y) = t 2 − y. Several values are shown.<br />

t y = −3 y = −2 y = −1 y = 0 y = 1 y = 2 y = 3<br />

t = −3 12 11 10 9 8 7 6<br />

t = −2 7 6 5 4 3 2 1<br />

t = −1 4 3 2 1 0 −1 −2<br />

t = 0 3 2 1 0 −1 −2 −3<br />

t = 1 4 3 2 1 0 −1 −2<br />

t = 2 7 6 5 4 3 2 1<br />

t = 3 12 11 10 9 8 7 6<br />

The direction field with a grid spac<strong>in</strong>g of 1, as calculated <strong>in</strong> the table<br />

above, is shown <strong>in</strong> figure 2.4 on the left. 5 At each po<strong>in</strong>t, a small arrow is<br />

plotted. For example, an arrow with slope 6 is drawn centered on the po<strong>in</strong>t<br />

(-3,3); an arrow with slope 1 is drawn centered on the po<strong>in</strong>t (-2, 3); and so<br />

forth. (The values are taken directly with the table). A direction field of<br />

the same differential equation but with a f<strong>in</strong>er spac<strong>in</strong>g is illustrated <strong>in</strong> fig<br />

2.4 on the right. From this plot we can image what the solutions may look<br />

like by construct<strong>in</strong>g curves <strong>in</strong> our m<strong>in</strong>ds that are tangent to each arrow.<br />

Usually it is easier if we omit the arrows and just draw short l<strong>in</strong>es on the<br />

grid (see figure 2.5, on the left 6 ). The one-parameter family of solutions is<br />

illustrated on the right. 7<br />

5 The direction field can be plotted <strong>in</strong> Mathematica us<strong>in</strong>g f[t , y ] := t^2 - y;<br />

VectorPlot[{1, f[t, y]}/Norm[{1, f[t, y]}], {t, -3, 3}, {y, -3, 3}]. The normalization<br />

ensures that all arrows have the same length.<br />

6 In Mathematica: f[t , y ] := t^2 - y; followed by v[t , y , f ] :=<br />

0.1*{Cos[ArcTan[f[t, y]]], S<strong>in</strong>[ArcTan[f[t, y]]]}; L[t , y , f ] := L<strong>in</strong>e[{{t,<br />

y - v[t, y, f], {t, y} + v[t, y, f]}]; Graphics[Table[L[t, y, f], {t, -3, 3, .2}, {y, -3, 3, .2}]]<br />

7 The analytic solution y = e −t ( e t t 2 − 2e t t + 2e t − e t 0t 0 2 + e t 0y 0 − 2e t 0 + 2e t 0t 0<br />

)<br />

was used to generate this plot. The solution can be found <strong>in</strong> Mathematica via<br />

DSolve[{y’[t] == t^2 - y[t], y[t0] == y0}, y[t], t].

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

Saved successfully!

Ooh no, something went wrong!