필터 지우기
필터 지우기

How can I Identify Boundary Labels when writing a PDE code (not with the pdetool)?

조회 수: 5 (최근 30일)
I want to solve the Laplace equation using MATLAB, without using the PDE app. I first created a geometry which includes several rectangles, depending on user choise. Now I need to identify the labels of each boundary to determine the boundary conditions (applyBoundaryCondition). Is there another way besides manually plotting the geometry (pdegplot(model,'EdgeLabels','on')), to know the labels of each boundary? Some automatic code that will determine which boundary is which?
Thanks in advance
  댓글 수: 1
d
d 2017년 3월 8일
Following this question, is there a possibility to define different boundary conditions for the same edge?
For example:
I created a 2D rectangle with corner-coordinates as follows:
(0,0),(0,a),(a,b),(a,0).
Now, on one edge [between (0,0)->(0,a)] I need different boundary conditions in different places. (0,0)->(0,a/3): Neumann boundary condition (Insulated du/dx=0) (0,0)->(a/3,2a/3): Dirichlet boundary condition (u=0) (0,0)->(2a/3,a): Neumann boundary condition (Insulated du/dx=0)
Is there a way to write this boundary all together? or I must divide my geometry to three rectangles and define them separately?

댓글을 달려면 로그인하십시오.

채택된 답변

Alan Weiss
Alan Weiss 2017년 3월 8일
Check out how to create geometry using a geometry function. You have complete control over the geometry labels.
And to have different boundary conditions on the same edge, yes, you must divide the edge by placing edges that divide it into sections. You could fake this by having a condition that depends on the location, but that would not be as exact, as things could go one way or another near the dividing point depending on the mesh.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 3
Alan Weiss
Alan Weiss 2017년 3월 8일
Yes, you need to place new edges in the geometry function, which divide the real edges where you like. You can ignore the new edges in your coefficient functions, but be aware that the mesh will respect the new edges as real.
Alan Weiss
MATLAB mathematical toolbox documentation

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Boundary Conditions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by