detools::euler
-- Euler operator
of variational calculusdetools::euler
(L,t,z)
applies the Euler
operator to the Lagrangian L and returns the left hand side
of the corresponding Euler-Lagrange equations. The Lagrangian can be of
any order and there can be any number of independent variables
t and of dependent variables z.
detools::euler(L, t, z)
detools::euler(L, DV)
L |
- | the Lagrangian: an expression or an element of a
domain of Cat::DifferentialFunction(DV) . |
t |
- | the independent variable(s): either a single (indexed) identifier or a list of (indexed) identifiers. |
z |
- | the dependent variable(s): either a single identifier or a list of identifiers. |
DV |
- | the domain of the differential variables:
DV must belong to
Cat::DifferentialVariable . |
either a single expression or a list ofexpressions; if for
L an element of a domain of
Cat::DifferentialFunction
was given, the output will also
consist of elements of this domain.
Cat::DifferentialFunction
. If an object of type
DOM_EXPR
is passed as
Lagrangian L, conversions are needed which may cost some
time.detools::euler
generates automatically for DV
the domain
Dom::DifferentialVariable(t,z)
and the calculations are
performed in the domain Dom::DifferentialExpression(DV)
.
Thus for t
and z
anything can be entered that
is accepted by the constructor
Dom::DifferentialVariable
.This is a finite dimensional example computing the equations of motion of a particle moving in the plane under the influence of a potential V.
>> L := 1/2*(diff(x(t), t)^2 + diff(y(t), t)^2) - V(x(t), y(t)): detools::euler(L, t, [x, y])
[x([t, t]) + D([1], V)(x, y), y([t, t]) + D([2], V)(x, y)]
This is a simple example for the generation of field equations. The field u depends here on two variables t,x.
>> L := 1/2*(diff(u(t, x), t)^2 + diff(u(t, x), x)^2) - u(t, x)^2: detools::euler(L, [x, t], u)
u([t, t]) + u([x, x]) + 2 u