Skip to content

matlab/matlab-agentic-toolkit / skills-catalog/math-and-optimization/matlab-solve-pde

matlab-solve-pde

Verified

End-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.

references/modal-and-reduced-order.md

View on GitHub
# Modal Solve and Reduced-Order Methods

## FrequencyRange Rules

1. Use `-Inf` as lower bound when the user specifies a single frequency, a number of modes, or doesn't specify a lower bound — this captures rigid body modes at 0 Hz. If the user specifies an explicit frequency range (e.g., "modes between 500–2000 Hz"), respect their lower bound.
2. Never use `Inf` as upper bound (Lanczos solver errors)
3. Start small, widen iteratively

```matlab
result = solve(model, FrequencyRange=[-Inf, 1000]);
freqs = result.NaturalFrequencies;  % Column vector (Hz)
```

## Iterative Strategy for N Modes

```matlab
model.AnalysisType = "structuralModal";
numModesNeeded = 5;
upperBounds = [100, 1000, 10000, 100000];
for i = 1:numel(upperBounds)
    result = solve(model, FrequencyRange=[-Inf, upperBounds(i)]);
    if numel(result.NaturalFrequencies) >= numModesNeeded
        break;
    end
end
```

## Why `-Inf` Matters

Unconstrained structures have rigid body modes at 0 Hz. Using `[0, upper]` may miss them.

## Why Not Large Ranges

Dense meshes + wide ranges → "Found too many eigenvalues in an interval" error. Use coarser meshes or narrower ranges when iterating.

## Structural Modal Transient

```matlab
% 1. Base model
model = femodel(AnalysisType="structuralStatic", Geometry=gm);
model.MaterialProperties = materialProperties(YoungsModulus=200e9, ...
    PoissonsRatio=0.3, MassDensity=7800);
model.EdgeBC(fixedEdge) = edgeBC(Constraint="fixed");
model = generateMesh(model);

% 2. Compute modes
model.AnalysisType = "structuralModal";
modalResults = solve(model, FrequencyRange=[-Inf, 5000]);

% 3. Modal transient
model.AnalysisType = "structuralTransient";
model.FaceIC = faceIC(Displacement=[0;0], Velocity=[0;0]);
model.VertexLoad(tipVtx) = vertexLoad(Force=@(loc,state) pulseForce(state.time));
result = solve(model, tlist, ModalResults=modalResults);
```

## Thermal Modal Transient — Eigenvalue Method

```matlab
% Compute thermal decay modes
model.AnalysisType = "thermalModal";
modalResults = solve(model, DecayRange=[-Inf, 5]);

% Modal transient
model.AnalysisType = "thermalTransient";
model.CellIC = cellIC(Temperature=25);
result = solve(model, tlist, ModalResults=modalResults);
```

**`DecayRange` tuning:** Use `-Inf` as lower bound. Start with small upper bound (e.g., 5). Widen to 20 if accuracy is poor. Too wide → thousands of modes, no speedup.

## Thermal POD (Snapshots)

```matlab
% Solve at coarse times
model.AnalysisType = "thermalTransient";
coarseTlist = linspace(0, 40, 10);
snapshotResult = solve(model, coarseTlist);

% Fine resolution using snapshots as POD basis
fineTlist = linspace(0, 40, 200);
result = solve(model, fineTlist, Snapshots=snapshotResult.Temperature);
```

## When to Use Modal Transient

- Parametric studies (varying loads, same geometry)
- Optimization loops requiring many solves
- Long time histories where direct integration is expensive

Offline cost (modal solve) amortized across multiple transient evaluations.

----
Copyright 2026 The MathWorks, Inc.
----
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: 471kUpdated Claude CodeCodexVerifiedInstall
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: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 availableStars: 322kUpdated Claude CodeCodexVerifiedInstall