truss2d
Plane pin-jointed truss by the direct stiffness method: joints, members (E, A), supports and joint loads give member axial forces and stresses, joint displacements, support reactions and the worst utilisation against a yield stress. Linear elastic, small displacements; compression members are checked against yield only, with the Euler second moment each one needs reported.
- Field
- Mechanics, CAD and finite elements
- Version
- 0.1.0
- Runs as
- Compiled (Rust)
- Typical run
- 0.05 s
Compiled from source: run sh packs/install.sh once before admitting it.
Known answers it must pass
r0001single bar (textbook N = P, sigma = P/A, extension PL/(EA)): 10 kN on 2 m, 100 mm2, 200 GPa -> 10 kN, 100 MPa, 1.000 mm; exact, rel 1e-9 roundoff onlypassed
members.0.force_kN{"value": 10.0, "rel_tol": 1e-09}members.0.stress_MPa{"value": 100.0, "rel_tol": 1e-09}members.0.elongation_mm{"value": 1.0, "rel_tol": 1e-09}nodes.1.ux_mm{"value": 1.0, "rel_tol": 1e-09}nodes.0.rx_kN{"value": -10.0, "rel_tol": 1e-09}worst_utilisation0.4 ± 4e-100.4lockedunder 0.01 % of the tolerance usedr0002symmetric two-bar truss, apex load (textbook N = P/(2 sin t), apex deflection PL/(2EA sin^2 t)): 3-4-5 geometry sin t = 0.6, P = 120 kN, L = 5 m, EA = 200 GPa x 1000 mm2 -> N = -100 kN, v = -4.16667 mm, thrust 80 kN; exact, rel 1e-9passed
members.0.force_kN{"value": -100.0, "rel_tol": 1e-09}members.1.force_kN{"value": -100.0, "rel_tol": 1e-09}nodes.2.uy_mm{"value": -4.166666666666667, "rel_tol": 1e-09}nodes.2.ux_mm{"value": 0.0, "abs_tol": 1e-09}nodes.0.rx_kN{"value": 80.0, "rel_tol": 1e-09}nodes.0.ry_kN{"value": 60.0, "rel_tol": 1e-09}nodes.1.rx_kN{"value": -80.0, "rel_tol": 1e-09}r0003determinate 3-4-5 triangle by the method of joints: pin (0,0), roller (4,0), 12 kN sideways at (0,3) -> AB +12, BC -15, AC +9 kN, reactions (-12,-9) and 9 kN, roller slides NL/(EA) = 0.24 mm; exact, rel 1e-9passed
members.0.force_kN{"value": 12.0, "rel_tol": 1e-09}members.1.force_kN{"value": -15.0, "rel_tol": 1e-09}members.2.force_kN{"value": 9.0, "rel_tol": 1e-09}members.1.stress_MPa{"value": -30.0, "rel_tol": 1e-09}nodes.0.rx_kN{"value": -12.0, "rel_tol": 1e-09}nodes.0.ry_kN{"value": -9.0, "rel_tol": 1e-09}nodes.1.ry_kN{"value": 9.0, "rel_tol": 1e-09}nodes.1.ux_mm{"value": 0.24, "rel_tol": 1e-09}worst_member= 11lockedexact matchworst_utilisation0.12 ± 1.2e-100.12lockedunder 0.01 % of the tolerance usedstatic_indeterminacy= 00lockedexact matchr0004reactions balance the loads (statics: sum F, sum M about the pin) on a two-panel Warren truss, plus the top chord by the method of sections -50/3 kN; exact, rel 1e-9, residuals abs 1e-9 kNpassed
reaction_sum_x_kN-4 ± 4e-09-4lockedunder 0.01 % of the tolerance usedreaction_sum_y_kN36 ± 3.6e-0836lockedunder 0.01 % of the tolerance usednodes.0.rx_kN{"value": -4.0, "rel_tol": 1e-09}nodes.0.ry_kN{"value": 17.5, "rel_tol": 1e-09}nodes.2.ry_kN{"value": 18.5, "rel_tol": 1e-09}members.2.force_kN{"value": -16.666666666666668, "rel_tol": 1e-09}moment_residual_kN_m0 ± 1e-090lockedunder 0.01 % of the tolerance usedjoint_residual_kN0 ± 1e-091.81899e-14lockedunder 0.01 % of the tolerance usedr0005indeterminate three-bar truss (Timoshenko, Strength of Materials: N_v = P/(1+2cos^3 a), N_i = N_v cos^2 a, v = N_v L/(EA)): cos a = 0.6, P = 100 kN, L = 3 m -> 69.8324, 25.1397 kN, 1.04749 mm; exact, rel 1e-9passed
members.0.force_kN{"value": 69.83240223463687, "rel_tol": 1e-09}members.1.force_kN{"value": 25.139664804469277, "rel_tol": 1e-09}members.2.force_kN{"value": 25.139664804469277, "rel_tol": 1e-09}nodes.0.uy_mm{"value": -1.047486033519553, "rel_tol": 1e-09}static_indeterminacy= 11lockedexact match
Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.
Inputs
| Name | Unit | Default | Meaning |
|---|---|---|---|
nodes | m | [[0, 0], [4, 0], [2, 3]] | Joints, 2 to 400: [x, y] in metres, or {"x_m", "y_m", "name"}. y is up. Node numbers start at 0 in list order. |
members | [[0, 1], [1, 2], [0, 2]] | Members, 1 to 1500: [a, b], [a, b, A_mm2], [a, b, A_mm2, E_GPa], or {"a", "b", "A_mm2", "E_GPa", "name"}. Area and modulus left out take A_mm2 and E_GPa below. | |
supports | [{"node": 0, "fix": "xy"}, {"node": 1, "fix": "y"}] | Restraints: {"node": i, "fix": "xy"} is a pin, "x" or "y" a roller held in that direction. At least 3 restrained directions in all. | |
loads | [{"node": 2, "fx_kN": 0, "fy_kN": -10}] | Joint loads: {"node": i, "fx_kN": .., "fy_kN": ..} or [node, fx_kN, fy_kN]. A weight is a negative fy_kN. Loads on one joint add up. | |
E_GPa | GPa | 200 | Young's modulus of every member that does not give its own (steel about 200, aluminium about 70). |
A_mm2 | mm^2 | 1000 | Cross-section area of every member that does not give its own. |
yield_MPa | MPa | 250 | Yield stress the utilisation |stress| / yield is taken against (a design value: divide by your material factor first). |
load_factor | 1 | 1 | Multiplies every load (a partial safety factor on actions, or a sweep variable). |
Readings
| Name | Unit | Meaning |
|---|---|---|
n_nodes | 1 | |
n_members | 1 | |
n_restrained | 1 | |
static_indeterminacy | 1 | members + restrained directions - 2 x joints: 0 statically determinate, >0 indeterminate. |
all_ok | true when every member's |stress| is at or below yield_MPa. | |
warnings | One line per member above yield. | |
worst_utilisation | 1 | Largest |stress| / yield_MPa over the members. |
worst_member | 1 | Index of that member (0-based, list order). |
max_tension_kN | kN | |
max_compression_kN | kN | Largest compressive force, as a positive number. |
max_abs_stress_MPa | MPa | |
max_displacement_mm | mm | |
max_displacement_node | 1 | |
load_sum_x_kN | kN | |
load_sum_y_kN | kN | |
reaction_sum_x_kN | kN | |
reaction_sum_y_kN | kN | |
joint_residual_kN | kN | Largest out-of-balance force at a free joint, from the recovered member forces (0 up to roundoff). |
moment_residual_kN_m | kN m | Moment of loads plus reactions about the origin (0 up to roundoff). |
strain_energy_J | J | |
external_work_J | J | Half the loads times their displacements; equals strain_energy_J (Clapeyron). |
members | One row per member, list order. | |
nodes | One row per joint, list order; rx_kN / ry_kN are null on a free direction. |
Try the call
Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.