通常有两种情况:矩阵无复合求导和矩阵有复合求导。
矩阵无复合求导
如果没有复合求导,可以参见[2]中的例程。
代码
A := t -> matrix(2, 3, [2*t^4, tan(t), 1/2*ln(t^2 - 3), 2*cos(t), t^2 + 6, cosh(t)]):'A(t)' = A(t);
`der(A)` := map(diff, A(t), t): Diff('A(t)', t) = matrix(`der(A)`);
矩阵有复合求导
如果矩阵元素有复合求导,后加括号,里面写上参数,如下图所示, α \alpha α又是 t t t的函数,最后是对 t t t求导。
代码
M := Matrix([[sin(alpha(t)), exp(p*alpha(t))]]);
map(diff, M, t);
相关参考
[1]Taking Derivative of a Matrix with functions in Maple. Want to leave functions as prime (f’ or f’') and not evaluate
[2]Matrix Algebra: Unit 27: Differentiation of matrices