01
Model and assumptions
Consider a straight, prismatic cantilever of length and constant flexural rigidity . Its free end is loaded by a force whose direction remains fixed.
The Euler–Bernoulli model is used. Axial and shear deformations are neglected, so the centerline is inextensible and the cross-section remains normal to it.

The solution is exact within the stated Euler–Bernoulli, inextensible-centerline, linear-moment–curvature assumptions. It is not an exact three-dimensional elasticity solution.
02
The elastica differential equation
Let be the cross-section rotation and the fixed force-direction angle. Define
In the load-aligned local frame, is the transverse distance from the force line through the free end. The bending moment and curvature satisfy
Because the centerline is inextensible,
Differentiating the moment–curvature equation gives the nonlinear pendulum equation for the planar elastica [1]
03
First integral and boundary conditions
At the free end , where , the bending moment and curvature vanish:
Multiplying the differential equation by and integrating once gives:
The term follows from the zero-moment condition at the free end. Without it, the first integral does not satisfy the boundary condition from which the elliptic solution is obtained.
At the clamped end , where , the rotation is zero and therefore:
04
Elliptic-integral solution
Following the elastica construction in [2], introduce
At the free end, . The incomplete and complete elliptic integrals of the first kind are:
The arc length measured from the free end is:
Applying at the clamp gives the load–parameter relation:
This nonlinear scalar equation determines for prescribed and . On the principal real branch,
05
Coordinates of the deformed beam
Define the incomplete and complete elliptic integrals of the second kind:
In the local frame with origin at the loaded end, the exact centerline is:
To place the clamp at the global origin, first translate the local coordinates:
The coordinates plotted by the program are then
06
MATLAB implementation
The programs use ellipticF, ellipticK, and ellipticE, which are provided by Symbolic Math Toolbox [3]. This toolbox is included in the current MATLAB and Simulink Home Suite. Users with other MATLAB license configurations should verify that Symbolic Math Toolbox is installed by entering ver in the Command Window.
The calculation has three parts:
findm.mfinds the parameter by bisection on its physically admissible real interval.main_cantilever.mevaluates the elliptic integrals, constructs the centerline, and transforms it to the global frame.eql_chck.mperforms an independent bending-moment comparison.
% Real principal branch
m1 = sin(beta/2)^2 + 1e-12;
m2 = 1 - 1e-12;
% P = (EI/L^2)*(K(m)-F(psi0,m))^2
for iter = 1:itermax
m = (m1+m2)/2;
Pc = force_from_m(m,EI,L,beta);
if Pc<P, m1=m; else, m2=m; end
endThe default case , was tested in MATLAB R2017b and MATLAB R2026a, with identical numerical results. The code uses standard MATLAB syntax and is expected to be compatible with intermediate and newer MATLAB versions.
07
Numerical examples
Consider a cantilever with , rectangular section , and Young's modulus . The vertical component is in all three cases.



Figure 2. Deformed centerlines for the three fixed-direction end-force combinations.
For and , both tested MATLAB versions returned:
| Quantity | Value |
|---|---|
| Elliptic parameter | |
| Loaded-end coordinate | |
| Loaded-end coordinate | |
| Maximum bending-moment magnitude |
08
Independent bending-moment check
The bending moment is evaluated in two independent ways. The first uses the centerline curvature:
The second follows from equilibrium of the end-force components, with at the loaded end:
A consistent solution must satisfy

09
Program files
The archive contains three commented MATLAB files and a README describing the model, the required toolbox, and the input convention.
10
References
- S. P. Timoshenko and J. M. Gere, Theory of Elastic Stability, 2nd ed., McGraw–Hill, New York, 1961.
- F. De Bona and S. Zelenika, “A generalized elastica-type approach to the analysis of large displacements of spring-strips”, Proceedings of the Institution of Mechanical Engineers, Part C: Journal of Mechanical Engineering Science, vol. 211, no. 7, pp. 509–517, 1997.
- MathWorks, MATLAB documentation for
ellipticF,ellipticK, andellipticE