LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate jacobian matrix

Hi,

 

I have a vector  (row vector, 3 enteries) and I need to calculate it's jacobian matrix with respect to another vector. Below is an image attached with following notes.

Jacobian of array named 'function' with respect to array named 'Quaternion In'. 


0 Kudos
Message 1 of 12
(7,214 Views)

jacob.png


0 Kudos
Message 2 of 12
(7,211 Views)

I trust you already know how to calculate a Jacobian Matrix in general.  But, here's a discussion just in case: http://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant

 

What have you tried so far?  It's usually more helpful to attach your VI rather than a picture of your Front Panel.  From there, we can see what your code looks like.

0 Kudos
Message 3 of 12
(7,153 Views)

There are only two icons of these two array controls in my block diagram and nothing else. Yes I know how to calculate a Jacobian Matirx on page but in this case I am lost in how to calculate a Jacobian of "Function" array with respect to Quaternion array. Below are few things I am confused in:

 

1. Each entry of FUNCTION array must be partially derivated w.r.t to quaternion array.

 

2. How am I supposed to partially derivate first entry of FUNCTION with respect to the first entry of quaternion matrix and then derivate rest of the entries in same manner as per the Jacobian definition. 

 

I need a right nudge and meanwhile I am trying myself as well. I will post a VI in a short while.

 

Regards.


0 Kudos
Message 4 of 12
(7,140 Views)

This is hox exactly I am trying to achieve Jacobian matrix. VI is also attached.

 

jacob.png


0 Kudos
Message 5 of 12
(7,126 Views)

This VI does not make any sense.

 

You need a function model that is a function of your parameters. You only have a static fuction array so I don't see what you are trying to do at all.

0 Kudos
Message 6 of 12
(7,108 Views)

By the way, if you objective is to work with Quaternions, the Robotics module actually has most of the operations that you would like to use:

 

http://zone.ni.com/reference/en-XX/help/372983B-01/lvrobovi/quaternion_pal/

 

Also, most likely, if you want to obtain the jacobian matrix from quaternion, then you probably need to convert the quaternion into matrix transformation and, then use equation to obtain the jacobian. In robotics, there is a formula for dealing with Jacobian between two transformations. See page 10 in:

 

http://mech337.engr.scu.edu/references/robot.pdf

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 7 of 12
(7,031 Views)

The problem I'm facing is in derivating.

I have following function 

f.png

 

I need it's jacobian, which should come like this

 

f.png

Since we can't symbollicaly multiply equations, how am I supposed to take partial derivative of Function and get it's jacobian? I have following data fed in as initial values

q1=1

q2=q3=q4=0.

 

 


0 Kudos
Message 8 of 12
(6,942 Views)

It would help everyone greatly if you would post your code when you get stuck.  If we can't see your code, that leaves us with two realstic options: write the entire program for you or wait for your code.  The posters that are the most engaged with their own code in these forums tend to receive the best reception and the community is able to help them much quicker.

 

Did you make any changes after altenbach pointed to some programming errors?

0 Kudos
Message 9 of 12
(6,871 Views)

I am being total blind in how to take Jacobian Matirx of objective function by calculating partial derivatives of each entry as I have mentioned earlier. I have calculated objective function as shown in image below (VI also posted). This part of code rotates a vector with quaternion and then subtracted from acceleration measurements of three axis just according to the equation mentioned afore. 

 

The initial values of Quaternion, Vector and Accelerations are shown in fornt panel. 

 

Untitled.png


0 Kudos
Message 10 of 12
(6,855 Views)