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/em-postprocessing.md
View on GitHub# Electromagnetic Post-Processing Reference
## Electrostatic Results
```matlab
% Direct properties (all N×1)
V = result.ElectricPotential;
Ex = result.ElectricField.Ex;
Ey = result.ElectricField.Ey;
Ez = result.ElectricField.Ez;
Dx = result.ElectricFluxDensity.Dx;
Dy = result.ElectricFluxDensity.Dy;
Dz = result.ElectricFluxDensity.Dz;
% Interpolation — all return FEStruct
Vq = interpolateElectricPotential(result, queryPts); % scalar(s)
Eq = interpolateElectricField(result, queryPts); % FEStruct: .Ex, .Ey, .Ez
Dq = interpolateElectricFlux(result, queryPts); % FEStruct: .Dx, .Dy, .Dz
```
**Method name:** `interpolateElectricFlux` — NOT `interpolateElectricFluxDensity`.
### Maxwell Stress Tensor (Lazy Evaluation)
MST is not computed at solve time — must call explicitly:
```matlab
resultMST = generateMaxwellStressTensor(result);
mst = resultMST.MaxwellStressTensor; % 3×3×N double
```
`generateMaxwellStressTensor` returns an augmented result object (same class, with MST populated). It does not modify the original.
### Capacitance via Energy Method
```matlab
E = result.ElectricField;
D = result.ElectricFluxDensity;
energyDensity = D.Dx.*E.Ex + D.Dy.*E.Ey + D.Dz.*E.Ez;
W = 0.5 * mean(energyDensity) * domainVolume;
C = 2 * W / voltage^2;
```
## Magnetostatic Results
```matlab
% Direct properties (all N×1)
Bx = result.MagneticFluxDensity.Bx;
By = result.MagneticFluxDensity.By;
Bz = result.MagneticFluxDensity.Bz;
Hx = result.MagneticField.Hx;
Hy = result.MagneticField.Hy;
Hz = result.MagneticField.Hz;
Ax = result.MagneticPotential.Ax;
% |B| magnitude
Bmag = sqrt(result.MagneticFluxDensity.Bx.^2 + ...
result.MagneticFluxDensity.By.^2 + ...
result.MagneticFluxDensity.Bz.^2);
% Interpolation — returns FEStruct
Bq = interpolateMagneticFlux(result, queryPts); % .Bx, .By, .Bz
Hq = interpolateMagneticField(result, queryPts); % .Hx, .Hy, .Hz
Aq = interpolateMagneticPotential(result, queryPts); % .Ax, .Ay, .Az
```
**Method name:** `interpolateMagneticFlux` — NOT `interpolateMagneticFluxDensity`.
### Maxwell Stress Tensor
Same lazy-evaluation pattern as electrostatic:
```matlab
resultMST = generateMaxwellStressTensor(result);
mst = resultMST.MaxwellStressTensor; % 3×3×N
```
### Inductance via Energy Method
```matlab
B = result.MagneticFluxDensity;
H = result.MagneticField;
energyDensity = B.Bx.*H.Hx + B.By.*H.Hy + B.Bz.*H.Hz;
W = 0.5 * mean(energyDensity) * domainVolume;
L = 2 * W / current^2;
```
## DC Conduction Results
`ConductionResults` from `solve()` on a `dcConduction` analysis type. No Maxwell stress tensor for this analysis.
```matlab
% Direct properties (all N×1)
V = result.ElectricPotential;
Ex = result.ElectricField.Ex;
Ey = result.ElectricField.Ey;
Ez = result.ElectricField.Ez;
Jx = result.CurrentDensity.Jx;
Jy = result.CurrentDensity.Jy;
Jz = result.CurrentDensity.Jz;
% Current density magnitude
Jmag = sqrt(result.CurrentDensity.Jx.^2 + ...
result.CurrentDensity.Jy.^2 + ...
result.CurrentDensity.Jz.^2);
% Interpolation
Vq = interpolateElectricPotential(result, queryPts);
Eq = interpolateElectricField(result, queryPts); % FEStruct: .Ex, .Ey, .Ez
Jq = interpolateCurrentDensity(result, queryPts); % FEStruct: .Jx, .Jy, .Jz
```
**Method name:** `interpolateCurrentDensity` — NOT `interpolateCurrentFlux` or `interpolateJ`.
## Interpolation Method Name Summary
| Analysis | Quantity | Method Name |
|----------|----------|-------------|
| Electrostatic | Potential | `interpolateElectricPotential` |
| Electrostatic | E-field | `interpolateElectricField` |
| Electrostatic | D-field | `interpolateElectricFlux` (NOT FluxDensity) |
| Magnetostatic | Potential | `interpolateMagneticPotential` |
| Magnetostatic | B-field | `interpolateMagneticFlux` (NOT FluxDensity) |
| Magnetostatic | H-field | `interpolateMagneticField` |
| DC Conduction | Potential | `interpolateElectricPotential` |
| DC Conduction | E-field | `interpolateElectricField` |
| DC Conduction | J-field | `interpolateCurrentDensity` (NOT CurrentFlux) |
----
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: 468k | 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: 319k | 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: 319k | 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: 319k | Updated | Claude CodeCodex | Verified | Install |