ODE and PDE, Numerical Approximations I

February 3, 2021

Content

1. Direction Field

Direction fields are valuable tools in studying the solutions of differential equations of the form:

\[\frac{d y}{d t}=f(t, y)\tag{1}\]

where \(f\) is a given function of the two variables \(t\) and \(y\), sometimes referred to as the rate function. A direction field for equations (1) can be constructed by evaluating \(f\) at each point of a rectangular grid. At each point of the grid, a short line segment is drawn whose slope is the value of \(f\) at that point. Each line segment is tangent to the graph of the solution passing through that point. The plots give you a general intuition about what does the solution look like.

Like example on B&D book, page 5, the direction field of equation: $$ \frac{d p}{d t}=\frac{p}{2}-450 $$

2. Euler’s Method

For a first-order IVP given \(f\) and \(\partial f /\partial y\) are continuous:

\[\frac{d y}{d t}=f(t, y), \quad y\left(t_{0}\right)=y_{0} \tag{2}\]

there are two facts driving the numerical approximations approaches:from existence and uniqueness theorem

  1. There is a unique solution \(y=\phi(t)\) in some interval around \(t=t_0\)

  2. It is usually not possible to find the \(\phi\) by symbolic manipulations.

From the diretive fied plotted above, we could imagine that if we have a fine enough grid, it presents a reasonable approximation of the solution, which motivates the Euler’s method as numerical approximation to equation (2)’s solutionThe formalized approximation here is \(f'(t) = \frac{f(t+\Delta t)-f(t)}{\Delta t}\). There are many forms of this truncation approximation, with different levels of error. :

  1. Start from the initial point \((t_0, y_0)\)

  2. Move a small step further \(t_1 = t_0 + \Delta t\):
    \(y_1 = y_0+f(t_0,y_0)\Delta t\)

  3. Iteratively move the point further like above:
    \(y_n = y_{n-1}+f(t_{n-1},y_{n-1})\Delta t\)

Now you have the a bunch of points \((t_i,y_i), i = 0, \dots,n\), starting from initial value \((t_0,y_0)\). Connect them with segemental lines, then you have one numerical approximation. The local truncation error level is \(O(h^2)\).

Example from B&D book section 2.7, example 1, page 78. Use Euler's method to solve: $$ \frac{d y}{d t}=3-2 t-0.5 y, \quad y(0)=1 $$ Evaluate at five points \((0,0.2,0.4,0.6,0.8,1.0)\): You can see the error gap grows larger as \(t\) increases, because the truncation error is accumulating.

Comments

ODE and PDE, Numerical Approximations I - February 3, 2021 - Minhuan Li