Borrar filtros
Borrar filtros

How to replace my optimset with equivalent optimoptions ?

1 visualización (últimos 30 días)
farzad
farzad el 3 de Jul. de 2019
Editada: Matt J el 4 de Jul. de 2019
Hi all
using Fsolve, I am getting into difficulties and want to use Jacobian and Hessian as well , but first I need to pass from optimset to optimoptions
currently my Options are :
options = optimset('Display','iter','MaxFunEvals',1e6,'MaxIter',1e6,'TolFun',1e-3,'DerivativeCheck','on','Diagnostics','on');
so first, I need to have the equivalent optimoptions and then include Jacobian and Hessian.
since for some of my input data no solution is found ( Func-Count = 1.5e+7 ) , I need to imrpove my solution

Respuesta aceptada

Matt J
Matt J el 3 de Jul. de 2019
Editada: Matt J el 3 de Jul. de 2019
Why not just,
options = optimoptions(@fsolve, 'Display','iter','MaxFunEvals',1e6,'MaxIter',1e6,...
'TolFun',1e-3,'DerivativeCheck','on','Diagnostics','on');
  22 comentarios
farzad
farzad el 3 de Jul. de 2019
Are you Sure diff is symbolic ?
and why can't I use symbolic ? shall you help me understand ?
Matt J
Matt J el 3 de Jul. de 2019
Editada: Matt J el 4 de Jul. de 2019
Do you understand the difference between symbolic and numeric computation? In symbolic computation, you present the expression for a function, and the software tries to take its derivatives analytically, as you or I would in a calculus course. The result is an analytical expression for the derivative, not a number.
But fsolve is a numeric solver. It puts in numbers for x and expects your code to give back numbers for the resulting Jacobian(x). On top of that, it does this repeatedly with different x, in its search for a solution. For the sake of speed, therefore, you don't want your code redoing the calculus to get expressions for the Jacobian every time it is called.

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by