Transform a solution vector of PDE into a piecewise linear function - MATLAB

StackOverflow https://stackoverflow.com/questions/12914458

  •  07-07-2021
  •  | 
  •  

I know that when I use the PDE toolbox in Matlab to solve a PDE the result is a vector, which represents the values of the function in each vertex of the mesh.

Is there a command in the PDE toolbox such that we could transform the vector solution into a piecewise linear function on the domain of definition, so that we could be able to use it like u(x,y) to find directly the approximate value in (x,y)?

有帮助吗?

解决方案

I don't know about such function. But your solution is defined on a structured rectangular grid. If you simply need to interpolate data on a 2D rectangular grid, you can use interp2 for that. If your grid is made of triangles, use TriScatteredInterp. If you want to use different interpolation (e.g., FEM), you will have to implement it yourself.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top