Borrar filtros
Borrar filtros

Coding the Jacobian efficiently in MATLAB

8 visualizaciones (últimos 30 días)
Enrique
Enrique el 14 de Mayo de 2024
Editada: Matt J el 14 de Mayo de 2024
How the Jacobian of F(t,u)= Au - u/1+u be computed in MATLAB? A is a square matrix. How best to compute the Jacobian in Exponential Rosenbrock integrator?
function Jn = J(u)
Jn = -A-1./(1+u).^2;
end

Respuesta aceptada

Matt J
Matt J el 14 de Mayo de 2024
Editada: Matt J el 14 de Mayo de 2024
minusA = -A;
J=@(u) JacobianEngine(u,minusA);
function Jn = JacobianEngine(u,Jn)
p=numel(u);
Jn(1:p+1:end)= Jn(1:p+1:end) + (-1./(1+u).^2);
end

Más respuestas (0)

Categorías

Más información sobre Numerical Integration and Differentiation 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