Connect with users of Wolfram technologies to learn, solve problems and share ideas
Mark as an Answer
2 Total Likes
Follow this post
Share this post:
How to Check Solution of PDE - Method of Lines
10 years ago
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..
Jason Grigsby, Wolfram Research Inc.
10 years ago
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
(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.
10 years ago
Is this what should I do or I totally misunderstood it?
It does not work anyway..
Reply to this discussion
in reply to
Community posts can be styled and formatted using the
Tag limit exceeded
Note: Only the first five people you tag will receive an email notification; the other tagged names will appear as links to their profiles.
Add a file to this post
Follow this discussion
Be respectful. Review our
to understand your role and responsibilities.
Wolfram|Alpha Notebook Edition
Volume & Site Licensing
Enterprise Private Cloud
Service Plans Benefits
Wolfram Language Documentation
Wolfram Language Introductory Book
Get Started with Wolfram
Fast Introduction for Programmers
Fast Introduction for Math Students
Webinars & Training
Connected Devices Project
Wolfram Data Drop
Wolfram + Raspberry Pi
. All rights reserved.
Learn how »