필터 지우기
필터 지우기

evaluate jacobian using fsolve

조회 수: 2 (최근 30일)
DS
DS 2018년 3월 28일
편집: DS 2018년 3월 28일
my function and corresponding jacobian are:
function [F,J] = myfun(x)
global m mxm Dvec gamma_0 tau_0
Ft = zeros(5,5);
n = 5;
for ki = 1:12
Fi = ((abs(m(ki,:)*x)/tau_0)^(n-1))*mxm(:,:,ki);
Ft = Ft+Fi;
end
F = (gamma_0/tau_0)*Ft*x-Dvec;
J = n*(gamma_0/tau_0)*Ft;
end
in which m is a 5x1x12 vector list, mxm is a 5x5x12 matrix list, input x is a 5x1 vector. the returned function F is a 5x1 vector and J is the 5x5 jacobian of F.
Interestingly, when I use fsolve to evaluate the function, I can get the desired results. However, when I increase the exponent,n, to larger than 5, the fsolve returns the DerivativeCheck fail information: Maximum relative difference between supplied and finite-difference derivatives = 0.0115267.
I wonder how matlab handle this evaluation. Is there a way to write the jacobian more effectively for a function like this?
thank you,

답변 (0개)

카테고리

Help CenterFile Exchange에서 RF Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by