How to create 2-D geometry from a sequence of points in PDE toolbox?

7 ビュー (過去 30 日間)
I have a set of (x, y) points in 2D. I want to solve a PDE on the boundary defined by these points. How to create 2-D geometry from this sequence of points in PDE toolbox?

採用された回答

MathWorks Support Team
MathWorks Support Team 2018 年 4 月 5 日
Following is one approach to create 2-D geometry from a sequence of points. This will create a closed polygon. This approach can only be used in MATLAB 2018a. This is because prior to 2018a, the function "geometryFromMesh" only accepts 3D points and makes 3D models. In 2018a, this function can also support 2D points creating 2D models.
X = [0 0; 4 0; 8 0; 12 0; 16 0; 16 2; 2 2; 2 3; 8 3; 8 5; 0 5];
pg = polyshape(X(:,1),X(:,2));
plot(pg);
tr = triangulation(pg);
% Create a PEDE Model
pdem = createpde;
% Create the geometry from the triangulatiom
% Some of the intermediate points in the polygon are abstracted away
pdem.geometryFromMesh(tr.Points', tr.ConnectivityList')
pdegplot(pdem,'VertexLabels','on')
In the following link there is another generalized example for creating circle, rectangle, ellipse shaped geometries in the PDE toolbox:
This approach can be followed in releases prior to 2018a as well (verified in 17b).

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometry and Mesh についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by