pdetoode[u[variables], t, grid, differenceorder, periodic]
pdetoode[{u, v, …}[variables], t, {grid1, grid2, …}, differenceorder, periodic]
pdetoode[{u[variables], v[variables], …}, t, {grid1, grid2, …}, differenceorder, periodic]
Well, sometimes I feel that this syntax is a design miss, perhaps I should have made the syntax more simlar with NDSolve
. We know, method of lines is a method that discretizes PDE(s) to a system of ODEs i.e. we need to discretize all the independent variables except for t
(to be more precisepreciser, the independent variable of the resulting ODEs). For example, if the original dependent variable is u[x, t, y]
, it'll eventually be transformed to something equivalent to Outer[{x, y}|->u[x, y][t], gridx, gridy]
; if
Outer[{x, y}|->u[x, y][t], gridx, gridy]
If it's Derivative[1, 1, 1][u][x, t, y]
, it's transformed to something equivalent to NDSolve`FiniteDifferenceDerivative[{1, 1}, {gridx, gridy}, Outer[{x, y}|->u[x, y]'[t], gridx, gridy], …]
. (Notice
NDSolve`FiniteDifferenceDerivative[{1, 1}, {gridx, gridy},
Outer[{x, y}|->u[x, y]'[t], gridx, gridy], …]
Notice this is done with a single fdd
in the source code. )
For example, if we're discretizing u[x, t, y]
in the domain $[1,4]\times[2,3]$, then u[1, t, y]
will finally evaluate to something equivalent to Outer[{x, y}|->u[x, y][t], gridx, gridy][[-1, All]]
.
Outer[{x, y}|->u[x, y][t], gridx, gridy][[-1, All]]