Jacobian Matrix of partial derivatives of a nonlinear system
17 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Armand Chrystel Moutchiho
le 23 Mar 2011
Commenté : Yasaman Asiaee
le 19 Sep 2022
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 commentaires
Réponse acceptée
Matt Tearle
le 23 Mar 2011
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 commentaires
Plus de réponses (3)
Armand
le 23 Mar 2011
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 commentaire
Matt Tearle
le 23 Mar 2011
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
le 23 Mar 2011
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 commentaires
Haseeb Hassan
le 15 Mai 2018
How i can use Jacobian Function to find derivatavies of the image in X and X Direction?
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!