EulerEquations[f,u[x],x]
returns the Euler–Lagrange differential equation obeyed by u[x] derived from the functional f, where f depends on the function u[x] and its derivatives, as well as the independent variable x.
EulerEquations[f,u[x,y,…],{x,y,…}]
returns the Euler–Lagrange differential equation obeyed by u[x,y,…].
EulerEquations[f,{u[x,y,…],v[x,y,…],…},{x,y,…}]
returns a list of Euler–Lagrange differential equations obeyed by u[x,y,…],v[x,y,…],….
EulerEquations
EulerEquations[f,u[x],x]
returns the Euler–Lagrange differential equation obeyed by u[x] derived from the functional f, where f depends on the function u[x] and its derivatives, as well as the independent variable x.
EulerEquations[f,u[x,y,…],{x,y,…}]
returns the Euler–Lagrange differential equation obeyed by u[x,y,…].
EulerEquations[f,{u[x,y,…],v[x,y,…],…},{x,y,…}]
returns a list of Euler–Lagrange differential equations obeyed by u[x,y,…],v[x,y,…],….
Details and Options
- To use EulerEquations, you first need to load the Variational Methods Package using Needs["VariationalMethods`"].
Examples
open all close allBasic Examples (2)
Needs["VariationalMethods`"]The Euler equations for the arc length
in two dimensions yields a straight line:
EulerEquations[Sqrt[1 + y'[x]^2], y[x], x]DSolve[%, y[x], x]Needs["VariationalMethods`"]A simple pendulum has the Lagrangian
:
EulerEquations[(1/2)m r^2θ'[t]^2 + m g r Cos[θ[t]], θ[t], t]The solution to the pendulum equation can be expressed using the function JacobiAmplitude:
DSolve[%, θ[t], t]Scope (4)
Needs["VariationalMethods`"]The Lagrangian of a point particle in two dimensions has two dependent variables, and yields Newton's equations:
EulerEquations[(1/2)m(x'[t]^2 + y'[t]^2) - V[x[t], y[t]], {x[t], y[t]}, t]Needs["VariationalMethods`"]The Lagrangian of a point particle in two dimensions with a central potential:
EulerEquations[(1/2)m(r'[t]^2 + r[t]^2θ'[t]^2) - V[r[t]], {r[t], θ[t]}, t]Needs["VariationalMethods`"]Second- and higher-order derivatives may be included in the integrand. A Lagrangian for motion on a spring using higher-order terms:
EulerEquations[-(1/2)m q[t]q''[t] - (1/2)k q[t]^2, q[t], t]Needs["VariationalMethods`"]The integrand
has several independent variables:
(1/2)Subscript[∂, {{x, y, z}}]ϕ[x, y, z].Subscript[∂, {{x, y, z}}]ϕ[x, y, z]The Euler equations yield Laplace's equation:
EulerEquations[%, ϕ[x, y, z], {x, y, z}]Applications (3)
Needs["VariationalMethods`"]The Euler equations for the integrand
:
eqn1 = EulerEquations[f[y''[x], y'[x], y[x], x], y[x], x]eqns2 = D[Derivative[1, 0, 0, 0][f][y''[x], y'[x], y[x], x], x, x] - D[Derivative[0, 1, 0, 0][f][y''[x], y'[x], y[x], x], x] + Derivative[0, 0, 1, 0][f][y''[x], y'[x], y[x], x] == 0eqn1 == Expand[eqns2]Needs["VariationalMethods`"]The brachistochrone problem asks for the curve of quickest descent. The time taken for a particle to fall an arc length
is
. If
measures the decrease in height from an initial point of release, then the velocity
satisfies:
Solve[(1/2)m v^2 == m g y, v]The equation for a curve joining two points, where a particle starting at rest from the higher point takes the least amount of time to reach the lower point:
EulerEquations[Sqrt[(x'[θ]^2 + y'[θ]^2/2g y[θ])], {x[θ], y[θ]}, θ]It is well known that the solution to the brachistochrone problem is a cycloid:
% /. {
x -> (k(# - Sin[#])&),
y -> (k(1 - Cos[#])&)
}//SimplifyNeeds["VariationalMethods`"]The Lagrangian for a vibrating string yields the classical wave equation:
EulerEquations[(1/2)ρ D[u[x, t], t]^2 - (1/2)τ D[u[x, t], x]^2, u[x, t], {x, t}]