where ,
Consider the special test example with spatially variable coefficients,
on , with initial conditions:
on and boundary conditions:
for t > 0 with , , m = 11, n= 101 and mesh requirements,
,
,
where , for i=0 to m, for j=0 to n. Use an high order Forward Finite Difference approximation for . If your method needs corner values, i.e., and , use the average values of the boundary and initial conditions. Warning: Do not write your code only for numerical values given here, but write it more generally and not just for this test case.
where here and are the Central Finite Difference (CFD) approximations using corresponding to the derivatives and , respectively.
The Crank-Nicolson Implicit Method (CNIM) is
where and the corresponding CFD derivatives are and , all using as discrete values. Use the Thomas Tridiagonal Solver Algorithm to solve.
The 4th order Runge-Kutta Explicit method (RKEM) (modified PPDE for this Computer Problem from the 4th order RKEM ODE method) is written,
for interior points, where
with with corresponding derivatives and (all indexed at (i,j)),
with and corresponding derivatives and ,
with and corresponding derivatives and , and
with and corresponding derivatives and , using as discrete values. Each should satisfy derivative boundary conditions where they are specified, for [p] = 1, 2, 3, and 4.
1) Compute once and store the spatially dependent coefficients in an array to use in all time steps.
2) Avoid calculating items like constant expressions in loops, but keep code general.
Added Note: These methods can also be used for nonlinear PPDEs,
directly for EEM and RKEM, but with a predictor-corrector modification
for CNIM.
Email Comments or Questions to hanson@uic.edu