How do I mesh a matlab model

1 vue (au cours des 30 derniers jours)
N G
N G le 11 Juin 2024
I am trying to mesh a geometry. The geometry was modelled on matlab. Most meshing examples on matlab involve importing of the geometry. How do I mesh a model that was made in matlab. The model code as well as the mesh code has been given below.
rect1=[3
4
-530
530
530
-530
0
0
-530
-530];
C1=[1
0
0
228.6];
C2=[1
0
0
520.5];
C1 = [C1;zeros(length(rect1) - length(C1),1)];
C2 = [C2;zeros(length(rect1) - length(C2),1)];
gd = [C1,C2,rect1];
ns = (char('C1','C2','rect1'));
ns = ns';
sf='(C2)-(C1+rect1)';
dl = decsg(gd,sf,ns);
model = createpde("thermal","transient");
ge = geometryFromEdges(model,dl);
% 2D -> 3D extrusion
gd1 = extrude(ge,96);
figure
pdegplot(gd1,"FaceLabels","on")
model = femodel(Geometry="gd1");
model = generateMesh(model,Hmax=5,Hmin=1);
pdemesh(model)

Réponse acceptée

sai charan sampara
sai charan sampara le 11 Juin 2024
Hello
There need not be inverted commas over the geometry type in the line where "femodel" is defined. I have increased the "Hmax" value to decrease the run time of the code. The following code might help you:
rect1=[3
4
-530
530
530
-530
0
0
-530
-530];
C1=[1
0
0
228.6];
C2=[1
0
0
520.5];
C1 = [C1;zeros(length(rect1) - length(C1),1)];
C2 = [C2;zeros(length(rect1) - length(C2),1)];
gd = [C1,C2,rect1];
ns = (char('C1','C2','rect1'));
ns = ns';
sf='(C2)-(C1+rect1)';
dl = decsg(gd,sf,ns);
model = createpde("thermal","transient");
ge = geometryFromEdges(model,dl);
% 2D -> 3D extrusion
gd1 = extrude(ge,96);
figure
pdegplot(gd1,"FaceLabels","on")
model = femodel(Geometry=gd1);
model = generateMesh(model,Hmax=50,Hmin=1);
pdemesh(model)

Plus de réponses (0)

Catégories

En savoir plus sur Dynamic System Models dans Help Center et File Exchange

Tags

Produits


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by