Internal forces and deflected shapes
Recovery is equilibrium-based: starting from the exact member end actions, the applied loads are integrated analytically along the member — the recovered fields are exact for any end condition (releases, semi-rigid springs) with no per-case formulas.
The examples below use a solved cantilever model with a beam carrying a uniform LineLoad and a mid-span PointLoad.
Scalar queries
At any fraction of the length, with zero allocation:
moment_z(model, beam, 0.5) # bending about local z — pairs with Vy, sagging+ for +y loads-8.999999999999996shear_y(model, beam, 0.25), axial_force(model, beam, 0.0), torsion(model, beam, 0.5)(19.0, -0.0, -0.0)Names are axis-correct: Mz is the moment about local z and pairs with Vy (dMz/dx = Vy); My pairs with Vz (dMy/dx = −Vz).
Dense sampling for plotting
Stations include every load breakpoint and both sides of each point action, so shear jumps render as true jumps:
f = InternalForces(model, beam; resolution = 40)
f.x'1×42 adjoint(::Vector{Float64}) with eltype Float64:
0.0 0.153846 0.307692 0.461538 … 5.53846 5.69231 5.84615 6.0[f.N f.Vy f.Mz f.Vz f.My f.Mx]'6×42 adjoint(::Matrix{Float64}) with eltype Float64:
-0.0 -0.0 -0.0 … -0.0 -0.0
22.0 21.6923 21.3846 0.307692 0.0
-60.0 -56.6391 -53.3254 -0.0236686 0.0
1.34711e-15 1.32827e-15 1.30943e-15 1.88407e-17 4.93038e-31
3.67394e-15 3.46814e-15 3.26524e-15 1.44929e-18 -1.57772e-30
-0.0 -0.0 -0.0 … -0.0 -0.0Deflected shapes
Exact local displacements at any fraction:
st = internal_forces(model, beam)
local_displacements(st, 0.5) # (u, v, w) in local axes3-element StaticArraysCore.SVector{3, Float64} with indices SOneTo(3):
0.0
-0.011131875000000005
-1.8176820116344606e-18