I am currently using Matlab and the symbolic toolbox to calculate the Jacobian Matrix of different Matrix equations/state space representations.
One equation is
which in detail looks like this:
Now I'm calculating the Jacobian of A with respect to u by using jacobian(A,u), which is just
Now I have 3 questions:
- Currently I'm writing syms phi theta psi u1 u2 u3 u4 n11 n12 n13 n14 n21 ... Is there a more elegant solution to of telling Matlab that a Matrix consists of/is a symbolic variable?
- I tried to verify the result by calculating jacobian(A,u) - (1/m).*T*N, which for some reason Matlab does not simplify. Instead it outputs for the first element for example [(n11 + n21*psi - n31*theta)/m - n11/m - (n21*psi)/m + (n31*theta)/m], which just equals to 0. Why doesnt it show 0 as result?
- The way I'm currently doing it (see 1.), the output I get is mutiplied out. Is there a way to reverse that, so that I know that my result equals (1/m).*T*N ?
I hope someone can help me with these issues.