# 打靶法

打靶法是求解常微分方程边值问题的一种数值方法：它引入未知参数——通常是缺失的初始条件——并确定这些参数，使边界条件得到满足。<sup>[1](https://encyclopediaofmath.org/wiki/Shooting_method)</sup> 其思路是将边值问题转化为一个由猜测值驱动的初值问题，将猜测值向前积分，再不断调整，直到远端边界条件成立。<sup>[2](https://iate.oac.uncor.edu/~mario/materia/nr/numrec/f17-0.pdf)</sup> 《数值 Recipes》把对方程积分比作追踪一发子弹从枪口到靶子的弹道，因此选取初始条件就相当于瞄准。<sup>[2](https://iate.oac.uncor.edu/~mario/materia/nr/numrec/f17-0.pdf)</sup> 形式上，该方法把边值问题归结为寻找使边界条件成立的初始条件，即求一个多元函数的根。<sup>[3](https://reference.wolfram.com/language/tutorial/NDSolveBVP.html)</sup>

| 事实 | 细节 |
|---|---|
| 求解的问题 | 常微分方程的两点边值问题；输出为缺失的初始数据以及由此得到的初值问题解<sup>[1](https://encyclopediaofmath.org/wiki/Shooting_method)</sup> |
| 核心量 | 残差 φ(z) = \( y_{\mathrm{z}} \)(b) − β，即初始斜率 z 在远端边界处造成的不匹配量<sup>[4](https://www.math.iit.edu/~fass/478578_Chapter_7.pdf)</sup> |
| 修正规则 | 对残差做牛顿迭代或割线迭代<sup>[5](https://acme.byu.edu/00000186-a3f2-d200-adf6-a7f7848f0001/shooting-method-pdf)</sup> |
| 每轮代价 | 对 n 个未知参数需积分 ODE 系统 \( n^{2} + 1 \) 次：一次用于计算不匹配量，n² 次用于计算雅可比矩阵<sup>[6](https://iate.oac.uncor.edu/~mario/materia/nr/numrec/f17-1.pdf)</sup> |
| 线性问题 | 一个完整的牛顿循环即可得到解<sup>[6](https://iate.oac.uncor.edu/~mario/materia/nr/numrec/f17-1.pdf)</sup> |
| 主要失效模式 | 稳定的边值问题可能产生不稳定的初值问题；在一个模型问题中，误差从 \( \lambda = 1 \) 时可接受的水平增长到 \( \lambda = 50 \) 时约 \( 10^{32} \)<sup>[7](https://www.cs.usask.ca/~spiteri/M314/notes/AP/chap7.pdf)</sup> |
| 主要变体 | 多重打靶法将区间细分；早期论文为莫里森、赖利与赞卡纳罗发表于《美国计算机学会通讯》1962 年的文章<sup>[8](https://doi.org/10.1145/355580.369128)</sup> |

## 工作原理

对于两点问题 \( y''(t) = f(t, y, y') \)，边界条件为 \( y(a) = \alpha \) 与 \( y(b) = \beta \)，该方法构造一个相关的初值问题，其初始斜率 \( y'(a) = z \) 未知，并在区域右端定义残差 \( \phi(z) := y_z(b) - \beta \)。若 z 选取正确，则 φ(z) = 0，问题得解。<sup>[4](https://www.math.iit.edu/~fass/478578_Chapter_7.pdf)</sup> 对于一般的一阶系统，未知量构成向量 s（例如 y(a) = \( s_{1} \)，y′(a) = \( s_{2} \)），残差通过在初值问题的解处计算边界条件函数来构造，从而把边值问题转化为标准的求根问题。<sup>[9](https://tobydriscoll.net/fnc-julia/bvp/shooting.html)</sup> 《数学百科全书》通过柯西问题 Z′(x) = F(x, Z)，Z(a, r) = r 来表述同一思想，由此得到参数方程 g(r, Z(b, r)) = h，用迭代法求解。<sup>[1](https://encyclopediaofmath.org/wiki/Shooting_method)</sup>

猜测值用牛顿法修正，\( s_{n+1} = s_n - (y(b, s_n) - \beta) / \left. \frac{\partial y(b, s)}{\partial s} \right|_{s_n} \)。<sup>[5](https://acme.byu.edu/00000186-a3f2-d200-adf6-a7f7848f0001/shooting-method-pdf)</sup> 牛顿法所需的导数 φ′(z) 通过求解一个相关的变分初值问题得到，其初始条件为 v(a) = 0，v′(a) = 1，积分到 t = b。<sup>[4](https://www.math.iit.edu/~fass/478578_Chapter_7.pdf)</sup> 割线法用有限差分代替导数，\( s_{n+1} = s_{n} - \left( y(b, s_{n}) - \beta \right) \cdot \left( s_{n} - s_{n-1} \right) / \left( y(b, s_{n}) - y(b, s_{n-1}) \right) \)；它需要两个初始值，收敛比牛顿法慢，但避免了计算 h′(s)。<sup>[5](https://acme.byu.edu/00000186-a3f2-d200-adf6-a7f7848f0001/shooting-method-pdf)</sup> 在向量情形下，每个牛顿步求解 n² 维线性系统 \( J \cdot \delta V = -F \)，并更新 \( V_{\mathrm{new}} = V_{\mathrm{old}} + \delta V \)<sup>[6](https://iate.oac.uncor.edu/~mario/materia/nr/numrec/f17-1.pdf)</sup>，与一般更新式 \( s_{\mathrm{n+1}} = s_{\mathrm{n}} - (G'(s_{\mathrm{n}}))^{-1}G(s_{\mathrm{n}}) \) 一致。<sup>[10](https://mtchu.math.ncsu.edu/Teaching/Lectures/MA583/chapter6.pdf)</sup> 若微分方程是线性的，则 φ 是线性的，因此单个牛顿步即可给出正确的初始斜率。<sup>[4](https://www.math.iit.edu/~fass/478578_Chapter_7.pdf)</sup>

## 操作步骤

实践者遵循一个简短的循环<sup>[11](https://mtchu.math.ncsu.edu/Teaching/Lectures/MA530/chapter10.pdf)</sup>：

1. 为未知的初始斜率选择一个初始猜测值。一个合理的选择是区间上的平均变化率，\( s_{0} = (\beta - \alpha)/(b - a) \)。<sup>[5](https://acme.byu.edu/00000186-a3f2-d200-adf6-a7f7848f0001/shooting-method-pdf)</sup>
2. 以初始条件 [α, \( s_{0} \)]ᵀ 将初值问题积分到 x = b，使用 RK4 或其他积分器，得到不匹配量 \( G(s_{0}) \)。<sup>[11](https://mtchu.math.ncsu.edu/Teaching/Lectures/MA530/chapter10.pdf)</sup>
3. 计算导数 G′(\( s_{0} \))<sup>[11](https://mtchu.math.ncsu.edu/Teaching/Lectures/MA530/chapter10.pdf)</sup>，可以来自变分问题，也可以用有限差分。
4. 应用牛顿或割线更新，重复直到满足停止准则 \( |y(b, t_{k}) - \beta| < \varepsilon \)，并以最大迭代次数 M 作为保障。<sup>[12](https://academicweb.nd.edu/~zxu2/acms40390F13/Lec-11.1-4.pdf)</sup>

对于 N 个耦合的 ODE，一个完整循环需要 \( n^{2} + 1 \) 次积分：一次用于计算当前不匹配量，n² 次用于计算有限差分雅可比矩阵的偏导数。<sup>[6](https://iate.oac.uncor.edu/~mario/materia/nr/numrec/f17-1.pdf)</sup> 在实践中，在更新之间冻结雅可比的拟牛顿法比每步重新计算更高效。<sup>[7](https://www.cs.usask.ca/~spiteri/M314/notes/AP/chap7.pdf)</sup>

## 起源

多重打靶法变体由 戴维·D·莫里森（David D. Morrison）、詹姆斯·D·赖利（James D. Riley）与约翰·F·赞卡纳罗（John F. Zancanaro） 发表于《美国计算机学会通讯》第 5 卷第 12 期，1962 年 12 月，第 613–614 页。<sup>[8](https://doi.org/10.1145/355580.369128)</sup> 将两点边值问题化为初值问题的相关早期工作，是 理查德·贝尔曼（Richard Bellman）、罗伯特·卡拉巴（Robert Kalaba）与 G·米尔顿·温（G. Milton Wing） 于 1960 年发表在《美国国家科学院院刊》上的关于不变嵌入的论文。<sup>[13](https://doi.org/10.1073/pnas.46.12.1646)</sup> M·R·奥斯本（M. R. Osborne）的《论边值问题的打靶法》（《数学分析与应用杂志》，1969 年）分析了该方法<sup>[14](https://doi.org/10.1016/0022-247x%2869%2990059-6)</sup>，而 斯托尔（Stoer）与布尔里施（Bulirsch）的《数值分析导论》（1980 年）中对多重打靶法的教科书处理是标准参考文献。<sup>[15](https://doi.org/10.1007/978-1-4757-5592-3)</sup>

## 变体

多重打靶法将区间 [a, b] 细分，从两端进行打靶，并施加内部匹配条件，得到一个非线性方程组，用修正的牛顿–拉夫森法求解。<sup>[4](https://www.math.iit.edu/~fass/478578_Chapter_7.pdf)</sup> 莫里森、赖利与赞卡纳罗给出的动机是：当微分方程不稳定到初值问题在能够完整积分之前就“爆炸”时，简单打靶法会失败；他们的方法赋予打靶类方法以有限差分法的稳定性优势，同时通常仍比有限差分法更快。<sup>[8](https://doi.org/10.1145/355580.369128)</sup> 多重打靶法比普通打靶法有更大的收敛域<sup>[10](https://mtchu.math.ncsu.edu/Teaching/Lectures/MA583/chapter6.pdf)</sup>，并且通过限制积分初值问题的子区间长度，它解决了单次打靶法的病态性和有限逃逸时间问题；它在 \( \lambda = 20 \) 时毫无问题地求解模型问题，代价是更多的编码工作和可能很多的子区间。<sup>[7](https://www.cs.usask.ca/~spiteri/M314/notes/AP/chap7.pdf)</sup> 各子区间的块可以并行构造，因此得名并行打靶法，而利用稀疏性的高斯消元变体可在 \( O(N) \) 时间内求解方程，并行时为 \( O(\log N) \)。<sup>[7](https://www.cs.usask.ca/~spiteri/M314/notes/AP/chap7.pdf)</sup>

在直接最优控制中，多重打靶法将中间状态加入决策变量，并附加确保轨迹连续性的匹配约束，这与单次打靶法形成对比——后者只有控制输入是决策变量，状态是向前积分的（一种“序贯”方法）。<sup>[16](https://ar5iv.labs.arxiv.org/html/1711.11006)</sup> 时间并行积分的多重打靶法表述也是可微多重打靶层的基础，后者将初值问题作为匹配约束 \( g_{\theta}(B, z_{0}) = 0 \) 的根来求解，所有 N 个初值问题并行计算。<sup>[17](https://proceedings.neurips.cc/paper/2021/file/89b9c689a57b82e59074c6ba09aa394d-Paper.pdf)</sup>

## 应用

最优控制是已发表文献中的主要应用领域。在间接单次打靶法中，从 \( t = 0 \) 到 \( t = T \) 积分协态方程与状态方程，将所得状态与目标 \( x^{\mathrm{eq}} \) 比较，调整初始协态猜测值（通常通过牛顿法），然后重复；根据问题的不同，也可以从最终协态向后打靶。<sup>[18](https://topicsincontrol.com/posts/shooting-method/index.html)</sup> 在机器学习中，多重打靶层将多重打靶法应用于神经微分方程，以实现 ODE 和 PDE 的最优控制，相比神经 ODE 可获得数倍的加速，代价是更高的内存消耗，并在长时程时间序列分类中作为神经 CDE 的替代方案得到评估。<sup>[17](https://proceedings.neurips.cc/paper/2021/file/89b9c689a57b82e59074c6ba09aa394d-Paper.pdf)</sup>

## 局限与替代方法

核心弱点在于，单次打靶法继承的是初值问题的稳定性，而非边值问题的稳定性。在一个增长率为 λ 与 −λ 的解耦模型问题中，对于任何 \( \lambda \neq 0 \)，初值问题解的一个分量都会指数增长，即使边值问题本身是稳定的，这使得打靶法在该情形下毫无希望。<sup>[4](https://www.math.iit.edu/~fass/478578_Chapter_7.pdf)</sup> 萨斯喀彻温大学的讲义在一个模型问题上量化了损害：打靶法在 \( \lambda = 1 \) 时表现良好，在 \( \lambda = 10 \) 时给出错误但看似合理的解，在 \( \lambda = 20 \) 时误差约为 200，在 \( \lambda = 50 \) 时误差约为 \( 10^{32} \)。<sup>[7](https://www.cs.usask.ca/~spiteri/M314/notes/AP/chap7.pdf)</sup> 其机制是误差从设定状态的边界 \( x = a \) 处向外指数增长，因此要在 \( x = b \) 附近达到可接受的精度，就需要在 x = a 附近具有极高的精度。<sup>[9](https://tobydriscoll.net/fnc-julia/bvp/shooting.html)</sup> 打靶法假定初值问题即使对于糟糕的猜测值也能一直解到 \( x = b \)；若起始条件非常错误，初始解可能在穿越区域之前就崩溃，例如当平方根的参数变为负数时。<sup>[7](https://www.cs.usask.ca/~spiteri/M314/notes/AP/chap7.pdf)</sup><sup> • </sup><sup>[6](https://iate.oac.uncor.edu/~mario/materia/nr/numrec/f17-1.pdf)</sup>

NAG 的文档指出，打靶迭代不能保证收敛，但如果系统有解、对于逐步求解不是严重不稳定或非常刚性、且存在良好的初始估计，通常能够成功。<sup>[19](https://wwwafs.portici.enea.it/software/libnag/nagdoc_fl24/html/D02/d02intro.html)</sup> 此外，边值问题的解不保证唯一，而打靶法只能找到一个解。<sup>[3](https://reference.wolfram.com/language/tutorial/NDSolveBVP.html)</sup>

最接近的替代方法以不同方式处理这些问题。在配置法中，解的分量在网格上用分段多项式近似，多项式系数作为未知量，ODE 和边界条件在配置点处强制成立，并用修正的牛顿法求解所得方程；通过使估计误差均匀分布来细化网格。<sup>[19](https://wwwafs.portici.enea.it/software/libnag/nagdoc_fl24/html/D02/d02intro.html)</sup> 有限差分法在网格上建立方程，并使用带延迟修正或网格细化的牛顿迭代；它避免了打靶法的困难，但需要良好的初始解估计，且当解在短范围内变化非常剧烈时不太可能成功。<sup>[19](https://wwwafs.portici.enea.it/software/libnag/nagdoc_fl24/html/D02/d02intro.html)</sup> Wolfram 的文档总结了权衡：打靶法利用了初值问题求解器的速度和自适应性，但不如有限差分法或配置法稳健。<sup>[3](https://reference.wolfram.com/language/tutorial/NDSolveBVP.html)</sup> 《数值 Recipes》补充说，当边界条件微妙或涉及复杂的代数关系时，松弛法效果更好，且当解光滑且不高度振荡时效果最佳，而打靶法则更适用于振荡解或自适应步长重要的情形；作者的做法是“我们总是先打靶，然后再松弛。”<sup>[2](https://iate.oac.uncor.edu/~mario/materia/nr/numrec/f17-0.pdf)</sup>

## References

1. [Shooting method, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Shooting_method)
2. [Numerical Recipes in C, §17.0: Two Point Boundary Value Problems](https://iate.oac.uncor.edu/~mario/materia/nr/numrec/f17-0.pdf)
3. [Numerical Solution of Boundary Value Problems, Wolfram Documentation](https://reference.wolfram.com/language/tutorial/NDSolveBVP.html)
4. [Boundary Value Problems for ODEs (IIT course notes, Chapter 7)](https://www.math.iit.edu/~fass/478578_Chapter_7.pdf)
5. [Shooting Method (BYU ACME notes; merged with labs.acme.byu.edu Volume 4 copy)](https://acme.byu.edu/00000186-a3f2-d200-adf6-a7f7848f0001/shooting-method-pdf)
6. [Numerical Recipes §17.1: The Shooting Method](https://iate.oac.uncor.edu/~mario/materia/nr/numrec/f17-1.pdf)
7. [Chapter 7: Shooting Methods (University of Saskatchewan M314 notes)](https://www.cs.usask.ca/~spiteri/M314/notes/AP/chap7.pdf)
8. [David D. Morrison, James D. Riley, John F. Zancanaro (1962). Multiple shooting method for two-point boundary value problems. Communications of the ACM.](https://doi.org/10.1145/355580.369128)
9. [10.2. Shooting, Fundamentals of Numerical Computation (Driscoll)](https://tobydriscoll.net/fnc-julia/bvp/shooting.html)
10. [Numerical Ordinary Differential Equations, Boundary Value Problems (NC State MA583, Chapter 6)](https://mtchu.math.ncsu.edu/Teaching/Lectures/MA583/chapter6.pdf)
11. [NCSU MA530 Chapter 10 lecture notes (shooting methods)](https://mtchu.math.ncsu.edu/Teaching/Lectures/MA530/chapter10.pdf)
12. [Boundary-Value Problems for ODEs (Notre Dame ACMS 40390 notes)](https://academicweb.nd.edu/~zxu2/acms40390F13/Lec-11.1-4.pdf)
13. [Richard Bellman, Robert Kalaba, G. Milton Wing (1960). INVARIANT IMBEDDING AND THE REDUCTION OF TWO-POINT BOUNDARY VALUE PROBLEMS TO INITIAL VALUE PROBLEMS. Proceedings of the National Academy of Sciences.](https://doi.org/10.1073/pnas.46.12.1646)
14. [On shooting methods for boundary value problems (Journal of Mathematical Analysis and Applications, 1969)](https://doi.org/10.1016/0022-247x%2869%2990059-6)
15. [J. Stoer, R. Bulirsch (1980). Introduction to Numerical Analysis. .](https://doi.org/10.1007/978-1-4757-5592-3)
16. [A Family of Iterative Gauss-Newton Shooting Methods for Nonlinear Optimal Control](https://ar5iv.labs.arxiv.org/html/1711.11006)
17. [Differentiable Multiple Shooting Layers (NeurIPS 2021)](https://proceedings.neurips.cc/paper/2021/file/89b9c689a57b82e59074c6ba09aa394d-Paper.pdf)
18. [Solving Optimal Control Problems via Indirect Single Shooting](https://topicsincontrol.com/posts/shooting-method/index.html)
19. [D02 Chapter Introduction: NAG Library, Mark 24](https://wwwafs.portici.enea.it/software/libnag/nagdoc_fl24/html/D02/d02intro.html)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Oct 15, 2026 · Last review: Sep 30, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数学分析与数学模型 › Numerical analysis and computation

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/shooting-method

English original: https://www.edgepedia.org/shooting-method
