How do I mesh a matlab model
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
N G
am 11 Jun. 2024
Beantwortet: sai charan sampara
am 11 Jun. 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)
0 Kommentare
Akzeptierte Antwort
sai charan sampara
am 11 Jun. 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)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dynamic System Models finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!