How to integrate PDE solution in 2D space?
15 ビュー (過去 30 日間)
古いコメントを表示
I am solving a time dependent PDE using solvepde. I want to numerically integrate the solution (at the end time, tf) over a 2D space on a semicircle (Face 2) in the geometry. The geometry I'm using is:
R1 = [3;4;-0.01;0.01;0.01;-0.01;-0.01;-0.01;0;0];
R2 = [3;4;-0.01;0.01;0.01;-0.01;0;0;0.01;0.01];
C1 = [1;0;0;Rg];
C1 = [C1;zeros(length(R1) - length(C1),1)];
gm = [R1,R2,C1];
sf = '(R1+C1)-R2';
ns = char('R1','R2','C1')';
g = decsg(gm,sf,ns);
geometryFromEdges(model,g);
figure
pdegplot(model,'EdgeLabels','on','FaceLabels','on');
I've tried using the following to get me in the right direction, but haven't been able to make any progress.
xq = -0.01:0.001:0.01;
yq = -(0.007317./2).*ones(size(xq));
uintrp = interpolateSolution(result,xq,yq);
No matter how I try to set up xq and yq, I always get the following error:
Error using pde.PDEResults/validatePointsMatrix (line 3)
Query point matrix does not contain coordinates of 2-D space in required format.
Can anyone help me?
0 件のコメント
採用された回答
Ravi Kumar
2020 年 1 月 16 日
If you are solving a single PDE, i.e., you used createpde(1) then you need to specify time-steps as the last argument. If you have a system of PDEs, then you need to also specify the component of solution:
uintrp = interpolateSolution(result,xq,yq,1:size(tlist));
where tlist is what you used in solvepde.
Regards,
Ravi
3 件のコメント
Ravi Kumar
2020 年 1 月 16 日
I don't think asymmetry in tspan shouldn't matter. The interpolated solution grid could be coarser than the actual solution grid. Can you elaborate on what is the difference with images that compare them?
Regards,
Ravi
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で General PDEs についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!