Temporal Discretization#
Motivation#
The world is continuous but our operations are discrete.
From the modeling world, this is easily one of the most important decisions one needs to make.
It is also responsible for one of the greatest sources of errors.
Formulation#
Let’s take the general form of a PDE.
where:
\(\boldsymbol{u}:\Omega\times\mathcal{T}\rightarrow \Omega\) - is the unknown vector field
Let’s take the general form of an ODE
where:
\(x:\mathcal{T} \rightarrow\mathbb{R}^D\) - is an unknown function
\(\boldsymbol{F}:\mathbb{R}^D\times \mathbb{R} \rightarrow \mathbb{R}^D\) - is a vector field
\(\mathcal{T}\) - is the time domain; typically \(\mathcal{T}=[0,\mathcal{T}]\)
The art of differential equations is knowing the form of solution and then finding tricks to arrive there. So we can write this down using the fundamental theorem of calculus. It has the form:
where the solution depends upon the initial value \(x(0)=x_0\). So knowing this, we can actually rewrite the general form of the ODE in the above equation to be:
where:
\(x:\mathcal{T} \rightarrow\mathbb{R}^D\) - is an unknown function
\(\boldsymbol{F}:\mathbb{R}^D\times \mathbb{R} \rightarrow \mathbb{R}^D\) - is a vector field
\(\mathcal{T}\) - is the time domain; typically \(\mathcal{T}=[0,\mathcal{T}]\)
\(x_0\) - is the initial value
However, the equation for the solution is difficult because of the integral term. Integrals are hard…as it is impossible to take the expectation of the space with all time. In general, our numerical solvers find the solution by stepping forward in time. So instead of finding the complete trajectory from \(x(0)\) to \(x(t)\), we take a sequence of sub-steps, i.e. \(x(t)\) to \(x(t+\delta t)\). So we can rewrite the solution as
Taylor Expansion Methods#
We can use the Taylor series expansion around:
Having access to all of the derivatives would fully describe the dynamical system
Quadrature Methods#
We can use numerical quadrature!
which motivates the explicit Runge-Kutta algorithm.
Generalized Form#
Source: Learning to Learn with JAX - Teddy Kroker
Surrogate Methods#
We can even use some
Temporal Discretization#
Parameters are artefacts of discretizations…*
Time Steppers - dealing with the integral
X(t)=x(0) + int f(x(t),t)dt
This integral is a hard problem so we instead try and do a time-stepping way.
where we can apply this recursively by marching along.
Euler - correction
RK - correction, basis functions
Explicit vs implicit
ML Models#
Discrete Space - Convolutions + Finite Difference
Fourier, Real
Discrete Time - RNNs, LSTMs
Basis Function
Hidden State
Both - ConvLSTM