Message Boards Message Boards

0
|
4972 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

How to Check Solution of PDE - Method of Lines

Posted 11 years ago
Hi All,

I have solved the PDE by using Method of Lines.

My questions are:
how can I check if I got right ansver ( I dont know anatical solution)  and how sould I interpret it. Graphs are reasonable.

My Mathematica code is attached. My PDE is at the top of code. Thanks in advance. PS: I have never taken PDE course..
Attachments:
POSTED BY: selahittin cinar
2 Replies
So generically, there are a number of tests when examining a PDE problem solved with MoLs. However, the different tests don't address all possible issues. 

A common test is to check convergence. For instance, if you  used RK4 and fourth-order finite differencing on the spatial derivatives, you should see fourth order convergence. To do this, you use three different resolutions which produce three different solutions, S1, S2 and S4. Let's assume for this that you used N points, 2N points and 4N points respectively. Ideally, there is a true solution (though this is not always gaurunteed) and S1 = S + E1 where E1 is the error in solution S1. You can then measure the change in error DE1_2 = S1-S2 = S + E1 - S - E2 = E1 - E2. Similarly, DE2_4 = S2-S4. Since you don't know the true solution, you also don't know the absolute error, but if your convergence is correct, the relative error should converge.  

Let's do some math. E1 = 2^O E2 = 4^O E4 where O is your order of convergence. Here, the 2 and 4 represent the different resolutions.

     E1-E2 = (2^O-1) E2 = (2^0-1)2^O E4
     E2-E4 = (2^O-1) E4

thus

    (E2-E4)/(E2-E1) = (2^O-1) E4/((2^0-1)2^O E4) = (1/2)^O

and you can measure O to be your order of convergence. This should agree with the order of your approximations.

If you are measuring convergence as expected, then you are likely doing a lot right, but often, there may be hidden issues. For instance, if you have systematic error, the approximate solutions could in fact be represented as S1 = S + E1 + E(L) where L is some arbitrary parameterization. In such cases, you may measure convergences that are below or even above what you expect. A good rule of thumb is that if you measure convergence at higher order than you expect, you likely have an error that needs to be fixed. If you measure the order of convergence below what you expect, you could have an error, or you could be miscomprehending the order of all your approximations. On the other hand, if the parameterization L has no dependence on resolution, then you could measure the correct convergence without any recognition that you have systematic error.

Also, this only applies if you are using constant order approximations such as finite differencing. If you are using a spectral decomposition in space, the order of convergence is not constant as you increase the number of points. 
POSTED BY: Jason Grigsby
Hi Jason,

Is this what should I do or I totally misunderstood it?

It does not work anyway..

Thanks..
Attachments:
POSTED BY: selahittin cinar
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract