Differentiation of a parametric function using MATLAB or Maple

1k Views Asked by At

I'm doing some mathematical calculation of some symbolic math that includes multiplication and differentiation of some matrices. Some of the parameters in my calculations are functions of time. for example I have sin(p) where p is a function of time and when differentiating, it should be like p(dot)*cos(p). There are very big matrices that have large expressions like this and I should differentiate them. The problem is that I can't perform this in MATLAB (symbolic math toolbox) or Maple.

1

There are 1 best solutions below

0
On

In Maple, you can map the diff command over a Matrix.

The following is the same as apply diff(r, t) for every entry r of the Matrix.

M:=Matrix([[sin(p(t)),cos(p(t))],[exp(p(t)),p(t)^2]]);

                          [sin(p(t))  cos(p(t))]
                          [                    ]
                     M := [                 2  ]
                          [exp(p(t))    p(t)   ]

map(diff, M, t);

            [          / d      \             / d      \]
            [cos(p(t)) |--- p(t)|  -sin(p(t)) |--- p(t)|]
            [          \ dt     /             \ dt     /]
            [                                           ]
            [/ d      \                     / d      \  ]
            [|--- p(t)| exp(p(t))    2 p(t) |--- p(t)|  ]
            [\ dt     /                     \ dt     /  ]