Discretising Elliptic PDE in cylindrical coordinates

In summary: I am having trouble with.I am having trouble trying to get to the 2-point difference formula from the discretization of the energy functional.Please can you help me with the 2-point difference formula and tell me what you mean when you say 'The difference matches more or less with a shift of a half grid size'?Thank you.In summary, the conversation discusses the discretization of an energy functional using different lattice sizes. They also mention the use of the trapezoidal rule for integration and the 2-point difference formula for approximating first derivatives at points halfway between lattice points. However, there is confusion about the use of 1/8h in the discretization and
  • #1
ognik
643
2
Given an energy functional $ E=\int_{0}^{\infty} \,dr.r\left[\frac{1}{2}\left(\d{\phi}{r}\right)^2 - S.\phi\right] $
I am told that discretizing on a lattice ri=ih (h=lattice size, i is i axis) leads to :

$ 2{r}_{i}{\phi}_{i} - {r}_{i+\frac{1}{2}}{\phi}_{i+1} - {r}_{i-\frac{1}{2}}{\phi}_{i-1} = {h}^{2}{r}_{i}{S}_{i} $

I am also told that that a lattice $ {r}_{i}=\left(i - \frac{1}{2}\right)h $ leads to the same result. And yes, I worked this out and it did lead to the above equation - but when I did the exercise for the lattice ri=ih, I couldn't get the same result (see below):

From $ E=\int_{0}^{\infty} \,dr.r\left[\frac{1}{2}\left(\d{\phi}{r}\right)^2 - S.\phi\right] =\int_{0}^{\infty} \,dr\left[r\frac{1}{2}\left(\d{\phi}{r}\right)^2 - r.S.\phi\right] $

Discretising, $ E=\frac{1}{2h}\sum_{1}^{N} {r}_{i}\left({\phi}_{i} - {\phi}_{i-1}\right)^2 - h \sum_{1}^{N} {r}_{i}{S}_{i}{\phi}_{i} $

Using the variation principle we ask that $ \pd{E}{{\phi}_{i}} = 0 $
$ So\: \pd{E}{{\phi}_{i}} = \pd{E}{{\phi}_{i}}[\frac{1}{2h}\sum_{1}^{N} {r}_{i}\left({\phi}_{i} - {\phi}_{i-1}\right)^2 - h \sum_{1}^{N} {r}_{i}{S}_{i}{\phi}_{i}] = 0 $

$ \therefore \frac{1}{2h} \pd{E}{{\phi}_{i}}\sum_{1}^{N} {r}_{i}\left({\phi}_{i} - {\phi}_{i-1}\right)^2 = h {r}_{i}{S}_{i} $
$ \therefore \frac{1}{2} \pd{E}{{\phi}_{i}} [{r}_{1}\left({\phi}_{1} - {\phi}_{0}\right)^2 + ... +\: {r}_{i}\left({\phi}_{i} - {\phi}_{i-1}\right)^2 + \: {r}_{i+1}\left({\phi}_{i+1} - {\phi}_{i}\right)^2 +...+{r}_{N}\left({\phi}_{N} - {\phi}_{N-1}\right)^2 ]
= h^2 {r}_{i}{S}_{i} $

$ \therefore \left( {r}_{i} + {r}_{i+1}\right) {\phi}_{i} - {r}_{i}{\phi}_{i-1} - {r}_{i+1}{\phi}_{i+1} = h^2 {r}_{i}{S}_{i} $

This is close to the equation I am trying to get to, and I can use $ \frac{1}{2}\left({r}_{i} + {r}_{i+1}\right) = {r}_{i+\frac{1}{2}} $ to get
$ \therefore 2{r}_{i+\frac{1}{2}} {\phi}_{i} - {r}_{i}{\phi}_{i-1} - {r}_{i+1}{\phi}_{i+1} = h^2 {r}_{i}{S}_{i} $

Clearly if I subtract $\frac{1}{2}$ from all the indices I have got there for the left side (but not the right) - but (apart from the right side) how can I justify that? I would seem to be shifting the basis by $\frac{1}{2}$ - and with r from cylindrical coords, $ {r}_{i} \ne {r}_{i-\frac{1}{2}} $
 
Mathematics news on Phys.org
  • #2
ognik said:
Given an energy functional $ E=\int_{0}^{\infty} \,dr.r\left[\frac{1}{2}\left(\d{\phi}{r}\right)^2 - S.\phi\right] $
I am told that discretizing on a lattice ri=ih (h=lattice size, i is i axis) leads to :

$ 2{r}_{i}{\phi}_{i} - {r}_{i+\frac{1}{2}}{\phi}_{i+1} - {r}_{i-\frac{1}{2}}{\phi}_{i-1} = {h}^{2}{r}_{i}{S}_{i} $

I am also told that that a lattice $ {r}_{i}=\left(i - \frac{1}{2}\right)h $ leads to the same result. And yes, I worked this out and it did lead to the above equation - but when I did the exercise for the lattice ri=ih, I couldn't get the same result (see below):

From $ E=\int_{0}^{\infty} \,dr.r\left[\frac{1}{2}\left(\d{\phi}{r}\right)^2 - S.\phi\right] =\int_{0}^{\infty} \,dr\left[r\frac{1}{2}\left(\d{\phi}{r}\right)^2 - r.S.\phi\right] $

Discretising, $ E=\frac{1}{2h}\sum_{1}^{N} {r}_{i}\left({\phi}_{i} - {\phi}_{i-1}\right)^2 - h \sum_{1}^{N} {r}_{i}{S}_{i}{\phi}_{i} $

Using the variation principle we ask that $ \pd{E}{{\phi}_{i}} = 0 $
$ So\: \pd{E}{{\phi}_{i}} = \pd{E}{{\phi}_{i}}[\frac{1}{2h}\sum_{1}^{N} {r}_{i}\left({\phi}_{i} - {\phi}_{i-1}\right)^2 - h \sum_{1}^{N} {r}_{i}{S}_{i}{\phi}_{i}] = 0 $

$ \therefore \frac{1}{2h} \pd{E}{{\phi}_{i}}\sum_{1}^{N} {r}_{i}\left({\phi}_{i} - {\phi}_{i-1}\right)^2 = h {r}_{i}{S}_{i} $
$ \therefore \frac{1}{2} \pd{E}{{\phi}_{i}} [{r}_{1}\left({\phi}_{1} - {\phi}_{0}\right)^2 + ... +\: {r}_{i}\left({\phi}_{i} - {\phi}_{i-1}\right)^2 + \: {r}_{i+1}\left({\phi}_{i+1} - {\phi}_{i}\right)^2 +...+{r}_{N}\left({\phi}_{N} - {\phi}_{N-1}\right)^2 ]
= h^2 {r}_{i}{S}_{i} $

$ \therefore \left( {r}_{i} + {r}_{i+1}\right) {\phi}_{i} - {r}_{i}{\phi}_{i-1} - {r}_{i+1}{\phi}_{i+1} = h^2 {r}_{i}{S}_{i} $

This is close to the equation I am trying to get to, and I can use $ \frac{1}{2}\left({r}_{i} + {r}_{i+1}\right) = {r}_{i+\frac{1}{2}} $ to get
$ \therefore 2{r}_{i+\frac{1}{2}} {\phi}_{i} - {r}_{i}{\phi}_{i-1} - {r}_{i+1}{\phi}_{i+1} = h^2 {r}_{i}{S}_{i} $

Clearly if I subtract $\frac{1}{2}$ from all the indices I have got there for the left side (but not the right) - but (apart from the right side) how can I justify that? I would seem to be shifting the basis by $\frac{1}{2}$ - and with r from cylindrical coords, $ {r}_{i} \ne {r}_{i-\frac{1}{2}} $

Hey Ognik,

What you write matches with the trapezoid rule.
You have evaluated a Right Rieman Sum instead of applying the Trapezoid Rule.
The difference matches more or less with a shift of a half grid size.
 
  • #3
Hi I like Serena, thanks for the links.
Sorry, but I can't see what you mean, to me it looks like they use a 2-point difference for the differential and the integration becomes the summation approximation - could you please help me step through what you mean? Thanks.
 
  • #4
Fair enough. It's not the trapezoid rule that makes the difference.
The problem is that the derivative in your discretization is half a grid size off.

The derivative at $r_i$ should be:
$$\pd \phi r(r_i) \approx \frac{\phi_{i+\frac 12} - \phi_{i-\frac 12}}{h} \approx \frac{\phi_{i+1} - \phi_{i-1}}{2h}$$

What if we discretize with:
$$ E=\frac{1}{8h}\sum_{1}^{N} {r}_{i}\left({\phi}_{i+1} - {\phi}_{i-1}\right)^2 - h \sum_{1}^{N} {r}_{i}{S}_{i}{\phi}_{i} $$
 
  • #5
What happens I'm sorry to say, is new confusion :-) Why 1/8h please?
I went through the math for your suggestion, and got to:

$ \frac{1}{4h}\left[\left({r}_{i-1} + {r}_{i+1}\right){\phi}_{i} - {r}_{i-1}{\phi}_{i-2} - {r}_{i+1}{\phi}_{i+2}\right] $

I can use $ \frac{1}{2}\left({r}_{i-1} + {r}_{i+1}\right) = {r}_{i}$, but just can't see how to get to the required equation for the other 2 terms on the LHS from there.

I have checked back in the book and they do say to use 'the 2-point difference formula to approximate each first derivative at the points halfway between the lattice points'. They also say to use the trapezoidal rule for the integrals...
 
  • #6
Hi anyone, would really appreciate some more help here, I know I must be missing something - probably basic - in my understanding of the way lattices work. I've been over this many times and just don't 'get it'. Thanks for all assistance :-)
 
  • #7
Hi I like Serena (or anyone else who can help), where I am is that I understood and applied the below:
$$\pd \phi r(r_i) \approx \frac{\phi_{i+\frac 12} - \phi_{i-\frac 12}}{h} \approx \frac{\phi_{i+1} - \phi_{i-1}}{2h}$$

and ended up with: $ \frac{1}{2}\left[\left({r}_{i-1}+{r}_{i+1}\right){\phi}_{i} - {r}_{i+1}{\phi}_{i+2} - {r}_{i-1}{{\phi}_{i-2}}_{}\right]
={h}^{2}{r}_{i}{S}_{i} $

I used $ \frac{1}{4}\left({r}_{i-1}+{r}_{i+1}\right) ={r}_{i}$ for the first part, so far so good.
But now I have to argue that $ \frac{1}{2}\left({r}_{i+1}{\phi}_{i+2}+{r}_{i-1}{\phi}_{i-2}\right) ={r}_{i+\frac{1}{2}}{\phi}_{i+1}+{r}_{i-\frac{1}{2}}{\phi}_{i-1} $

Yes, $ \frac{1}{2}\left({r}_{i+1}+{r}_{i-1}\right) ={r}_{i+\frac{1}{2}}+{r}_{i-\frac{1}{2}} $ and $ \frac{1}{2}\left({\phi}_{i+2}+{\phi}_{i-2}\right) ={\phi}_{i+1}+{\phi}_{i-1} $

...which leaves me thinking that what I need to argue is an acceptable approximation, but I am unable to justify that mathematically?

(I tried sketching something like $ {\phi}_{i}\: against \: {r}_{i}$ , but I do not think that has any meaning (despite again appearing to agree with what I'm trying to prove))
 
  • #8
ognik said:
and ended up with: $ \frac{1}{2}\left[\left({r}_{i-1}+{r}_{i+1}\right){\phi}_{i} - {r}_{i+1}{\phi}_{i+2} - {r}_{i-1}{{\phi}_{i-2}}_{}\right]
={h}^{2}{r}_{i}{S}_{i} $

Since the left hand side does not contain references to $h$, it is independent of the grid size.
So let's change the grid size of the left hand size.
Then we get:
$$ \frac{1}{2}\left[\left({r}_{i-\frac 12}+{r}_{i+\frac 12}\right){\phi}_{i} - {r}_{i+\frac 12}{\phi}_{i+1} - {r}_{i-\frac 12}{{\phi}_{i-1}}_{}\right]
={h}^{2}{r}_{i}{S}_{i}$$Btw, in my opinion, the expression you want to arrive at is flawed.
It refers to elements that are not in the grid.
What we really need, is an expression that only refers to elements that are in the grid.
The expression you ended up with, is the right one - it should not be forced into something it should not be.
 
  • #9
Thanks ILS (although I confess to a little frustration with myself, I should be able to see things like the h argument for myself).

I am not surprised at your comments on the flaws, I have the impression that the book sometimes sacrifices accuracy to allow for a simpler illustration of the principles - in this case discretisation using the variation principle.

One question remains - we can change the grid size on the LHS, why can we at the same time leave the ri on the RHS unchanged? My thought is, that is because it is a fixed point in the grid and so changing the grid size doesn't move the fixed point? (Probably not that well phrased :-))

(Finally, this topic covers the 2nd last chapter of this course, in the last chapter I have one more issue where I am stuck halfway through - subject is "Parabolic PDE algorithm" - if you have any spare time ...but completely understand if not)
 

FAQ: Discretising Elliptic PDE in cylindrical coordinates

What is the purpose of discretising elliptic PDE in cylindrical coordinates?

Discretising elliptic PDE in cylindrical coordinates is a numerical method used to solve partial differential equations (PDEs) that are described in cylindrical coordinates. It involves breaking down the continuous equations into a series of discrete equations that can be solved using numerical techniques.

How is discretising elliptic PDE in cylindrical coordinates different from other numerical methods?

This method is specifically designed for PDEs that are described in cylindrical coordinates, unlike other numerical methods which may only work for Cartesian coordinates. Additionally, discretising elliptic PDEs in cylindrical coordinates takes into account the unique geometry and boundary conditions of cylindrical systems.

What are the benefits of using cylindrical coordinates for discretisation?

Cylindrical coordinates are particularly useful for discretisation because they are well-suited for problems with cylindrical symmetry, such as those found in fluid mechanics, electromagnetism, and heat transfer. Using cylindrical coordinates can also simplify the mathematical equations and make them easier to solve.

What are the limitations of discretising elliptic PDE in cylindrical coordinates?

One limitation of this method is that it may not be applicable to all types of PDEs. It is most effective for problems with cylindrical symmetry and may not work well for other types of geometries. Additionally, the discretisation process can introduce errors, so it is important to carefully choose the discretisation parameters.

How is the accuracy of discretising elliptic PDE in cylindrical coordinates evaluated?

The accuracy of this method is typically evaluated by comparing the numerical solution to an exact analytical solution, if one exists. Other methods of error analysis, such as convergence studies and comparison to experimental data, can also be used to assess the accuracy of the numerical solution.

Similar threads

Replies
5
Views
1K
Replies
2
Views
981
Replies
1
Views
1K
Replies
1
Views
3K
Replies
20
Views
573
Replies
1
Views
2K
Replies
9
Views
5K
Back
Top