【发布时间】:2015-05-12 11:14:34
【问题描述】:
我正在使用 MatLab 求解耦合 PDE 系统,pdenonlin。
我为我的几何体创建了一个网格(一个中间有一个圆孔的方形盒子),并对其进行细化,直到我:
[p,e,t] = initmesh('DefectGeom2');
[p,e,t] = refinemesh('DefectGeom2',p,e,t);
我解决系统
% SOLUTION:
u = pdenonlin(b_s,p,e,t,c_s,a_s,f_s);
% EXTRACT different functions from the full solutions (systems):
np = size(p,2); % number of node points
uk = reshape(u,np,[]); % each uk column has one component of u
因此,我现在有了我的 uk(在我的情况下为 3)解决方案。
现在我想计算这个近似解的积分和导数。我尝试使用tri2grid 插值到统一网格:
x=linspace(-1,1,Npts);
y=x;
psi=tri2grid(p,t,uk(:,3),x,y);
theta=tri2grid(p,t,uk(:,1),x,y);
theta_y=derivative(theta,1,2);
psi_x=derivative(psi,1,1);
并计算:
pressure = trapz(x,psi_x-cos(2*theta).*theta_y+sin(2*theta));
但这给了我一个很差的近似值,我猜是因为网格是均匀的,而网格在中心圆周围更细,在其他地方更粗。
有没有一种方法可以使用 MatLab 内置函数来计算 pdenonlin 解的导数,而无需在统一网格上使用 tri2grid 进行粗暴插值?
【问题讨论】: