Calculating div(grad(u)) and a line integral from pde solution

2 ビュー (過去 30 日間)
Hanne
Hanne 2014 年 10 月 12 日
コメント済み: Hanne 2014 年 10 月 23 日
Dear experts,
I imported a solution of -div(grad(u))=f(u) from the pde app. I would like to do 2 things:
1. re-calculate d^2u/dx^2+d^2u/dy^2 for checking the solution
2. calculate an integral of form int g(u,du/dx,du/dy) dy along a line where x=0.
For both of these tasks, the (brute force) solutions I came up with utilizes pdegrad, tri2grid and pdeprtni a lot.
For 1. I calculate the derivatives with pdegrad, map solution to nodes with pdeprtni and pdegrad again.
For 2. I calculate derivatives with pdegrad, map to square mesh with tri2grid and integrate with trapz.
Unfortunately, all this estimation introduces error. Can anyone suggest a more straightforward & accurate way of doing this?
Thanks!
Can anyone suggest a more strayou suggest
  2 件のコメント
Siddharth Sundar
Siddharth Sundar 2014 年 10 月 14 日
編集済み: Siddharth Sundar 2014 年 10 月 14 日
-Is there a reason you are comparing the two numerical solutions?
-What is the magnitude of error introduced at every step of the calculation?
-Did you try refining the mesh further before exporting the solution to MATLAB? That might help.
-You could try integral2 instead of trapz and see if that helps.
Hanne
Hanne 2014 年 10 月 23 日
-Is there a reason you are comparing the two numerical solutions?
This is the first time I'm using pde toolbox so just wanted to see whether I defined the equation correctly.
-What is the magnitude of error introduced at every step of the calculation?
I have no idea, for now, the error seems quite small.
-Did you try refining the mesh further before exporting the solution to MATLAB? That might help
Yes, the solution didn't change much. This is the reason I think the magnitude of error isn't too large.
-You could try integral2 instead of trapz and see if that helps.
I did play around with this. I cound't figure out how to properly import the numerical data vectors u,du/dx,du/dy into integral2, but I'll take another look. Thanks for the tip!

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by