Borrar filtros
Borrar filtros

evaluate jacobian using fsolve

2 visualizaciones (últimos 30 días)
DS
DS el 28 de Mzo. de 2018
Editada: DS el 28 de Mzo. de 2018
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,

Respuestas (0)

Categorías

Más información sobre RF Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by