matlab/matlab-agentic-toolkit / skills-catalog/math-and-optimization/matlab-solve-pde
matlab-solve-pde
VerifiedEnd-to-end finite element analysis in MATLAB PDE Toolbox — geometry creation, model setup, solve, and post-processing in one skill. Use when building geometry from primitives or file import, setting up femodel with BCs/loads/materials, solving thermal/structural/EM problems, and extracting or visualizing results. Covers fegeometry, multicuboid, multicylinder, multisphere, decsg, boolean ops, mesh generation, femodel, all AnalysisTypes (thermalSteady, thermalTransient, structuralStatic, structuralTransient, structuralModal, structuralFrequency, electrostatic, magnetostatic, dcConduction, harmonic EM), materialProperties, faceBC, faceLoad, cellLoad, vertexLoad, solve, interpolation, von Mises stress, principal stress, reaction forces, heat flux, pdeplot3D visualization. Triggers on: PDE Toolbox, finite element, FEA, thermal analysis, structural analysis, electromagnetic analysis, femodel, mesh, boundary conditions, stress, displacement, heat transfer, post-processing.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 25.1 KB |
| manifest.yaml | config | 496 B |
| references/bc-load-reference.md | markdown | 4.9 KB |
| references/boolean-and-cell-ops.md | markdown | 4.5 KB |
| references/damping-reference.md | markdown | 2.1 KB |
| references/decsg-and-2d-geometry.md | markdown | 2.3 KB |
| references/electromagnetic-setup.md | markdown | 4.8 KB |
| references/em-postprocessing.md | markdown | 4.1 KB |
| references/modal-and-reduced-order.md | markdown | 3.0 KB |
| references/nonconstant-parameters.md | markdown | 4.3 KB |
| references/primitives-and-import.md | markdown | 4.8 KB |
| references/time-dependent-loads.md | markdown | 2.7 KB |
| references/visualization-reference.md | markdown | 6.0 KB |
references/decsg-and-2d-geometry.md
View on GitHub# decsg and 2-D Geometry
## Shape Column Format
Each shape is a column in the geometry description matrix `gd`. All columns must have the same number of rows (pad shorter ones with zeros).
### Rectangle (type 3)
```
[3; 4; x1; x2; x3; x4; y1; y2; y3; y4]
```
Corners listed counterclockwise. Axis-aligned shortcut (BL, BR, TR, TL):
```matlab
R = [3; 4; 0; W; W; 0; 0; 0; H; H];
```
### Circle (type 1)
```
[1; xc; yc; r; 0; 0; 0; 0; 0; 0]
```
### Ellipse (type 4)
```
[4; xc; yc; a; b; angle; 0; 0; 0; 0]
```
### Polygon (type 2)
```
[2; N; x1; x2; ...; xN; y1; y2; ...; yN]
```
Total rows: 2 + 2N. Vertices listed counterclockwise.
```matlab
% Trapezoid (4 vertices)
P1 = [2; 4; x1; x2; x3; x4; y1; y2; y3; y4];
dl = decsg(P1, 'P1', char('P1')');
gm2D = fegeometry(dl);
gm3D = extrude(gm2D, depth);
```
## Namespace Matrix
Each **column** of `ns` is one name:
```matlab
ns = char('R1', 'C1', 'R2')'; % Transpose! columns are names
```
## Set Formula
| Operation | Syntax |
|-----------|--------|
| Union | `'R1+R2'` |
| Subtraction | `'R1-C1'` |
| Intersection | `'R1*C1'` |
| Grouping | `'(R1+R2)-C1'` |
## Complete Example
```matlab
R1 = [3; 4; 0; 2; 2; 0; 0; 0; 1; 1];
C1 = [1; 0.2; 0.5; 0.1; 0; 0; 0; 0; 0; 0];
gd = [R1, C1]; sf = 'R1-C1'; ns = char('R1', 'C1')';
gm = fegeometry(decsg(gd, sf, ns));
```
## Polar-Coordinate Polygons
For symmetric shapes (stars, gears), define vertices by (angle, radius) sweeping CCW:
```matlab
nArms = 6; rValley = 0.02; rTip = 0.08; halfAngle = deg2rad(4);
angles = []; radii = [];
for k = 0:nArms-1
centerAngle = k * 2*pi/nArms;
angles = [angles, centerAngle - halfAngle, centerAngle + halfAngle];
radii = [radii, rValley, rValley];
end
xVerts = radii .* cos(angles);
yVerts = radii .* sin(angles);
P1 = [2; numel(xVerts); xVerts(:); yVerts(:)];
```
## Extrude (2-D to 3-D)
```matlab
gm3d = extrude(gm2d, depth);
```
2-D (x,y) preserved. Z is extrusion direction (0 to depth).
## Tips
- All shapes in `gd` must have same row count — pad with zeros
- `char('name1', 'name2')'` handles padding automatically
- Use `+` (union) of adjacent rectangles to create interior vertices for load application
- After `decsg`, always wrap: `gm = fegeometry(dl)`
- `fegeometry` does NOT accept `polyshape` directly
----
Copyright 2026 The MathWorks, Inc.
----
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |