Using Matlab for solving 3d PDE and creating geometry

조회 수: 18 (최근 30일)
amit amit
amit amit 2018년 12월 10일
편집: Ravi Kumar 2024년 5월 1일
Hi I need to solve a 3D diffusion equation on a geometry of a sphere inside a cube.
However - I saw that in PDE toolbox I can only create a sphere inside a sphere or a cube inside a cube. Therefore I would like to ask:
  1. How can I create this kind of geometry?
  2. How would I then manage the boundary conditions?
  3. What is the right syntax for coefficient speficiation in 3D (speficially here the sphere is a source and the cube has no source)?
Thanks.
  댓글 수: 1
sevgi
sevgi 2024년 3월 7일
hello, I have a similar problem. did you find a solution

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

답변 (1개)

Ravi Kumar
Ravi Kumar 2024년 4월 30일
편집: Ravi Kumar 2024년 5월 1일
Here is an example.
gmCube = fegeometry(multicuboid(1,1,1));
gmCube = gmCube.translate([0,0,-0.5]); % Translate so that the cube is centered at the origin.
gmSphere = fegeometry(multisphere(0.25));
gmSphereInCube = addCell(gmCube,gmSphere);
pdegplot(gmSphereInCube,'CellLabels','on','FaceAlpha',0.5)
If you are using MATLAB R2022b or older, then skip the fegeometry() calls.

카테고리

Help CenterFile Exchange에서 Geometry and Mesh에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by