Using Matlab for solving 3d PDE and creating geometry
14 ビュー (過去 30 日間)
古いコメントを表示
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:
- How can I create this kind of geometry?
- How would I then manage the boundary conditions?
- 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 件のコメント
回答 (1 件)
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Geometry and Mesh についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!