# 数值积分

## 显式积分与隐式积分

将连续积分转化为离散求和的计算方法，用于无法解析求解的积分问题。

By definition, the integral \\(\mathbf{x} (t) = \int \mathbf{v} (t) dt\\) is the area. Many methods estimate the area as a box.

| Explicit Euler                                                                                                                                                                                      | Implicit Euler                                                                                                                                                                                      | Mid-Point                                                                                                                                                                                           |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 显式积分                                                                                                                                                                                                | 隐式积分                                                                                                                                                                                                |                                                                                                                                                                                                     |
| ![](https://2038183336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lv4KY8barIvUvw6Ju8e%2Fuploads%2Fgit-blob-06b81c1af7523a2dc9d94522f1326a8f05d010f4%2F03-4.png?alt=media) | ![](https://2038183336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lv4KY8barIvUvw6Ju8e%2Fuploads%2Fgit-blob-aa4d31b89e90e7e7ead3a5cb3fff83c415afb9f3%2F03-6.png?alt=media) | ![](https://2038183336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lv4KY8barIvUvw6Ju8e%2Fuploads%2Fgit-blob-3d54fcb0ea2ba2528afbfe8198a4121d652e7e31%2F03-8.png?alt=media) |
| ![](https://2038183336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lv4KY8barIvUvw6Ju8e%2Fuploads%2Fgit-blob-3ebe0b78e25d60499b97948e8775665c6273bf82%2F03-5.png?alt=media) | ![](https://2038183336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lv4KY8barIvUvw6Ju8e%2Fuploads%2Fgit-blob-62a42fd8abbb920f8a270368eabdfc9b8ed0c483%2F03-7.png?alt=media) | ![](https://2038183336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lv4KY8barIvUvw6Ju8e%2Fuploads%2Fgit-blob-6adb93a172f1816b96d004d11a68edd06bb21c21%2F03-9.png?alt=media) |
| 使用 \\(t\_0\\) 时刻的速度作为box的高                                                                                                                                                                          | 使用 \\(t\_1\\) 时刻的速度作为box的高                                                                                                                                                                          |                                                                                                                                                                                                     |
| \\(\int\_{t^{\[0]\}}^{t^{\[1]\}} \mathbf{v} (t)dt≈∆t  \mathbf{v} (t^{\[0]})\\)                                                                                                                      | \\(\int\_{t^{\[0]\}}^{t^{\[1]\}} \mathbf{v} (t)dt≈∆t  \mathbf{v} (t^{\[1]})\\)                                                                                                                      | <p>\(t^{[0]}\).<br>\(\int_{t^{[0]}}^{t^{[1]}} \mathbf{v} (t)dt≈∆t  \mathbf{v} (t^{[0.5]})\)</p>                                                                                                     |

> ✅ 假设\\(\mathbf{x} \\)和\\(\mathbf{v} \\)都是一维的。速度的积分就是阴影区域的面积。\
> ✅ 近似到一阶项，因此称为一阶方法。漏掉的高阶项就是误差。\
> 两种方法都只能一阶近似

P16

## Leapfrog Integration

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

> ✅ 速度和位置是错开的。上下两种写法，在计算上是一样的。

In some literature, such a approach is called _semi-implicit_.

It has a funnier name: the _leapfrog method_.

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