Commit 323e6fdf authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Added a second gstep option used as a parameter for the routine computing the hessian matrix.

In some cases, for instance for the non linear filters, it helps to reduce this new gstep parameter
to get a positive definite hessian matrix. options_.gstep is now a 2*1 vector. The first element is
the old gstep parameter, the second element is the new gstep parameter. The step defined for the
computation of the hessian matrix is now:

h1=max(abs(x),sqrt(gstep(1))*ones(n,1))*eps^(1/6)*gstep(2);
parent 13eb2185
......@@ -105,7 +105,7 @@ elseif options_.solve_algo == 2 || options_.solve_algo == 4
if ~jacobian_flag
fjac = zeros(nn,nn) ;
dh = max(abs(x),options_.gstep*ones(nn,1))*eps^(1/3);
dh = max(abs(x),options_.gstep(1)*ones(nn,1))*eps^(1/3);
for j = 1:nn
xdh = x ;
xdh(j) = xdh(j)+dh(j) ;
......
......@@ -45,7 +45,9 @@ options_.dynatol.x = 1e-5;
options_.maxit_ = 10;
options_.slowc = 1;
options_.timing = 0;
options_.gstep = 1e-2;
options_.gstep = ones(2,1);
options_.gstep(1) = 1e-2;
options_.gstep(2) = 1.0;
options_.scalv = 1;
options_.debug = 0;
options_.initval_file = 0;
......
......@@ -39,7 +39,7 @@ if ~isa(func, 'function_handle')
func = str2func(func);
end
n=size(x,1);
h1=max(abs(x),sqrt(gstep)*ones(n,1))*eps^(1/6);
h1=max(abs(x),sqrt(gstep(1))*ones(n,1))*eps^(1/6)*gstep(2);
h_1=h1;
xh1=x+h1;
h1=xh1-x;
......
......@@ -77,7 +77,7 @@ for its = 1:maxit
fvec = fvec(j1);
fjac = fjac(j1,j2);
else
dh = max(abs(x(j2)),options_.gstep*ones(nn,1))*eps^(1/3);
dh = max(abs(x(j2)),options_.gstep(1)*ones(nn,1))*eps^(1/3);
for j = 1:nn
xdh = x ;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment