Borrar filtros
Borrar filtros

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

5 visualizaciones (últimos 30 días)
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 comentario
d
d el 8 de Mzo. de 2017
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?

Iniciar sesión para comentar.

Respuesta aceptada

Alan Weiss
Alan Weiss el 8 de Mzo. de 2017
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 comentarios
Alan Weiss
Alan Weiss el 8 de Mzo. de 2017
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

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by