- #1
Tangent87
- 148
- 0
Say we have some partial differential equation for u(x,t) and we devise a numerical method to solve it. For example if we say unm is the solution at x=hm and t=kn with m=0,...,M and n=0,...,N where h and k are the step-lengths, and then our method is something like:
[tex]u_m^{n+1}=u_m^{n-1}+2u_{m+1}^n-u_m^n-3u_{m-1}^n+k(u_{m+2}^n-u_{m-2}^n)[/tex]
and we're given u(x,0) and u(x,k) so we can work out u0m and u1m for all m. We then stick n=1 into the recurrence in a bid to work out u2m for all m. But what happens if we stick m=0 or 1 now into the recurrence do we just let u1m-2 and u1m+2 be equal to 0 or is the recurrence just not defined for m=0 or 1? In which case how do we find u20 say?
[tex]u_m^{n+1}=u_m^{n-1}+2u_{m+1}^n-u_m^n-3u_{m-1}^n+k(u_{m+2}^n-u_{m-2}^n)[/tex]
and we're given u(x,0) and u(x,k) so we can work out u0m and u1m for all m. We then stick n=1 into the recurrence in a bid to work out u2m for all m. But what happens if we stick m=0 or 1 now into the recurrence do we just let u1m-2 and u1m+2 be equal to 0 or is the recurrence just not defined for m=0 or 1? In which case how do we find u20 say?