1) Why variational methods are widely used
Physics often selects the path that makes an integral stationary. In mechanics this is the action S=∫L dt, in optics it is optical path length, and in fields it is ∫ℒ d⁴x. This tool turns that idea into computable curves.
2) Building a functional with boundary conditions
Choose a function y(x) and a Lagrangian L(x,y,y′). The objective is the functional S[y]=∫x0x1 L dx. Fixed endpoints y(x0)=y0 and y(x1)=y1 create a two-point boundary value problem, matching the required inputs.
3) Euler–Lagrange equation as the stationarity test
Requiring δS=0 for small perturbations produces the Euler–Lagrange equation d/dx(∂L/∂y′) − ∂L/∂y = 0. It replaces “search over functions” with a differential equation plus boundary data. The result panel prints the exact form implied by your selections.
4) Template extremals: free particle
For L = ½ m y′², the equation becomes m y″ = 0, so the extremal is a straight line between endpoints. The action scales like (y1−y0)²/T with T=x1−x0, making this template a fast sanity check for endpoint entry and scaling.
5) Template extremals: harmonic and forced motion
With L = ½ m y′² − ½ k y², the solution is sinusoidal with ω=√(k/m). The classical action contains sin(ωT), so the endpoint problem can be sensitive near sin(ωT)≈0 (the tool warns you). With L = ½ m y′² + F y, the extremal is a parabola with a=F/m and endpoints fixing the initial slope.
6) Interpreting the action value
The reported S is ∫L dx along the computed extremal, evaluated by a trapezoidal rule on your grid. Absolute values depend on scaling and units, so comparisons across controlled parameter changes are most informative. Use S with the curve shape.
7) Numerical extremals for custom polynomial models
Numerical mode uses L(x,y,y′)=½A y′² + ½B y² + ¼C y⁴ + D y + E x y + F0, giving A y″ − (B y + C y³ + D + E x)=0. The solver iteratively relaxes interior points while keeping endpoints fixed, and reports a residual RMS so you can judge convergence.
8) Choosing grid, iterations, and exports
For smooth curves, N=201–801 is a practical range. If residual RMS stays above ~1e−3, increase iterations, reduce relaxation, or add mild smoothing (0.02–0.10). CSV preserves every (x,y) point for external plotting, and the PDF captures the equation and summary for documentation.