# Analysis of spatial discretization of a PDE

1. Jul 14, 2011

### zhidayat

Hi everybody,

I hope I am asking in the right forum.
Let describe the problem as follows:
I have a 1D heat equation. To solve it, I use finite-difference method to discretize the PDE and obtain a set of N ODEs. The larger N gives the better solution, i.e., the closer the solution to the original PDE. I can also further discretized in time so that I have a set of difference-equations and find the temperature distribution.

My question:
Are there tools that can be used to analyze the influence of the discretization (spatially) to the analytic solution?

2. Jul 14, 2011

### hunt_mat

Not too sure what you're asking but there are tests to tell you the stability of your finite difference scheme, suppose that dx and dt are the increments in x and t than there is a rule involving dx and dt which gives you a restriction on what values of dx and dt you are able to take.

These are in general called stability criterion I believe.

3. Jul 14, 2011

### pmsrw3

I think I understand what zhidayat is asking. He's solved his problem numerically by a finite difference method, and he also has an analytic solution. He wants to analyze how good a job the FDM does. Of course, if you have an analytic solution, the FDM solution is kind of pointless, but what he proposes nevertheless makes sense as a way of seeing how well the FDM works.

Unfortunately, I don't know of any tools, in the sense of software packages, or special techniques. I expect they exist, since FDM solution of DEs is an important and difficult topic, but I just don't know about them. But the particular problem he's solving is a pretty easy one. I would just plot the solutions against each other and plot the difference between them, then redo the numerical solution with the interval decreased by a factor of two. That's not too sophisticated but will give you a fair idea of how well it works and what pathologies it might develop.

4. Jul 14, 2011

### hunt_mat

How about he chooses a particular time and examines the $\ell^{2}$ norm of the differences?

5. Jul 14, 2011

### pmsrw3

Yes, of course. But that's just one number. I think you want more fine-grained information.

6. Jul 14, 2011

### hunt_mat

It's one number for a given time, do this for all the time steps and you will end up with a function that will gives you the general feeling of the convergence.

7. Jul 14, 2011

### pmsrw3

Well, you did say "How about he chooses a particular time..."

This is why I suggested plotting the solutions.

8. Jul 14, 2011

### zhidayat

Thanks for some ideas.
I am thinking of something similar as the Shannon-Nyquist theorem for which gives condition for minimum sampling period with respect to information not stability.
But perhaps the method is non exist, I do not know.

9. Jul 15, 2011

### pmsrw3

The Nyquist criterion applies -- if you want spatial frequencies up to B (for bandwidth), you need to sample at 2B -- i.e. your grid points should be <= 1/2B apart. But this is simple for the heat equation. Diffusion makes high frequencies go away very rapidly. The decay rate is proportional to the square of the frequency. In fact, if you're concerned about the frequency spectrum, you should solve the problem in frequency space directly. Diffusion is equivalent to Gaussian smoothing. This is actually the most efficient numerical method to solve the heat equation, too.

10. Jul 15, 2011

### zhidayat

Interesting ..., I get your point. Do you know references that have presented/discussed what you have told me above? Could you tell me please?

11. Jul 15, 2011

### pmsrw3

Here are my notes from some lectures I gave on this topic. Note sure how much sense they'll make without the talk, but you can take a look at them. If you have the fortitude to wade through them, I'll try to answer any questions.

#### Attached Files:

File size:
1.8 MB
Views:
122
• ###### notes_v4.pdf
File size:
1.9 MB
Views:
119
12. Jul 15, 2011

### zhidayat

Thank you pmsrw3. Browsing the notes, they has something to do with Fourier series/transform I guess. I will read it more careful later.

13. Jul 15, 2011

### pmsrw3

They are about using the heat equation (which, for reasons of context, I refer to as the diffusion equation -- but it's the same) as a way to introduce Fourier transforms. Anyway, they demonstrate that the heat equation is equivalent to Gaussian smoothing.