This contribution proposes a new formulation to efficiently compute directional derivatives of order one to fourth. The formulation is based on automatic differentiation implemented with dual numbers. Directional derivatives are particular cases of symmetric multilinear forms; therefore, using their symmetric properties and their coordinate representation, we implement functions to calculate mixed partial derivatives. Moreover, with directional derivatives, we deduce concise formulas for the velocity, acceleration, jerk, and jounce/snap vectors. The utility of our formulation is proved with three examples. The first example presents a comparison against the forward mode of finite differences to compute the fourth-order directional derivative of a scalar function. To this end, we have coded the finite differences method to calculate partial derivatives until the fourth order, to any order of approximation. The second example presents efficient computations of the velocity, acceleration, jerk, and jounce/snap. Finally, the third example is related to the computation of some partial derivatives. The implemented code of the proposed formulation and the finite differences method is proportioned as additional material to this article.
翻译:本文提出了一种高效计算一阶至四阶方向导数的新方法。该方法基于双数实现的自动微分技术。方向导数是对称多重线性形式的特例;因此,利用其对称性质及坐标表示,我们实现了混合偏导数的计算函数。此外,借助方向导数,我们推导出速度、加速度、加加速度及跳度/急动度向量的简洁公式。通过三个算例验证了该方法的有效性:第一个算例将所提方法与有限差分前向模式进行对比,计算标量函数的四阶方向导数——我们编写了可计算任意逼近阶数下直至四阶偏导数的有限差分法代码;第二个算例展示了速度、加速度、加加速度及跳度/急动度的高效计算过程;第三个算例涉及若干偏导数的计算。本文配套提供了所提方法及有限差分法的实现代码作为补充材料。