I am attempting to code a problem for a meteorology class. Our initial equation was as follows:
$$\tfrac{\partial u}{\partial t} = \nu \tfrac{\partial^2 u}{\partial x^2} (*)$$
We were then assigned this finite differencing to program:
$$\tfrac{\zeta_{j}^{n+1}-\zeta_{j}^{n-1}} {2\Delta t} = \nu \tfrac{\zeta_{j+1}^{n}-\zeta_{j}^{n+1}-\zeta_{j}^{n-1}+\zeta_{j-1}^{n}}{\Delta x^{2}} (\&)$$
n and j denote time and space respectively.
The problem reads as follows: "Graph (for t = 10000s) one wavelength of the discrete solutions for k=2 [i.e., interval: -$\pi /4$, 3$\pi /4$] and k=4 [i.e., interval: -$\pi /8$, 3$\pi /8$] assuming $\zeta_{0}^{n}=0,\zeta_{j}^{n}=0,\zeta_{j}^{1}=\zeta_{j}^{0}$ for j = 1,......,nx-1, and $\Delta x = L/(nx-1)$, where $L=2\pi /k$. Use $\Delta t = 10s, 1000s, 2000s$, and $5000s.$ How does your analytic solution from solving (*) above compare to the discrete solution a t = 10000s add the analytic solution for t = 10000s to your graph)? Note that there should be two graphs with 5 curves here! What happens to your discrete solution as $\Delta t$ increases?"
I have never seen such a differencing as in the RHS of (&). The LHS is clearly central differencing, yet the right hand side is something I unfamiliar with. It is clearly not forward space, central space, or back space. I am supposed to somehow rearrange (&) to solve for $\zeta_{j}^{n+1}$ and then program the above problem. I do not see how I am supposed to do this, either mathematically or analytically as I do not know of any such differencing methods, and I have spent over 6 hours trying to answer this question.
My apologies if this belongs in the coding forum as I was uncertain whether to post this in math or coding. I am completely unaware of any ways to simultaneously go through two different loops in code, and I have never seen this kind of differencing that combines time and space.
