- Home
- Skills
- APIs & Backend
- COMSOL Structural Expert
Works with the AI Agents you already use
COMSOL Structural Expert
by RVLM
Generate verified COMSOL 6.4 Java Shell scripts for structural mechanics with analytic physics checks.
$30
COMSOL Structural Expert
Example session with this skill installed
Model a steel cantilever bracket 200 x 30 x 5 mm, fixed at one end, with a 500 N downward tip load. I need the tip deflection and the max stress. My last attempt gave me a displacement of 2.1e-5 m and I don't trust it — also check if 3D solid elements are even the right choice here.
- Read your context and instructions
- Compiled the comsol structural expert
Analytic expectations FIRST — before any meshing.
Your bracket: L = 200 mm, b = 30 mm, h = 5 mm, steel E = 200 GPa, ρ = 7850 kg/m³.
- I = b·h³/12 = 30·5³/12 = 312.5 mm⁴
- Tip deflection δ = P·L³/(3·E·I) = 500·0.2³/(3·2e11·3.125e-10) = 21.3 mm
- Max bending stress σ = M·c/I = (500·0.2)(0.0025)/3.125e-10 = 800 MPa
⚠️ Your reported 2.1e-5 m is off by ~1000×. Classic signature of a unit
mismatch: geometry imported in mm while E was entered in Pa without a unit
string, or the load applied per unit area instead of total force. Check the
Parameters table for bare numbers like E 200e9 (no [Pa]).
⚠️ Second finding: σ = 800 MPa exceeds typical structural steel yield
(~250–350 MPa). A linear-elastic model will happily report 800 MPa and you
would be reading garbage. The physics says: geometric nonlinearity + check
against the actual yield strength, or reduce the load. I flag this BEFORE
you waste an afternoon trusting a converged-but-invalid solution.
Element choice: L/h = 40 → this is a slender member. A single Beam element
would be ideal, but since you asked for the bracket as a solid with stress
across the section, 3D Solid with at least 3 quadratic elements through the
5 mm thickness (tet or hex, quadratic order) — linear tets will underpredict
deflection by 30–50% at this aspect ratio.
Complete Java Shell script (paste into COMSOL Desktop → Java Shell; acceptance
criterion in the header: reaction sum must equal 500 N):
// Cantilever bracket 200x30x5 mm, 500 N tip load — Steel, linear elastic
// ACCEPTANCE: sum(Fy reactions) = -500 N ±0.1%; delta_tip = 21.3 mm; sigma_max ~ 800 MPa (EXCEEDS YIELD - flagged)
model.component().create("comp1", true);
model.component("comp1").geom().create("geom1", 3);
model.component("comp1").geom("geom1").lengthUnit("m");
model.component("comp1").geom("geom1").create("blk1", "Block");
model.component("comp1").geom("geom1").feature("blk1").set("size", new double[]{0.2, 0.03, 0.005});
model.component("comp1").geom("geom1").feature("blk1").set("pos", new double[]{0, 0, 0});
model.component("comp1").geom("geom1").run();
model.component("comp1").material().create("mat1", "Common");
model.component("comp1").material("mat1").propertyGroup("def")
.set("youngsmodulus", new String[]{"200[GPa]"});
model.component("comp1").material("mat1").propertyGroup("def")
.set("poissonsratio", new String[]{"0.3"});
model.component("comp1").material("mat1").propertyGroup("def")
.set("density", new String[]{"7850[kg/m^3]"});
model.component("comp1").material("mat1").selection().all();
model.component("comp1").physics().create("solid", "SolidMechanics", "geom1");
// Fixed end: x = 0 face (flat face normal to x). Verify with selection list —
// it must be exactly ONE face of area 30x5 mm = 1.5e-4 m^2.
model.component("comp1").physics("solid").create("fix1", "Fixed", 2);
model.component("comp1").physics("solid").feature("fix1")
.selection().set(1); // VERIFICAR: adjust boundary number to the x=0 face
// Tip load: x = L face, total 500 N downward.
model.component("comp1").physics("solid").create("load1", "BoundaryLoad", 2);
model.component("comp1").physics("solid").feature("load1")
.selection().set(4); // VERIFICAR: adjust to the x=0.2 face
model.component("comp1").physics("solid").feature("load1")
.set("BoundaryLoadType", "TotalForce");
model.component("comp1").physics("solid").feature("load1")
.set("Ftot", new String[]{"0", "-500[N]", "0"});
// Mesh: 3 quadratic elements through thickness, refined along span.
model.component("comp1").mesh().create("mesh1");
model.component("comp1").mesh("mesh1").create("ftri1", "FreeTri");
model.component("comp1").mesh("mesh1").feature("ftri1").create("size1", "Size");
model.component("comp1").mesh("mesh1").feature("ftri1").feature("size1")
.set("custom", "on");
model.component("comp1").mesh("mesh1").feature("ftri1").feature("size1")
.set("hmax", 0.0025); // 2.5 mm -> 2 elements through 5 mm thickness
model.component("comp1").mesh("mesh1").run();
model.study().create("std1");
model.study("std1").create("stat", "Stationary");
model.study("std1").attach("std1");
model.sol("sol1").runAll();
// Acceptance check 1: reaction must equal the applied load.
model.result().numerical().create("int1", "IntSurface");
model.result().numerical("int1").selection().set(1); // VERIFICAR: same fixed face
model.result().numerical("int1").set("expr", new String[]{"solid.RFx", "solid.RFy", "solid.RFz"});
// Acceptance check 2: tip deflection at (0.2, 0, 0).
model.result().numerical().create("pev1", "PointEval");
model.result().numerical("pev1").set("points", new double[][]{{0.2, 0, 0}});
model.result().numerical("pev1").set("expr", new String[]{"w", "solid.smax"});
model.save("bracket_cantilever.mph");
Validation chain (in order):
- Reactions vs load: integrate
solid.RFyon the fixed face → must be −500 N ±0.1%. If not, your load or constraint selection is wrong — stop and fix that first. - δ_tip vs 21.3 mm: expect 1–3% above the beam formula (shear deformation + Poisson). More than 10% off → mesh too coarse through thickness.
- σ_max vs 800 MPa: fine-mesh values will creep ABOVE 800 MPa near the fixed corner — that is a
stress singularity at the re-entrant corner, not real physics. Report σ at a section 10 mm away from the wall instead, and never chase it with refinement.
Next steps: rerun with geom nonlinearity (Large Deflection) since δ/L ≈ 1/10; add a fillet R = 2 mm at the root and watch the peak stress drop; if you need the first natural frequency, the analytic target is f1 = (1.875²/2πL²)√(EI/ρA) ≈
102 Hz — build the Eigenfrequency study and compare.
Connects securely to your tools. The creator never sees your data.
About this skill
Your structural model converged. That proves nothing. Reactions that don't equal applied loads, displacements off by 1000x from a silent unit mismatch, stress at a re-entrant corner that never converges no matter how fine the mesh — FEA software will always give you colors; this skill makes sure they mean something. It designs your structural model end-to-end: element type justified by slenderness (solid vs shell vs beam vs truss), constraints that remove exactly the right rigid-body modes (no more "Singular matrix"), mesh studies at stress concentrators — and it computes the analytic answer FIRST (cantilever d = P·L³/3EI, Euler buckling P_cr = π²EI/(KL)², f1 = (1.875²/2πL²)√(EI/ρA)) so the simulation has a target to hit. Deliverable: one complete Java Shell script, ready to paste into the COMSOL Desktop Java Shell, ending with model.save().
Requires COMSOL Multiphysics 6.4 and Structural Mechanics Module. User must verify exact node names for proprietary features; flags provided as // VERIFY comments.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 5 days ago
Nothing to install. It runs in your AI agent.
- Optional
- Java
COMSOL Multiphysics 6.x license with the Structural Mechanics Module.
Permissions
"Reads load/material data you provide as .csv or .java; writes the Java Shell script and result-evaluation tables. Never touches your .mph files directly — the script you paste does that inside your own COMSOL session."
What's inside
Creator
RVLM
6 skills on Agensi
Frequently Asked Questions
New in APIs & Backend
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.