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, σ = P/A, extension PL/(EA)): 10 kN on 2 m, 100 mm2, 200 GPa → 10 kN, 100 MPa, 1.000 mm; exact, rel 10⁻⁹ roundoff onlypassed
members.0.force_kN= 10, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagemembers.0.stress_MPa= 100, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagemembers.0.elongation_mm= 1, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagenodes.1.ux_mm= 1, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagenodes.0.rx_kN= -10, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageworst_utilisation0.4 ± 4 × 10⁻¹⁰0.4lockedunder 0.01 % of the tolerance usedr0002symmetric two-bar truss, apex load (textbook N = P/(2 sin t), apex deflection PL/(2EA sin² 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 10⁻⁹passed
members.0.force_kN= -100, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagemembers.1.force_kN= -100, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagenodes.2.uy_mm= -4.166667, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagenodes.2.ux_mm= 0, within 1.000000 × 10⁻⁹reading not recorded on this pagenodes.0.rx_kN= 80, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagenodes.0.ry_kN= 60, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagenodes.1.rx_kN= -80, within 1.000000 × 10⁻⁹ relativereading not recorded on this pager0003determinate 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 10⁻⁹passed
members.0.force_kN= 12, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagemembers.1.force_kN= -15, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagemembers.2.force_kN= 9, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagemembers.1.stress_MPa= -30, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagenodes.0.rx_kN= -12, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagenodes.0.ry_kN= -9, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagenodes.1.ry_kN= 9, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagenodes.1.ux_mm= 0.24, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageworst_member= 11lockedexact matchworst_utilisation0.12 ± 1.2 × 10⁻¹⁰0.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 10⁻⁹, residuals abs 10⁻⁹ kNpassed
reaction_sum_x_kN-4 ± 4 × 10⁻⁹-4lockedunder 0.01 % of the tolerance usedreaction_sum_y_kN36 ± 3.6 × 10⁻⁸36lockedunder 0.01 % of the tolerance usednodes.0.rx_kN= -4, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagenodes.0.ry_kN= 17.5, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagenodes.2.ry_kN= 18.5, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagemembers.2.force_kN= -16.666667, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagemoment_residual_kN_m0 ± 10⁻⁹0lockedunder 0.01 % of the tolerance usedjoint_residual_kN0 ± 10⁻⁹1.81899 × 10⁻¹⁴lockedunder 0.01 % of the tolerance usedr0005indeterminate three-bar truss (Timoshenko, Strength of Materials: N_v = P/(1+2cos³ a), N_i = N_v cos² 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 10⁻⁹passed
members.0.force_kN= 69.832402, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagemembers.1.force_kN= 25.139665, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagemembers.2.force_kN= 25.139665, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagenodes.0.uy_mm= -1.047486, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagestatic_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² | 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.