- #1
ognik
- 643
- 2
Hi, struggling to follow some text which later leads to computer algorithms for Elliptic PDEs...
It reads:
To derive a discrete approx. to the PDE based on the variational principle,. we 1st approx. E in terms of the values of the field at the lattice points and then vary w.r.t. them. The simplest approx. to E is to employ the 2-point diiference formula to approx. each 1st deriv in $ {\left(\nabla \phi\right)}^{2} $ at the points halway between the lattice points and to use the trapezoidal rule for the integrals. This leads to:
$ E=\frac{1}{2}\sum_{i=1}^{N}\sum_{j=1}^{N}[({\phi}_{i,j} - {\phi}_{i-1,j})^2 + ({\phi}_{i,j} - {\phi}_{i,j-1})^2] - {h}^{2} \sum_{i=1}^{N}\sum_{j=1}^{N}{S}_{i,j}{\phi}_{i,j} $
Putting $ \pd{E}{{\phi}_{i,j}}=0 $ in the above, leads to $ -\frac{1}{{h}^{2}}[({\phi}_{i+1,j}+{\phi}_{i-1,j}-2{\phi}_{i,j}) + ({\phi}_{i,j+1}+{\phi}_{i,j-1}-2{\phi}_{i,j})] = {S}_{i,j} $
<Twitch>
I have never encountered a derivative like this before - a derivative w.r.t. an indexed function, I'd appreciate how to handle this.
Reasonably $ \pd{{\phi}_{i,j}}{{\phi}_{i,j}}=1 $ will sort the last term, but I have no idea how to approach things like $ \pd{{\phi}_{i-1,j}}{{\phi}_{i,j}} $, especially hiding inside summations on those indexes ?
(BTW, h is the lattice size, some in both i & j directions)
Thanks
It reads:
To derive a discrete approx. to the PDE based on the variational principle,. we 1st approx. E in terms of the values of the field at the lattice points and then vary w.r.t. them. The simplest approx. to E is to employ the 2-point diiference formula to approx. each 1st deriv in $ {\left(\nabla \phi\right)}^{2} $ at the points halway between the lattice points and to use the trapezoidal rule for the integrals. This leads to:
$ E=\frac{1}{2}\sum_{i=1}^{N}\sum_{j=1}^{N}[({\phi}_{i,j} - {\phi}_{i-1,j})^2 + ({\phi}_{i,j} - {\phi}_{i,j-1})^2] - {h}^{2} \sum_{i=1}^{N}\sum_{j=1}^{N}{S}_{i,j}{\phi}_{i,j} $
Putting $ \pd{E}{{\phi}_{i,j}}=0 $ in the above, leads to $ -\frac{1}{{h}^{2}}[({\phi}_{i+1,j}+{\phi}_{i-1,j}-2{\phi}_{i,j}) + ({\phi}_{i,j+1}+{\phi}_{i,j-1}-2{\phi}_{i,j})] = {S}_{i,j} $
<Twitch>
I have never encountered a derivative like this before - a derivative w.r.t. an indexed function, I'd appreciate how to handle this.
Reasonably $ \pd{{\phi}_{i,j}}{{\phi}_{i,j}}=1 $ will sort the last term, but I have no idea how to approach things like $ \pd{{\phi}_{i-1,j}}{{\phi}_{i,j}} $, especially hiding inside summations on those indexes ?
(BTW, h is the lattice size, some in both i & j directions)
Thanks
Last edited: