420 Partial differential equations
and the non-zero entry in the Jacobian is
J14,14 =1
(7.12) (a) Finite differences with a banded solver for the linear problem. The matrix size
is (2n)2with a bandwidth of n. So the time is n4. If we increase the nodes by a
factor of 10, the time goes up by 104and takes 103seconds.
(b) Method of lines (with finite differences) and an explicit solver like explicit Euler.
For explicit Euler, the maximum step size is
If we use a step size of 10−6, we need 107steps to reach t=10. If each step takes
10−2seconds, then the total time is at least 105seconds.
(7.13) The method of lines gives
The 4th variable z4=T2. So we need to write out the equation
From implicit Euler, we would have
There are 4 non-zero entries in the Jacobian:
∆x2+φγe−β/z4,i+1
z2
4,i+1
J4,6=−h
∆x2
(7.14) To get a higher-order method, you will need to use 5 pts centered around the node
and expand up to the fourth derivative,