| San José State University
Department of Economics
in the Solution of Nonlinear Differential Equations
The analysis starts with the simplest case: dy/dt = -y2. The use of a forward difference approximation of dy/dt at t, i.e., (y(t+h)-y(t))/h; gives more accurately an approximation of dy/dt at t+h/2. Thus the finite difference scheme is really an attempt to find an approximate solution to:
After dealing with this case an extention to the more general problem will be presented.
As stated above this equation arises in the use of a forward difference of size h as an approximation of the first derivative dy/dt.
Let y(t-h/2) be approximated by y(t)-(h/2)(dy/dt) so
This differential equation can be written as
The solution for dy/dt, using the formula for the solution of a quadratic equation, is
The Taylor series approximation of the square root term is
Thus the solution for dy/dt using the plus form of the square root term is
This differential equation has the solution
This transcendental equation does not have an explicit solution for y as a function of t, but having t as a function of y is just as good.
The solution for the backward differences is obtained by making h a negative value; i.e.,
The numerical approach uses the scheme
An example with h=1 yields the results shown below.
As can be seen from the graph above, the numerical solution using forward differences tracks not the solution to the differential equation but instead it is an approximation to the solution of the corresponding differential-difference equation. Thus the numerical solution provides a good approximation to the solution of the differential equation only to the extent that the solution to the corresponding differential-difference equation appoximates the solution to the differential equation.
The preceding analyis generalizes to the case
where y0 is the value of y at t=0.
For the forward difference the corresponding differential-difference equation is:
Putting this equation in differential form gives
which, upon integration from 0 to t gives
F(y) - F(y0) + (h/2)ln(f(y)/f(y0)) = t
The backward difference approximation leads to the same expression except for a negative sign for the logarithmic term.
Thus the effect of forward or backward differencing in the solution of a differential equation of the type dy/dt = f(y) is to shift the time at which a particular level of y is achieved by an amount proportional to the timestep and a logarithmic term; i.e., (h/2)ln(f(y)/f(y0)). The logarithmic term is a function of the ratio of dy/dt at time t to what it was at t=0.
HOME PAGE OF Thayer Watkins