So I have a matrix
$J(\vec q)=\left[\begin{array}{ccc} a_{11}(\vec{q}) & \cdots & a_{1n}(\vec{q})\\ \vdots & \ddots & \vdots\\ a_{m1}(\vec{q}) & \cdots & a_{mn}(\vec{q}) \end{array}\right]$
where $\vec{q}\in\mathbb{R}^{n \times 1}$ and $a_{ij} \in \mathbb{R}$
I am trying to approximate this matrix using first order Taylor expansion elementwise according to $ J(\vec q) \approx \left[\begin{array}{ccc} \frac{\partial a_{11}(\vec{q})}{\partial\vec{q}}\bigl|_{q_{0}}\Delta\vec{q}+a_{11}(\vec{q}_{o}) & \cdots & \frac{\partial a_{1n}(\vec{q})}{\partial\vec{q}}\bigl|_{q_{0}}\Delta\vec{q}+a_{1n}(\vec{q}_{o})\cdots\\ \vdots & \ddots & \vdots\\ \frac{\partial a_{m1}(\vec{q})}{\partial\vec{q}}\bigl|_{q_{0}}\Delta\vec{q}+a_{m1}(\vec{q}_{o}) & \cdots & \frac{\partial a_{mn}(\vec{q})}{\partial\vec{q}}\bigl|_{q_{0}}\Delta\vec{q}+a_{mn}(\vec{q}_{o})\cdots \end{array}\right]=\\ J(\vec{q}_{o})+\left[\begin{array}{ccc} \frac{\partial a_{11}(\vec{q})}{\partial\vec{q}}\bigl|_{q_{0}}\Delta\vec{q} & \cdots & \frac{\partial a_{11}(\vec{q})}{\partial\vec{q}}\bigl|_{q_{0}}\Delta\vec{q}\\ \vdots & \ddots & \vdots\\ \frac{\partial a_{11}(\vec{q})}{\partial\vec{q}}\bigl|_{q_{0}}\Delta\vec{q} & \cdots & \frac{\partial a_{11}(\vec{q})}{\partial\vec{q}}\bigl|_{q_{0}}\Delta\vec{q} \end{array}\right]$
where $\Delta \vec{q}=\vec{q}-\vec{q}_0$ is the deviation from the linearization point $\vec{q}_0$
- I guess this is a valid approach, although perhaps not the most efficient or standard? I couldn't find a "simple" approach online for doing this.
- My main concern is the last matrix to the right. I would prefer some expression where all partial derivatives end up inside one matrix and the deviations from the linearization point $\Delta \vec{q}$ end up outside of this, for simpler analytical treatment. I guess this is basic linear algebra but it was a while since I took a course in that so :)
Edit: So I got an answer here that I did not quiet understand as the notation was different from mine. I got one step further by differentiating by the scalar elements of $\vec q$ and then sum all contributions from the differentials $\Delta q_i$ resulting in
$J(\vec{q}_{o})+\left(\frac{\partial J}{\partial q_{1}}\Delta q_{1}+\ldots+\frac{\partial J}{\partial q_{n}}\Delta q_{n}\right)\\ =J(\vec{q}_{o})+\left(\frac{\partial J}{\partial q_{1}}\left[\begin{array}{ccc} 1 & \cdots & 0\end{array}\right]\Delta\vec{q}+\ldots+\frac{\partial J}{\partial q_{n}}\left[\begin{array}{ccc} 0 & \cdots & 1\end{array}\right]\Delta\vec{q}\right)\\ $
Although this explanation is a bit hand-wavy it is is easy to verify that the expression is exactly equal to the one first outlined. It is a bit closer to the solution at least.
You can write it in a form of sum:
$J(q)\approx J(q_0)+\sum_{j=1}^n (I_n\,dq_j )\cdot \partial_{q_j}J(q_0)$,
where $I_n$ is the identity matrix, and $\partial_{q_j}J(q_0)$ is the matrix $(\partial_{q_j}J_{m,n}(q_0))_{mn}$.
The operator is $P:=\sum_{j=1}^n (I_n\,dq_j )\cdot \partial_{q_j}$.
There are $n$ freedoms of the direction of the derivative, that is $dq_j$, $j=1,\cdots, n$.