How do I calculate the numerical Jacobian for a set of six non linear equations ?

조회 수: 2 (최근 30일)
Hi All
how do I calculate the Jacobian matrix for the following equations based on the example I put afterwards ?
please don't share tutorial links
F(1) = (x(1) - h1 )^2 + (x(2)- v1 )^2 + (x(3)-w1)^2 - A(1)^2;
F(2) = (x(1) - h2 )^2 + (x(2)- v2 )^2 + (x(3)-w2)^2 - A(2)^2;
F(3)= (x(1)-x(2))^2 + (x(2)-x(3))^2 + (x(3)-w3)^2 - A(3)^2;
x is the varaible to solve
% Example: (nonlinear least squares)
% xdata = (0:.1:1)';
% ydata = 1+2*exp(0.75*xdata);
% fun = @(c) ((c(1)+c(2)*exp(c(3)*xdata)) - ydata).^2;
%
% [jac,err] = jacobianest(fun,[1 1 1])
My problem : in the example only the coeficients have been differentiated. in my equations , x should be differentiated
  댓글 수: 4
farzad
farzad 2019년 7월 7일
Star : why have you linked this question to another of mine ?
Matt : does not matter , your answer was great enoough. I got it

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2019년 7월 6일
편집: Matt J 2019년 7월 6일
Jac=nan(3,3); %pre-allocate
Jac(1,:) = 2*[ x(1)-h1 , x(2)-v1 , x(3)-w1 ];
Jac(2,:) = 2*[ x(1)-h2 , x(2)-v2 , x(3)-w2 ];
Jac(3,:) = 2*[ x(1)-x(2) , 2*x(2)-x(1)-x(3) , 2*x(3)-x(2)-w3];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by