Jacobian Matrix of partial derivatives of a nonlinear system
34 ビュー (過去 30 日間)
古いコメントを表示
Armand Chrystel Moutchiho
2011 年 3 月 23 日
コメント済み: Yasaman Asiaee
2022 年 9 月 19 日
Hello to everyone, i am trying to compute dynamically the jacobians of a nonlinear system. Let say i cannot have the description of he system; It is like a black box and i can just observe the states or measure the outputs!! Is it correct(theoretically) to approximate for example the jacobian-element H(i,j) using H(i,j) = difference of output(i) / difference of output(j) ?? If not why? i have build a simulink block which apply this operation on each output and on each state to build me what i think should be an aprroximation of the system. Please, i am not yet a Control-system expert and would like to know your opinions. Thank you for your help and time. Armand
0 件のコメント
採用された回答
Matt Tearle
2011 年 3 月 23 日
Yes, you can use any standard finite difference approximation to get a Jacobian, so H(i,j) = diff(output(i))/diff(input(j)) would work. Computationally it can be expensive. If your system returns the output as a vector, you can at least get the columns of H as vectors - that is, H(:,j) = diff(output)/diff(input(j)).
0 件のコメント
その他の回答 (3 件)
Armand
2011 年 3 月 23 日
That is also what i thought. But i try to test the jacobian, by multiplying a simulink signal x(k) (dimensions [3x1], for example three sinus waves) with a matrix C([2x3]), to obtain y. Then i gave y and x as inputs to my Jacobian Block. I was expecting to receive as output a matrix [2x3], with nearly the same values as in C. The output dimensions was as expected, but the values weren't!? Could someone maybe explain why? Thanks a lot for the answer(s). Armand
1 件のコメント
Matt Tearle
2011 年 3 月 23 日
Perhaps I misunderstand, but if you're defining your function as y = C*x, then any f.d. method should return the exact Jacobian (C). I think we'd have to see the code to work out what the problem is.
Matt Tearle
2011 年 3 月 23 日
Here's a f.d. Jacobian function I threw together:
function J = fdjacobian(f,x,dx)
y = f(x);
m = length(y);
n = length(x);
J = zeros(m,n);
for k = 1:n
xnew = x;
xnew(k) = xnew(k)+dx;
ynew = f(xnew);
J(:,k) = ynew-y;
end
J = J/dx;
But you can find something similar, but better, on File Exchange. Check out Yi Cao's complex-step Jacobian.
2 件のコメント
Haseeb Hassan
2018 年 5 月 15 日
How i can use Jacobian Function to find derivatavies of the image in X and X Direction?
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!