# A cantilever A beam that is clamped into a wall at one end and free at the other, and hangs under its own weight. ```python import sympy as sp import pdemagic as pm x = sp.symbols("x", real=True) w = sp.Function("w")(x) ends = { (x, 0): [sp.Eq(w, 0), sp.Eq(w.diff(x), 0)], (x, 1): [sp.Eq(w.diff(x, 2), 0), sp.Eq(w.diff(x, 3), 0)], } beam = pm.Problem(sp.Eq(w.diff(x, 4), -1), domain=pm.Box({x: (0, 1)}), boundary=ends) plan = pm.plan(beam) plan.grid.shape = [64] pm.solve(beam, plan).plot() ``` ## What it shows The beam equation, $w'''' = -1$: the plate equation in one dimension, with an even load that pulls down. An equation of fourth order takes two conditions at each end. At the wall the beam is held in its value and in its slope. The free end carries neither a moment nor a shear force, so the second and the third derivative are zero there. The beam leaves the wall level and is nearly straight towards its end, which hangs lower by one eighth, the number of the textbooks. ## What pdemagic decided The planner split the equation into two of second order, joined at the ends, and solved each by collocation at Chebyshev points (`collocation_split`). The solution is a polynomial of fourth degree, and the planner found 16 points enough for it. The example asks for 64, so that the line in the picture is smooth. ## More - [Beams and plates](../topics/plates.md) - [Clamp a plate](../howto/clamp-a-plate.md) - [Equations of fourth order on a box](../methods/plate-equation.md) - [What is solved on boxes with walls](../ref/equations-boxes.md)