Modelling geometry using pde toolbox
18 views (last 30 days)
Show older comments
I've been tasked with running a pde simulation on a disc brake, but instead of importing an stl geometry, need to model the disc brake geometry in matlab myself. Not sure what an efficient way to tackle this or if its possible?
For example I can model the basic structure of a solid disc using the multicylinder function, but if i wanted to subtract another cylinder from the geometry with the same radius, different height, i cannot as: 'Added cells must be located strictly inside a single cell of the original geometry.' using addvoid function.
How should i go about this?
r1 = 0.05;
r2 = 0.06;
r3 = 0.2;
h=0.075;
h1=0.05;
gm1 = multicylinder([r3,r2],h1,'Void',[0,1]);
gm = multicylinder([r1,r2,r3],h,'Void',[1,0,0]);
g = addVoid(gm,gm1); % I want to subtract gm1 from gm...
pdegplot(g,"CellLabels","on","EdgeLabels","on","FaceLabels","on");
0 Comments
Answers (1)
Avni Agrawal
on 24 Nov 2023
Hi Jose,
I understand that you are trying to generate a 3D model by subtracting one cylinder from another. [SB2] The current limitation with 'addvoid' requires that one model must be completely inside the other. However, the current constraint might be restricting the subtraction operation you are attempting.
To address this, I recommend referring to the documentation for a more detailed explanation of the 'addvoid' function and its constraints https://www.mathworks.com/help/pde/ug/discretegeometry.addvoid.html
Regarding a solution, I have an alternative approach that could help achieve the desired model. The following code provides a potential solution for your 3D model creation:
r1 = 0.05;
r2 = 0.06;
r3 = 0.2;
h=0.075;
h1=0.05;
% disk with smaller radius
gm1 = multicylinder([r2 r1],h1,'Void',[0,1]);
% disk with large radius. set Zoffset to place the disk below gm1
gm = multicylinder(r3,h-h1, 'Zoffset',-(h-h1));
figure;
pdegplot(gm,'FaceAlpha',0.7)
hold on;
pdegplot(gm1,'FaceAlpha',0.7)
hold off;
This alternative method offers a workaround to the current limitation, allowing you to achieve the subtractive operation between the cylinders and generate the intended 3D model.
I Hope this helps!
0 Comments
See Also
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!