I want to numerically solve the following exemplary partial differential equation in discretized form. My question is more about the technique how one would implement this in Mathematica (not about a specific solution to the equation). The discretized equation reads as follows:
n is e.g. the n-th time step (
j e.g. the j-th spatial step (
Note that the initial function f[0,j] shall be given for all
j (one can restrict it e.g. to the interval
I tried to implement it with
FoldList but fail to match the dimensions of my array. Is
FoldList the wrong idea here or how could one do it?
Help is very much appreciated. Thank you!
In principle, I could also implement it with loops. However, I wonder whether this is the most performant way.