Castigliano Theorem Simulator Back
Structural Mechanics Simulator

Castigliano Theorem Simulator — Deflection via Strain Energy Method

Uses delta = dU/dP to separate the contributions of a tip point load P and a distributed load w on a cantilever beam. Learn the superposition principle and the fixed-end moment intuitively.

Parameters
Beam length L
m
Bending stiffness EI
kN·m²
Tip point load P
kN
Distributed load w
kN/m

"Sweep beam length" cycles L between 0.5 and 10 m so you can see deflection grow as L^4.

Results
Deflection from P, δ_P
Deflection from w, δ_w
Total deflection δ_total
Fixed-end peak moment M_max
Cantilever beam, loads and deformation

Left = fixed end / Right = free end / Yellow arrow = tip point load P / Top arrow row = distributed load w / Dashed = deformed shape (exaggerated)

Superposed contributions (δ_P and δ_w)

Blue = contribution from P / Orange = contribution from w / The sum equals δ_total

Theory & Key Formulas

Castigliano's second theorem: the partial derivative of the elastic strain energy U with respect to a load gives the displacement at its point and direction of application.

$$\delta = \frac{\partial U}{\partial P}, \qquad U = \int_0^L \frac{M(x)^2}{2EI}\,dx$$

Cantilever tip deflection due to a point load P:

$$\delta_P = \frac{P L^3}{3 E I}$$

Cantilever tip deflection due to a distributed load w:

$$\delta_w = \frac{w L^4}{8 E I}$$

Superposition and the fixed-end peak moment:

$$\delta_{\text{total}} = \delta_P + \delta_w, \qquad M_{\max} = P L + \frac{w L^2}{2}$$

δ scales with L^3 or L^4 and is inversely proportional to EI. Doubling L on the slider increases the deflection by a factor of 8 to 16.

What is the Castigliano Theorem Simulator

🙋
I have heard of "Castigliano's theorem" but what does it actually do? How is it different from the usual deflection formulas?
🎓
Good question. Roughly speaking, you attack the problem with energy. When a beam bends it stores strain energy U. Take the partial derivative of U with respect to "the load P that acts in the direction of the displacement you want," and the displacement δ pops out: $\delta = \partial U/\partial P$. Plug in the default values (L = 2 m, EI = 1000 kN·m², P = 10 kN) and you get $\delta_P = PL^3/(3EI) = 26.67$ mm — exactly the result you derive from Castigliano.
🙋
I see, so the answer is the same as the usual formula. But why bother going through energy?
🎓
Compared with direct integration, it becomes much easier for complex structures. For trusses or frames where bending, shear, and axial actions are mixed, writing the deflection curve down by hand is a nightmare. But energy contributions add, so you can compute $U_M, U_V, U_N$ for each internal force separately and just sum them. Look at the "Superposed contributions" graph: $\delta_P$ and $\delta_w$ stand independently and their sum equals $\delta_{\text{total}}$. That is exactly the power of additive superposition.
🙋
Right, with the defaults the P contribution is 26.67 mm, the w contribution is 10.00 mm, and the total is 36.67 mm. Setting P to 0 leaves only the w part — easy to follow. Is this used in industry?
🎓
All the time. It is the first choice whenever you need to predict deformation in bridges, aircraft, piping, fixtures, and so on. It is especially handy when you only care about "the deflection at one specific point," because you do not need the whole deflection curve. In practice, the unit-load method (an application of Castigliano) is used to find the rotation angle of a bracket, or to compute nozzle reactions due to thermal expansion in piping. If you can feel the addition $\delta_P + \delta_w$ in this tool, you have cleared the first hurdle.

Frequently Asked Questions

In this tool, P acts directly at the tip, so the deflection in its line of action is obtained directly from $\delta=\partial U/\partial P$. If instead you want a displacement at a point or in a direction where no real load acts, introduce a virtual load Q of magnitude Q at that point, compute $\delta=\partial U/\partial Q$, and then take the limit $Q\to 0$. For the midspan deflection, place a virtual concentrated load Q there and set Q = 0 at the end to extract only the midspan deflection.
The first theorem treats displacement as the independent variable: $P_i=\partial U/\partial \delta_i$ (differentiating with respect to a displacement gives the corresponding load). The second theorem, used in this tool, treats load as the independent variable: $\delta_i=\partial U/\partial P_i$. In practice the second theorem (load to displacement) is used overwhelmingly more often, and it is the theoretical basis of the displacement (matrix) method.
For slender beams (span/depth ratio greater than about 10), the bending term dominates the deflection and the shear and axial parts are within a few percent. This tool computes only the bending contribution. For deep beams or short cantilevers (span/depth less than about 5), the shear deflection $\delta_V=\int kV^2/(2GA)\,dx$ becomes significant and Timoshenko beam theory should be used. Always check the slenderness ratio first in design.
Yes. Treat the redundant reactions of an indeterminate structure as unknowns and apply the condition $\partial U/\partial X_i=0$ (zero displacement at the redundant point), and the unknown reactions $X_i$ can be solved from a system of equations (the principle of minimum work). The slope-deflection method and the matrix displacement method are extensions of this idea. This tool deals with a statically determinate cantilever, but the same idea carries over to continuous beams and rigid frames.

Real-World Applications

Aircraft structural design: Predicting the local deflections of complex structures such as wing spars and fuselage frames cannot be done without energy methods. Multiple load cases (lift distribution, fuel weight, landing loads) are evaluated by separating the displacement contributions at each point and identifying locations of insufficient stiffness. The same idea as the "P and w contribution separation" in this tool, only with dozens of load components in practice.

Thermal stress in piping and pressure vessels: Pipe networks experience thermal expansion at operating temperatures, which produces nozzle reactions. The flexibility-matrix method, which uses Castigliano to back-solve reactions and moments from a "virtual displacement" representing the thermal expansion, is widely used. The internal calculations of pipe stress packages such as CAESAR follow this idea.

Displacement prediction of mechanical parts: For parts where the displacement at a specific point matters — fixtures, brackets, cantilever sensors — Castigliano evaluates the local deflection. For example, the tip deflection of a cantilever measuring arm is checked by separating the contribution of self-weight w as $\delta_w=wL^4/(8EI)$ and the contribution from the measurement load P, and confirming the total is within tolerance.

Theoretical basis of FEM: The displacement-method formulation of the finite element method is derived from the principle of minimum work (an extension of Castigliano's second theorem). The relation $\{F\}=[K]\{u\}$ between the stiffness matrix $[K]$ and the load vector $\{F\}$ is derived as the stationarity condition of an energy functional. Energy methods are the bridge between classical structural mechanics and modern CAE.

Common Misconceptions and Cautions

The most common misconception is to think that Castigliano cannot be used unless a load already acts at the point where you want the displacement. In fact, by introducing a virtual load Q, computing $\partial U/\partial Q$, and then setting Q = 0, you can get the displacement at points where no load acts. In this tool, P acts at the tip directly so a virtual load is not needed, but this extension is the real strength of energy methods.

Next is the mistake of thinking it carries over directly to nonlinear materials and large deformations. Castigliano's theorem assumes linear elasticity (Hooke's law) and small deformations. In the plastic regime, post-buckling behavior, or contact problems, the form of energy conservation changes and the theorem does not apply. The standard practice is to use linear superposition while staying within the elastic range, and switch to nonlinear analysis when yielding becomes imminent.

Finally, the pitfall of underestimating the shear deflection. For slender beams the bending contribution alone is enough, but for short cantilevers (L/h less than 5) or high-shear materials (FRP, timber) the shear contribution can account for 10 to 30 percent of the total. This tool only handles bending, so for very short beams or low-shear-stiffness materials a separate shear correction is needed. Treat the simulator value as a reference for "slender, bending-dominated beams."