Tools / Stress analysis
2D stress analysis of flat parts
Calculate the stresses and the deflection of a flat part online and for free with the finite element method, from a DXF, SVG or STEP file. NGSolve solves the part in plane stress in this tab with Python, running on Pyodide/ngapp. Nothing is uploaded. If the drawing has gaps or doubled lines, clean it in the contour checker first.
Supports hold the part's edges and holes in both directions or in one, and the loads are forces on edges, pressures, and bolt loads on holes. The tool colors the part by the von Mises stress and marks its peak. It also shows the normal, shear and principal stresses, the displacement, the deformed shape, the reactions and a safety factor against yield. A PDF report shows the part with its stress field and the results, and a CSV table lists them.
- Plane-stress FEA
- Runs in your browser
- Built on the planex2d library
Results
Open a part or one of the samples below, pick the supports and loads by the numbers in the drawing and press Solve. After the first solve, a changed setting solves the part again. Lengths are in millimeters, forces in newtons and pressures in MPa. An angle of 0° points along x and 90° along y, and a pressure pushes into the part. The list beside Results chooses the field in the drawing. The PDF holds that field, the deformed shape and the results on an A4 sheet, the CSV file the settings, the results and the reactions. PDF (all) holds one such sheet for every result, and CSV (all) every result at the points of the drawing's grid.
Try a sample part
Each one opens in the stress analysis above with its supports and loads. Download them to analyze the same parts with planex2d and NGSolve in Python.
-
Fig. 1DXF
Lifting lug
A steel lug of 10 mm plate with a 22 mm hole, fixed at its base and pulled up through a bolt with 15 kN. The von Mises stress peaks at 161.5 MPa beside the hole, a safety factor of 1.46 against S235.
-
Fig. 2DXF
Plate with a hole
A plate of 400 × 100 × 5 mm with a 20 mm hole in its middle, pulled with 20 kN. Beside the hole the stress peaks at 124.8 MPa, 2.50 times the net stress of 50 MPa, against 2.51 from Heywood's formula.
-
Fig. 3DXF
Angle bracket
A 5 mm bracket bolted at two holes and loaded with 1.5 kN downward through the third. The stress peaks at 161.6 MPa at the inside fillet, a safety factor of 1.45 against S235.
What the stress analysis computes
The stresses and displacements of a flat part loaded in its own plane, in plane stress and linear elasticity.
A flat part such as a bracket, a lug, a gusset or a link carries its loads through its outline. Where the outline narrows, turns or has a hole, the stress rises above the nominal value of the hand formulas, by the stress concentration factor. Charts give that factor for standard notches and holes only. For any other outline, it follows from a solution of the elasticity equations. The tool meshes the part, solves these equations with the finite element method and shows the stress over the whole part, with its peak, the deformed shape and the reaction at every support.
Plane stress
The part is thin compared with its outline, and its loads act in its plane, so the stress across the thickness is zero. The tool solves the plane-stress elasticity equations for the displacement, with Young's modulus E and Poisson's ratio ν of the material and the thickness t. The thickness carries the loads, so the same force on a part twice as thick gives half the stress. The von Mises stress σv = √(σx² − σxσy + σy² + 3τxy²) combines the stresses into the one value that ductile metals yield at.
Edge and hole numbers
Every edge of the outline gets a number, from E1 at the lowest left corner around the part, and every hole one number for its whole boundary, H1, H2 and so on from the left. The supports and loads refer to these numbers, and the drawing shows them, with each edge's length and each hole's size on hover. The Propagation column carries a support or a load on along the outline, with planex2d's selection propagation.
- Minimal keeps the edge alone.
- Coincident adds the edges joined to it end to end, which on a closed outline is all of it.
- Tangent adds the edges that continue it tangentially, such as the lines on either side of a fillet.
- Curvature adds the edges that continue its curvature as well.
Supports
A fixed edge or hole cannot move in any direction. Fixed in x holds only the x direction and lets the edge slide along y, and fixed in y the other way round, which models a symmetry line or a roller. A fixed hole stands for a rigid bolt or pin. The supports must hold the part against moving and turning, and the tool says so when they do not.
Loads
- A force acts on an edge, spread evenly along it, at an angle from the x axis.
- A pressure acts normal to an edge or a hole's wall and pushes into the part. A negative pressure pulls.
- A bolt load acts on a hole the way a pin presses on it. It pushes on the half of the hole that faces the force, with the pressure p = 2F/(πr) · cos φ along the wall, where φ is measured from the direction of the force.
Results
The results are the peak von Mises stress and where it is, the largest displacement, the safety factor against yield, which is the yield strength over the peak stress, and the reaction force at every support. The drawing colors the part by the von Mises stress, marks its peak with a cross and shows the deformed outline as a dashed line, enlarged so that it can be seen. The legend shows the mesh on request.
The list beside the Results heading colors the part by another result of the same solution instead. It offers the normal stresses σx and σy, the shear stress τxy, the principal stresses σ1 and σ2 and the displacement. The stresses among them have a sign, so their color scale is centered on zero, with positive values in red and negative ones in blue. For the normal and principal stresses, tension is red and compression blue. The results then also give the range of the chosen stress, and the drawing marks its largest and smallest values.
At a sharp inside corner and at the end of a fully supported edge, the stress is infinite in theory, so the value there grows as the mesh is refined. The tool says when the peak sits at such a point.
Simplify outline
Drawings often carry arcs and holes as chains of short lines. Their corners would show as false stress peaks and would give the outline many edge numbers. With Simplify outline on, planex2d fits arcs to such chains, within a ten-thousandth of the part's size, before the part is numbered and meshed. Turn it off to analyze the outline exactly as drawn. Where the fit misses an arc, the contour checker fits arcs with a tolerance and an edge length of your choice, closes gaps and removes tiny edges, and saves the cleaned drawing for the stress analysis.
Units
Lengths and displacements are in millimeters, forces in newtons, pressures and stresses in MPa and Young's modulus in GPa. A file is read in the unit it names and converted to millimeters.
How the stress analysis works
The tool is a small page around the planex2d Python library, with NGSolve for the finite element solution. It runs the same code you get with pip install "planex2d[occ]" ngsolve, compiled to WebAssembly and loaded with Pyodide/ngapp.
- Load
The page loads Python and planex2d into this tab, and NGSolve with the first solve, about 23 MB the first time. Your browser keeps them in its cache, so later visits start faster.
- Read
planex2d reads the file, joins its closed contours into the part, simplifies the outline and numbers its edges and holes.
- Solve
NGSolve meshes and solves the part, again whenever a setting changes after the first solve.
- Save
The results are saved as a PDF report or a CSV table, made in the tab as well.
The finite element model
The mesh has elements of about a fortieth of the part's size, finer along arcs and holes, where they are a third of the radius, and it is curved to the exact outline. NGSolve solves the plane-stress equations on it with second-order elements and a sparse Cholesky factorization. The tests compare the solver with known answers. A bar in tension gives F/A exactly, a cantilever its tip deflection P L³/(3 E I) within 0.1 %, a plate with a hole its peak stress within 1 % of Heywood's formula, and the reactions balance every load.
Element order and accuracy estimate
The Solver group sets the element order, from 1 to 5, and whether the elements are curved to the outline. A higher order resolves the stress better on the same mesh and takes longer. Straight elements replace each arc with chords, whose corners at the mesh vertices raise the stress along holes and fillets.
Accuracy estimate, on by default, solves the part a second time on the same mesh with elements one order higher and shows the peak stress of that solution and how much it differs. The difference estimates the error of the peak stress at the chosen order, so a difference of a percent or less means that the mesh resolves the peak. A larger one calls for a higher order, unless the peak sits at a sharp inside corner or at the end of a supported edge, where it grows with every refinement and the tool says so. At order 2 a solve takes about 1.5 times as long with the estimate.
Supported files
| Format | Extensions | Notes |
|---|---|---|
| DXF | .dxf | The part's lines, arcs, circles, polylines, splines and ellipses, on every layer. See Files. |
| SVG | .svg | Paths and shapes. See SVG. |
| STEP | .step .stp | Planar parts. See STEP and BREP. |
| BREP | .brep | Planar parts, taken in meters, since BREP names no unit. |
.pdf | The report with the field shown, the deformed shape, the settings and the results on an A4 sheet. PDF (all) has one such sheet for each of the seven results. | |
| CSV | .csv | The settings, the results and the reaction at every support. CSV (all) is one table with a row for every point of the drawing's grid inside the part, a two-hundredth of the part's size apart, and a column for each of the seven results. |
Run it in Python
The same analysis takes a few lines with planex2d and NGSolve. The example is the plate with a hole sample, 400 × 100 mm and 5 mm thick, with a hole of 20 mm in its middle, fixed at its left edge and pulled with 20 kN at its right edge. planex2d draws the plate and names its edges, and NGSolve meshes it, finer along the hole, and solves it. See Meshing with netgen and the shoulder fillet example in the docs.
$ pip install "planex2d[occ]" ngsolve
import ngsolve as ngs
import planex as px
plate = (px.QuickSketch().Rectangle(400, 100).Face() - px.Circle((200, 50), 10).Face()).Face()
for e in plate.edges:
e.name = {0: "left", 400: "right"}.get(e.midpoint.x, "free")
if e.midpoint.y not in (0, 100) and e.name == "free":
e.maxh = 10 / 3
mesh = ngs.Mesh(px.OCCGeometry(plate).GenerateMesh(maxh=10))
mesh.Curve(2)
fes = ngs.VectorH1(mesh, order=2, dirichlet="left")
u, v = fes.TnT()
E, nu, t = 210e3, 0.3, 5
mu, lam = E / 2 / (1 + nu), E * nu / (1 - nu**2)
def stress(w):
e = ngs.Sym(ngs.Grad(w))
return 2 * mu * e + lam * ngs.Trace(e) * ngs.Id(2)
a = ngs.BilinearForm(t * ngs.InnerProduct(stress(u), ngs.Sym(ngs.Grad(v))) * ngs.dx).Assemble()
f = ngs.LinearForm(20000 / 100 * v[0] * ngs.ds("right")).Assemble()
gf = ngs.GridFunction(fes)
gf.vec.data = a.mat.Inverse(fes.FreeDofs(), inverse="sparsecholesky") * f.vec
print("stress beside the hole", stress(gf)[0, 0](mesh(200, 39.99)), "MPa")
It prints a stress of about 127 MPa beside the hole, 2.54 times the net stress of 50 MPa in the section through the hole. Heywood's formula for this ratio of hole to width gives 2.51.
Privacy
Nothing is uploaded. The file is read, meshed and solved in this tab and is gone when you close it. Python, planex2d and its packages come from public package servers (jsDelivr and PyPI), and NGSolve from this site. See the privacy notice.
Limits
- The tool solves linear elasticity in plane stress: small displacements, a linear material and loads in the part's plane.
- Contact, friction, plasticity, buckling, bending out of the plane and 3D parts are not included.
- A bolt load presses on its hole as a pin would, with an assumed pressure distribution. The bolt, its preload and the friction under its head are not modeled.
- The safety factor compares the peak stress with the yield strength only. It does not cover fatigue or the checks of a design code. The material values are typical minimum values. Use the ones certified for your material.
- The tool analyzes one connected part. A file must be planar, and its text, dimensions and hatches are not read.
- A part that fails or a result that looks wrong? Open an issue on GitHub and attach the file if you can.
Questions and answers
Is my file uploaded?
No. planex2d reads the file in this browser tab, running on Pyodide/ngapp, and NGSolve solves the part there as well. The file is gone when you close the tab. Python and its packages come from jsDelivr and PyPI, NGSolve from this site, and your file is never sent anywhere.
Is this a real finite element analysis?
Yes, a linear static one in plane stress. NGSolve solves the elasticity equations with second-order elements by default, on a mesh of the part's exact outline that is curved to it. It covers flat parts loaded in their own plane, such as brackets, lugs, gussets and links. Contact, plasticity, buckling, bending out of the plane and 3D parts are not included.
How accurate are the results?
The tests compare the solver with known answers. A bar in tension gives F/A exactly, a cantilever its tip deflection P L³/(3 E I) within 0.1 %, and a plate with a hole its peak stress within 1 % of Heywood's formula for the stress concentration factor. For your own part, Accuracy estimate, on by default, solves it once more with elements one order higher and shows how much the peak stress changes. At a sharp inside corner and at the end of a supported edge, the stress is infinite in theory, and the tool says when the peak sits at such a point.
How do I choose the supports and loads?
Every edge of the outline has a number, E1, E2 and so on, and every hole H1, H2 and so on, shown in the drawing. A row in the supports table holds one of them in both directions, or in x or y only, and a row in the loads table puts a force on an edge, a pressure on an edge or a hole, or a bolt load on a hole. The Propagation column carries a row on to the edges that continue the chosen one, tangentially for example, so a support or a pressure covers a whole side that a fillet splits into several edges.
Which stresses does it show?
The drawing shows the von Mises stress by default, the one value that ductile metals yield at. The list beside the results switches it to the normal stresses σx and σy, the shear stress τxy, the principal stresses σ1 and σ2 or the displacement, all from the same solution. The safety factor is the yield strength divided by the peak von Mises stress. It does not cover fatigue, buckling, the bolts themselves or the checks of a design code.
What does Simplify outline do?
It replaces chains of short lines that follow an arc with the arc itself, within a ten-thousandth of the part's size. A hole exported as a polygon then has no corners, which would otherwise show as false stress peaks, and the edge numbers stay few. Turn it off to analyze the outline exactly as drawn. If an arc is not found, or for more control, clean the drawing in the contour checker first. Its arc fit takes a tolerance and an edge length of your choice. It also closes gaps and removes tiny edges, and it saves the cleaned drawing as a DXF, SVG or STEP file for the stress analysis.
Other tools on planex2d.org
Every tool runs on the planex2d library, in your browser.
-
Plate frequencies
Natural frequencies and mode shapes of flat plates from DXF, SVG, STEP or KiCad files, with each edge free, clamped or simply supported, and their Chladni figures.
-
Heat transfer
Steady and transient 2D heat transfer of profiles, heat sinks and plates from DXF, SVG or STEP files, with several materials, convection, radiation and contact resistances, and the thermal resistance.
-
Beam calculator
Shear force, bending moment, deflection and bending stress of beams on several supports, for standard profiles or sections from DXF or STEP files, with a PDF report.
-
Section properties
Area, centroid, second moments and section moduli of any drawn or standard section, the mass of a sheet part, and the torsion constant and shear center from a finite element solve.
-
Playground
planex2d code in the browser, with OpenCASCADE for 3D solids and netgen and NGSolve for finite elements, shared as a link that carries the code.
The planex2d Online Tools page lists every tool, and the planex2d documentation shows the library behind them.