This post shows how to use SymPy to express the Agnesian of order one $\mathcal{A}_t^1$ of a system of ordinary differential equations. See Seilis 2022 for a description of the Agnesian operator. Briefly, it represents a form of non-statistical notion of “covariance”.
In this case let us choose the Lorenz system.
\[\frac{dx}{dt} = \sigma (y - x)\] \[\frac{dy}{dt} = x (\rho - z) - y\] \[\frac{dz}{dt} = xy - \beta z\]1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import numpy as np
from sympy import *
sigma = Symbol("\\sigma", real=True)
rho = Symbol("\\rho", real=True)
beta = Symbol("\\beta", real=True)
t = Symbol("t", real=True)
x = Function("x")(t)
y = Function("y")(t)
z = Function("z")(t)
v = [sigma * (y - x), x * (rho - z - y), x * y - beta * z]
dvdt = [i.diff(t) for i in v]
agnesian1 = latex(np.prod(dvdt))
print(agnesian1)
This trivially gives the result:
\[\mathcal{A}_t^1 \vec v (t) = \sigma \left(\left(- \frac{d}{d t} y{\left(t \right)} - \frac{d}{d t} z{\left(t \right)}\right) x{\left(t \right)} + \left(\rho - y{\left(t \right)} - z{\left(t \right)}\right) \frac{d}{d t} x{\left(t \right)}\right) \left(- \frac{d}{d t} x{\left(t \right)} + \frac{d}{d t} y{\left(t \right)}\right) \left(- \beta \frac{d}{d t} z{\left(t \right)} + x{\left(t \right)} \frac{d}{d t} y{\left(t \right)} + y{\left(t \right)} \frac{d}{d t} x{\left(t \right)}\right)\]