Partial time derivative
The operator ∂ₜ (typed \partial<tab> then \_t<tab>) computes the partial derivative with respect to time of a time-dependent object:
It is the explicit-time part of the total derivative. For a quantity
so
∂ₜ is computed by automatic differentiation, so the AD backend extension must be loaded.
The result is always non-autonomous
Differentiating with respect to NonAutonomous and its call signature begins with t. For an autonomous input the derivative is identically zero, but the returned object still takes t as its first argument.
On plain functions
For a Function, the first argument is taken to be time, and ∂ₜ returns a Function with the same signature.
f = (t, x) -> t * x[1] + x[2]^2
df = ∂ₜ(f)
df(2.0, [1.0, 3.0]) # ∂/∂t (t*x₁ + x₂²) = x₁1.0On typed vector fields
For a VectorField, ∂ₜ returns a new VectorField that is NonAutonomous and OutOfPlace.
X = VectorField((t, x) -> t .* x; is_autonomous=false)
dX = ∂ₜ(X)
dX(2.0, [1.0, 2.0]) # ∂/∂t (t·x) = x2-element Vector{Float64}:
1.0
2.0An autonomous field has zero time derivative — but note the result is still read with a leading t:
Xa = VectorField(x -> [x[2], -x[1]]; is_autonomous=true)
dXa = ∂ₜ(Xa)
dXa(0.0, [1.0, 2.0]) # zero2-element Vector{Float64}:
0.0
0.0On typed Hamiltonians
For a Hamiltonian, ∂ₜ returns a NonAutonomous Hamiltonian.
H = Hamiltonian((t, x, p) -> t * p[1] + x[1]^2; is_autonomous=false)
dH = ∂ₜ(H)
dH(2.0, [1.0], [0.5]) # ∂/∂t (t·p₁ + x₁²) = p₁0.5On typed Hamiltonian vector fields
For a HamiltonianVectorField, ∂ₜ returns a NonAutonomous HamiltonianVectorField.
Z = HamiltonianVectorField((t, x, p) -> t .* [p[1], -x[1]]; is_autonomous=false)
dZ = ∂ₜ(Z)
dZ(2.0, [1.0], [0.5]) # ∂/∂t t·[p₁, -x₁] = [p₁, -x₁](0.5, -1.0)Out-of-place only
∂ₜ on a typed object requires OutOfPlace mutability; an in-place field raises a NotImplemented error. See Limitations & configuration.
See also
∂ₜ— full docstring and method list.Poisson bracket — the other half of the total time derivative.