Jacobian Matrix of partial derivatives of a nonlinear system

17 次查看(过去 30 天)
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

采纳的回答

Matt Tearle
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)).

更多回答(3 个)

Armand
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
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
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.

Armand Chrystel Moutchiho
Well, actually i want to approximate the jacobians of a nonlinear system for which i don't have the function f/fun. I want to use it to compute the extended kalman filter! For example i might want to predict the outputs of a vehicle, whereby the input is the Acceleration/Brake-Pedal positions and the output is the Speed. As inputs for the simple kalman filter, i approximated the matrices A, B and C by use of the recursive least square algorithm(from which i get a parametrised transfer function. Then i can get the state space model with matlab functions). But for the extended kalman filter the linear state space matrices are not sufficient anymore, and i need the jacobians of my system, while only having the inputs and beeing able to measure the ouputs/States acceleration, speed and position of the vehicle. I would have pasted a picture here of the for-iteration subsystem i used to approximate the jacobians, as i said in my first post, but i think one cannot paste a picture here. right!??

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by