> For the complete documentation index, see [llms.txt](https://windmising.gitbook.io/mathematics-basic-for-ml/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://windmising.gitbook.io/mathematics-basic-for-ml/src/numericalcomputation/ode_sde.md).

# ODE\_SDE

### Ordinary Differential Equation (ODE):

$$
\frac{d\mathbf{x} }{dt} =\mathbf{f} (\mathbf{x},t) \quad \mathrm{or} \quad d\mathbf{x} =\mathbf{f} (\mathbf{x} ,t)dt
$$

> ✅ 图中描述了一个 function，这个函数没有闭式解，而是 \\(\mathbf{x}\\) 随着时间的变化。\
> ✅ \\(f(\mathbf{x},t)\\) 描述的是一个随时间变化的场 \\(f(\mathbf{x},t)\\) 可以是一个用网络拟合的结果。

![](https://2038183336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lv4KY8barIvUvw6Ju8e%2Fuploads%2Fgit-blob-f7b7b961235e4a20b72cf3230abb0084e9349800%2FD1-24-3.png?alt=media)

Analytical Solution:

$$
\mathbf{x} (t)=\mathbf{x} (0)+\int\_{0}^{t} \mathbf{f} (\mathbf{x} ,\tau )d\tau
$$

> ✅ 这个积分经常无法计算，因此把离散化。

Iterative Numerical Solution:

$$
\mathbf{x} (t+\Delta t)\approx \mathbf{x} (t)+\mathbf{f} (\mathbf{x} (t),t)\Delta t
$$

### Stochastic Differential Equation (SDE):

![](https://2038183336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lv4KY8barIvUvw6Ju8e%2Fuploads%2Fgit-blob-3dbfd6dbb17f0fdf5d48cca6c9ba8fa038d74cbc%2FD1-24-4.png?alt=media)

> ✅ \\(\sigma \\) 描述 noise 的 scale。\\(\omega \_ t\\) 描述噪声。\
> ✅ SDE 在每个时间步注入高斯白噪声。因此多次求解 \\(\mathbf{x}(t)\\) 的结果是不一样的。
