FUNCTION REFERENCE

interpolateSolution

Interpolate a 2-D PDE solution at arbitrary query points.

Interpolate a 2-D PDE solution at arbitrary query points.

Syntax

uintrp = interpolateSolution(results, xq, yq); uintrp = interpolateSolution(results, xq, yq, iU); uintrp = interpolateSolution(results, xq, yq, iT); uintrp = interpolateSolution(results, xq, yq, iU, iT); uintrp = interpolateSolution(results, querypoints, ...)

Evaluates the finite-element solution of a pde.StationaryResults, pde.TimeDependentResults, or pde.EigenResults object at query coordinates (xq, yq) (or a 2-by-M matrix querypoints) using the mesh's linear (P1) or isoparametric quadratic (P2) shape functions. For pde.StationaryResults the optional 4th argument iU is the equation index. For scalar pde.TimeDependentResults and pde.EigenResults the optional 4th argument iT is the time-step or eigenmode index. For an N-equation time-dependent or eigenvalue result, the 4th argument iU is the equation index and the 5th argument iT is the time-step or eigenmode index. Query points outside the mesh return NaN.

Example

R1=[3;4;0;1;1;0;0;0;1;1]; dl=decsg(R1); m=createpde(); geometryFromEdges(m,dl); generateMesh(m,'Hmax',0.3,'GeometricOrder','quadratic'); specifyCoefficients(m,'m',0,'d',0,'c',1,'a',0,'f',0); applyBoundaryCondition(m,'dirichlet','Edge',1:4,'u',@(l,s) 2*l.x+3*l.y); res=solvepde(m); abs(interpolateSolution(res, 0.5, 0.25) - 1.75) < 1e-12

Differences from MATLAB: 2-D meshes only; 3-D tetrahedral meshes are not supported yet.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.