Matlab; Jacobian array calculation question

In summary, to calculate the Jacobian matrix for a function with respect to a set of variables in MATLAB, you can use the "jacobian" function from the Symbolic Math Toolbox. This function takes the function and the set of variables as arguments and returns the Jacobian matrix. You can then substitute in the values of your parameters and evaluate the result to get the desired output. This is especially useful when dealing with large or complex Jacobian matrices in MATLAB.
  • #1
norian
1
0
Hi,
i want to ask a question, if you help me i'll apraciate.

I have a jacobian matris with 4 initial parameters. J [1,1] like:

J =
-1/25-7610043006264749541981/760193818229211136000000*20265^(3/4)*1663^(1/4)*(1/T)^(7/4)/Yf^(9/10)*233^(13/20)*1000^(7/20)*Yox^(33/20)-Ypr

in here. I know T, Yf, Yox and Ypr.
At that problem i m having trouble with putting these parameter inside the jacobian matris because it is a darivative of some function. And printing J gives me that answer. do you know how to do that(calculate J with respect to 4 know parameters)? By the way i m working on matlab. and there are lots of J(as i made J1, J2 etc.) inside a for loop so i can't calculate it by hand :)

Thanks,


What i had tried:

as an example;

syms x y z
f = [x*y*z; y; x + z];
v = [x, y, z];
R = jacobian(f, v)

The result is

R =
[ y*z, x*z, x*y]
[ 0, 1, 0]
[ 1, 0, 1]

as vector R in here i found J array above, but i could not give a value for x,y or z to compute R.
 
Physics news on Phys.org
  • #2
The best solution for this problem would be to use the Symbolic Math Toolbox in MATLAB. The Symbolic Math Toolbox has a function called "jacobian" which can be used to calculate the Jacobian matrix of a function with respect to a given set of variables. This function takes two arguments, the first being the function and the second being the set of variables. For example, if we have a function f(x, y, z) and we want to calculate the Jacobian matrix J with respect to x, y, and z, we could use the following code: syms x y zf = [x*y*z; y; x + z];v = [x, y, z]; J = jacobian(f, v)This will return the Jacobian matrix J as J =[ y*z, x*z, x*y] [ 0, 1, 0][ 1, 0, 1]You can then substitute in the values of your parameters T, Yf, Yox, and Ypr for x, y, z, respectively, and evaluate the result to get the desired output. For example, if T = 10, Yf = 20, Yox = 30, and Ypr = 40, you can evaluate the Jacobian matrix as follows:J = subs(J, [x, y, z], [10, 20, 30])Which will return the Jacobian matrix with the given parameters substituted in:J =[ 600, 200, 300] [ 0, 1, 0][ 1, 0, 1]
 

1. What is a Jacobian array in Matlab?

A Jacobian array in Matlab is a matrix that contains the partial derivatives of a set of functions with respect to a set of variables. It is commonly used in mathematical and scientific calculations to determine the sensitivity of a system's output to changes in its inputs.

2. How do I calculate the Jacobian array in Matlab?

To calculate the Jacobian array in Matlab, you can use the built-in function "jacobian" or manually compute it using the "diff" function to find the partial derivatives and then create a matrix using these derivatives.

3. What is the purpose of calculating the Jacobian array?

The Jacobian array is used to analyze and understand the behavior of a system by quantifying the relationship between its inputs and outputs. It is also used in optimization and control problems to find the optimal values of the system's parameters.

4. Can the Jacobian array be calculated for any function?

Yes, the Jacobian array can be calculated for any function that has multiple inputs and outputs. It is not limited to any specific type of function or equation.

5. Are there any alternative methods for calculating the Jacobian array?

Yes, there are alternative methods for calculating the Jacobian array, such as using the symbolic math toolbox or numerical differentiation techniques. However, the "jacobian" function in Matlab is the most efficient and accurate method for calculating the Jacobian array for most functions.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
566
Replies
2
Views
778
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
123
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
Back
Top