O. Pannekoucke$^{1,2,3}$

$^1$ INPT-ENM, Toulouse, France

$^2$ CNRM, Université de Toulouse, Météo-France, CNRS, Toulouse, France

$^3$ CERFACS, Toulouse, France

(olivier.pannekoucke@meteo.fr)

**Abstract**

This notebook illustrates the use of sympkf to build and handle the PKF dynamics associated with the harmonic oscillator as 2D fields given by
$$\left\{\begin{array}{c}
\partial_t u =v\\
\partial_t v =-u
\end{array}\right.$$
where $u$ and $v$ are functions of $t,x$.
For this dynamics, the resulting PKF system is not closed because of the cros-correlation.

# Definition of the 1D multivariate dynamics


```python
import sympy
sympy.init_printing() 
```

**Definition of the dynamics from sympy tools**


```python
from sympy import Function, Derivative, Eq, symbols
from sympkf import SymbolicPKF, t
```


```python
x  = symbols('x')
u = Function('u')(t,x)
v = Function('v')(t,x)
dynamics = [Eq(Derivative(u,t), v), Eq(Derivative(v,t), -u)]
dynamics
```

# Computation of the PKF dynamics by using SymPKF


```python
pkf_dynamics = SymbolicPKF(dynamics)
```


```python
for equation in pkf_dynamics.in_metric:    display(equation)
```


```python
for equation in pkf_dynamics.in_aspect:    display(equation)
```


```python
pkf_dynamics.internal_closure
```

1e5b478d78685a960845c1e6797d18d317b493e0
ipynb
Jupyter Notebook
example/PKF on 1D multivariate oscillator.ipynb
opannekoucke/sympkf
914dbc8127f16d28b1fe2f5afe2bc0864d53d644
CECILL-B
example/PKF on 1D multivariate oscillator.ipynb
opannekoucke/sympkf
914dbc8127f16d28b1fe2f5afe2bc0864d53d644
CECILL-B
example/PKF on 1D multivariate oscillator.ipynb
opannekoucke/sympkf
914dbc8127f16d28b1fe2f5afe2bc0864d53d644
CECILL-B
Qwen/Qwen-72B
1. YES
2. YES