levMarMethods

Extended_rate_function(opt, varargin)

USAGE:

[hxk, ghxk] = Extended_rate_function(opt, varargin)

INPUTS:

xk: current point; opt: structure includes required parameters:

  • .FR - concatenation of forward and reverse stoichiometric matrix

  • .A - Reduced forward stoichiometric matrix

  • .B - Reduced reverse stoichiometric matrix

  • .L - left null space of R-F

  • .l0 - positive initial concentration

  • .k - initial kinetic

OUTPUTS:

hxk: the vector h(xk) ghxk: gradient of h at xk

GLM_FY(mapp, lin_sym_solver, x0, options)

GLM_FY is a Levenberg-Marquardt algorithm for solving systems of nonlinear equations \(h(x) = 0\), x in \(R^m\) using the nonlinear unconstrained minimization \(\textrm{min} \psi(x) = 1/2 ||h(x)||^2\) s.t. x in \(R^m\).

USAGE:

[x_best, psi_best, out] = GLM_FY(mapp, lin_sym_solver, x0, options)

INPUTS:

mapp: function handle provides h(x) and gradient h(x) lin_sym_solver: function handle for solving the linear system x0: initial point options: structure including the parameteres of scheme

  • .eta - parameter of the scheme

  • .MaxNumIter - maximum number of iterations

  • .MaxNumMapEval - maximum number of function evaluations

  • .MaxNumGmapEval - maximum number of subgradient evaluations

  • .TimeLimit - maximum running time

  • .epsilon - accuracy parameter

  • .x_opt - optimizer

  • .psi_opt - optimum

  • .adaptive - update lambda adaptively

  • .flag_x_error - 1: saves \(x_{error}\), 0: do not saves \(x_{error}\) (default)

  • .flag_psi_error - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .flag_time - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .Stopping_Crit - stopping criterion

    1. stop if \(||grad|| \leq \epsilon\)

    2. stop if \(||nhxk|| \leq \epsilon\)

    3. stop if MaxNumIter is reached

    4. stop if MaxNumMapEval is reached

    5. stop if MaxNumGmapEval is reached

    6. stop if TimeLimit is reached

    7. stop if \(||grad|| \leq \textrm{max}(\epsilon, \epsilon^2 * ngradx0)\)

    8. stop if \(||nhxk|| \leq \textrm{max}(\epsilon, \epsilon^2 * nhx0)\)

    9. stop if (default) \(||hxk|| \leq \epsilon\) or MaxNumIter is reached

OUTPUTS:

x_best: the best approximation of the optimizer psi_best: the best approximation of the optimum out: structure including more output information

  • .T - running time

  • .Niter - total number of iterations

  • .Nmap - total number of mapping evaluations

  • .Ngmap - total number of mapping gradient evaluations

  • .merit_func - array including all merit function values

  • .x_error - relative error \(\textrm{norm}(x_k(:)-x_{opt}(:))/\textrm{norm}(x_{opt})\)

  • .psi_error - relative error \((\psi_k-\psi_{opt})/(\psi_0-\psi_{opt}))\)

  • .Status - reason of termination

GLM_YF(mapp, lin_sym_solver, x0, options)

GLM_YF is a Levenberg-Marquardt algorithm for solving systems of nonlinear equations \(h(x) = 0\), x in \(R^m\) using the nonlinear unconstrained minimization \(\textrm{min} \psi(x) = 1/2 ||h(x)||^2\) s.t. x in \(R^m\).

USAGE:

[x_best, psi_best, out]=GLM_YF(mapp, lin_sym_solver, x0, options)

INPUTS:

mapp: function handle provides h(x) and gradient h(x) lin_sym_solver: function handle for solving the linear system x0: initial point options: structure including the parameteres of scheme

  • .eta - parameter of the scheme

  • .MaxNumIter - maximum number of iterations

  • .MaxNumMapEval - maximum number of function evaluations

  • .MaxNumGmapEval - maximum number of subgradient evaluations

  • .TimeLimit - maximum running time

  • .epsilon - accuracy parameter

  • .x_opt - optimizer

  • .psi_opt - optimum

  • .adaptive - update lambda adaptively

  • .flag_x_error - 1: saves \(x_{error}\), 0: do not saves \(x_{error}\) (default)

  • .flag_psi_error - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .flag_time - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .Stopping_Crit - stopping criterion

    1. stop if \(||grad|| \leq \epsilon\)

    2. stop if \(||nhxk|| \leq \epsilon\)

    3. stop if MaxNumIter is reached

    4. stop if MaxNumMapEval is reached

    5. stop if MaxNumGmapEval is reached

    6. stop if TimeLimit is reached

    7. stop if \(||grad|| \leq \textrm{max}(\epsilon, \epsilon^2 * ngradx0)\)

    8. stop if \(||nhxk|| \leq \textrm{max}(\epsilon, \epsilon^2 * nhx0)\)

    9. stop if (default) \(||hxk|| \leq \epsilon\) or MaxNumIter is reached

OUTPUT:

x_best: the best approximation of the optimizer psi_best: the best approximation of the optimum out: structure including more output information

  • .T - running time

  • .Niter - total number of iterations

  • .Nmap - total number of mapping evaluations

  • .Ngmap - total number of mapping gradient evaluations

  • .merit_func - array including all merit function values

  • .x_error - relative error \(\textrm{norm}(x_k(:)-x_{opt}(:))/\textrm{norm}(x_{opt})\)

  • .psi_error - relative error \((\psi_k-\psi_{opt})/(\psi_0-\psi_{opt}))\)

  • .Status - reason of termination

Initialization(options)

Initialization is a function for initializing the parameters of LLM and GLM. If some parameters specified by the user Initialization uses these parameters. Otherwise, the default values will be employed.

USAGE:

[eta, epsilon, MaxNumIter, MaxNumMapEval, MaxNumGmapEval, adaptive, TimeLimit, flag_x_error, flag_psi_error, flag_time, Stopping_Crit] = Initialization(options)

INPUTS:

options: structure including the parameteres of schemes

  • .eta - parameter of the scheme

  • .MaxNumIter - maximum number of iterations

  • .MaxNumMapEval - maximum number of function evaluations

  • .MaxNumGmapEval - maximum number of subgradient evaluations

  • .TimeLimit - maximum running time

  • .epsilon - accuracy parameter

  • .x_opt - optimizer

  • .psi_opt - optimum

  • .adaptive - update lambda adaptively

  • .flag_x_error - 1: saves \(x_{error}\), 0: do not saves \(x_{error}\) (default)

  • .flag_psi_error - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .flag_time - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .Stopping_Crit - stopping criterion

    1. stop if \(||grad|| \leq \epsilon\)

    2. stop if \(||nhxk|| \leq \epsilon\)

    3. stop if MaxNumIter is reached

    4. stop if MaxNumMapEval is reached

    5. stop if MaxNumGmapEval is reached

    6. stop if TimeLimit is reached

    7. stop if \(||grad|| \leq \textrm{max}(\epsilon, \epsilon^2 * ngradx0)\)

    8. stop if \(||nhxk|| \leq \textrm{max}(\epsilon, \epsilon^2 * nhx0)\)

    9. stop if (default) \(||hxk|| \leq \epsilon\) or MaxNumIter is reached

OUTPUTS:

eta: parameter of the scheme MaxNumIter: maximum number of iterations MaxNumMapEval: maximum number of function evaluations MaxNumGmapEval: maximum number of subgradient evaluations TimeLimit: maximum running time epsilon: accuracy parameter x_opt: optimizer psi_opt: optimum adaptive: update lambda adaptively flag_x_error: 1: saves \(x_{error}\), 0: do not saves \(x_{error}\) (default) flag_psi_error: 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default) flag_time: 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default) Stopping_Crit: stopping criterion

LLM(mapp, lin_sym_solver, x0, options)

LLM is a Levenberg-Marquardt algorithm for solving systems of nonlinear equations \(h(x) = 0\), x in \(R^m\) using the nonlinear unconstrained minimization \(\textrm{min} \psi(x) = 1/2 ||h(x)||^2\) s.t. x in \(R^m\).

USAGE:

[x_best, psi_best, out] = LLM(mapp, lin_sym_solver, x0, options)

INPUTS:

mapp: function handle provides h(x) and gradient h(x) lin_sym_solver: function handle for solving the linear system x0: initial point options: structure including the parameteres of scheme

  • .eta - parameter of the scheme

  • .MaxNumIter - maximum number of iterations

  • .MaxNumMapEval - maximum number of function evaluations

  • .MaxNumGmapEval - maximum number of subgradient evaluations

  • .TimeLimit - maximum running time

  • .epsilon - accuracy parameter

  • .x_opt - optimizer

  • .psi_opt - optimum

  • .adaptive - update lambda adaptively

  • .flag_x_error - 1: saves \(x_{error}\), 0: do not saves \(x_{error}\) (default)

  • .flag_psi_error - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .flag_time - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .Stopping_Crit - stopping criterion

    1. stop if \(||grad|| \leq \epsilon\)

    2. stop if \(||nhxk|| \leq \epsilon\)

    3. stop if MaxNumIter is reached

    4. stop if MaxNumMapEval is reached

    5. stop if MaxNumGmapEval is reached

    6. stop if TimeLimit is reached

    7. stop if \(||grad|| \leq \textrm{max}(\epsilon, \epsilon^2 * ngradx0)\)

    8. stop if \(||nhxk|| \leq \textrm{max}(\epsilon, \epsilon^2 * nhx0)\)

    9. stop if (default) \(||hxk|| \leq \epsilon\) or MaxNumIter is reached

OUTPUTS:

x_best: the best approximation of the optimizer psi_best: the best approximation of the optimum out: structure including more output information

  • .T - running time

  • .Niter - total number of iterations

  • .Nmap - total number of mapping evaluations

  • .Ngmap - total number of mapping gradient evaluations

  • .merit_func - array including all merit function values

  • .x_error - relative error \(\textrm{norm}(x_k(:)-x_{opt}(:))/\textrm{norm}(x_{opt})\)

  • .psi_error - relative error \((\psi_k-\psi_{opt})/(\psi_0-\psi_{opt}))\)

  • .Status - reason of termination

LMLS(mapp, lin_sym_solver, x0, options)

LMLS is a Levenberg-Marquardt algorithm for solving systems of nonlinear equations \(h(x) = 0\), x in \(R^m\) using the nonlinear unconstrained minimization \(\textrm{min} \psi(x) = 1/2 ||h(x)||^2\) s.t. x in \(R^m\).

USAGE:

[x_best, psi_best, out] = LMLS(mapp, lin_sym_solver, x0, options)

INPUTS:

mapp: function handle provides h(x) and gradient h(x) lin_sym_solver: function handle for solving the linear system x0: initial point options: structure including the parameteres of scheme

  • .eta - parameter of the scheme

  • .MaxNumIter - maximum number of iterations

  • .MaxNumMapEval - maximum number of function evaluations

  • .MaxNumGmapEval - maximum number of subgradient evaluations

  • .TimeLimit - maximum running time

  • .epsilon - accuracy parameter

  • .x_opt - optimizer

  • .psi_opt - optimum

  • .adaptive - update lambda adaptively

  • .flag_x_error - 1: saves \(x_{error}\), 0: do not saves \(x_{error}\) (default)

  • .flag_psi_error - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .flag_time - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .Stopping_Crit - stopping criterion

    1. stop if \(||grad|| \leq \epsilon\)

    2. stop if \(||nhxk|| \leq \epsilon\)

    3. stop if MaxNumIter is reached

    4. stop if MaxNumMapEval is reached

    5. stop if MaxNumGmapEval is reached

    6. stop if TimeLimit is reached

    7. stop if \(||grad|| \leq \textrm{max}(\epsilon, \epsilon^2 * ngradx0)\)

    8. stop if \(||nhxk|| \leq \textrm{max}(\epsilon, \epsilon^2 * nhx0)\)

    9. stop if (default) \(||hxk|| \leq \epsilon\) or MaxNumIter is reached

OUTPUTS:

x_best: the best approximation of the optimizer psi_best: the best approximation of the optimum out: structure including more output information

  • .T - running time

  • .Niter - total number of iterations

  • .Nmap - total number of mapping evaluations

  • .Ngmap - total number of mapping gradient evaluations

  • .merit_func - array including all merit function values

  • .x_error - relative error \(\textrm{norm}(x_k(:)-x_{opt}(:))/\textrm{norm}(x_{opt})\)

  • .psi_error - relative error \((\psi_k-\psi_{opt})/(\psi_0-\psi_{opt}))\)

  • .Status - reason of termination

LMTR(mapp, lin_sym_solver, x0, options)

LMTR is a Levenberg-Marquardt algorithm for solving systems of nonlinear equations \(h(x) = 0\), x in \(R^m\) using the nonlinear unconstrained minimization \(\textrm{min} \psi(x) = 1/2 ||h(x)||^2\) s.t. x in \(R^m\).

USAGE:

[x_best, psi_best, out] = LMTR(mapp, lin_sym_solver, x0, options)

INPUTS:

mapp: function handle provides h(x) and gradient h(x) lin_sym_solver: function handle for solving the linear system x0: initial point options: structure including the parameteres of scheme

  • .eta - parameter of the scheme

  • .MaxNumIter - maximum number of iterations

  • .MaxNumMapEval - maximum number of function evaluations

  • .MaxNumGmapEval - maximum number of subgradient evaluations

  • .TimeLimit - maximum running time

  • .epsilon - accuracy parameter

  • .x_opt - optimizer

  • .psi_opt - optimum

  • .adaptive - update lambda adaptively

  • .flag_x_error - 1: saves \(x_{error}\), 0: do not saves \(x_{error}\) (default)

  • .flag_psi_error - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .flag_time - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .Stopping_Crit - stopping criterion

    1. stop if \(||grad|| \leq \epsilon\)

    2. stop if \(||nhxk|| \leq \epsilon\)

    3. stop if MaxNumIter is reached

    4. stop if MaxNumMapEval is reached

    5. stop if MaxNumGmapEval is reached

    6. stop if TimeLimit is reached

    7. stop if \(||grad|| \leq \textrm{max}(\epsilon, \epsilon^2 * ngradx0)\)

    8. stop if \(||nhxk|| \leq \textrm{max}(\epsilon, \epsilon^2 * nhx0)\)

    9. stop if (default) \(||hxk|| \leq \epsilon\) or MaxNumIter is reached

OUTPUTS:

x_best: the best approximation of the optimizer psi_best: the best approximation of the optimum out: structure including more output information

  • .T - running time

  • .Niter - total number of iterations

  • .Nmap - total number of mapping evaluations

  • .Ngmap - total number of mapping gradient evaluations

  • .merit_func - array including all merit function values

  • .x_error - relative error \(\textrm{norm}(x_k(:)-x_{opt}(:))/\textrm{norm}(x_{opt})\)

  • .psi_error - relative error \((\psi_k-\psi_{opt})/(\psi_0-\psi_{opt}))\)

  • .Status - reason of termination

LevMar(mapp, lin_sym_solver, x0, options)

LevMar is a Levenberg-Marquardt trust-region algorithm for solving systems of nonlinear equations \(h(x) = 0\), x in \(R^m\) using the nonlinear unconstrained minimization \(\textrm{min}\ \psi(x) = 1/2 ||h(x)||^2\) s.t. x in \(R^m\).

USAGE:

[x_best, psi_best, out] = LevMar(mapp, lin_sym_solver, x0, options)

INPUTS:

mapp: function handle provides h(x) and gradient h(x) lin_sym_solver: function handle for solving the linear system x0: initial point options: structure including the parameteres of scheme

  • .eta - parameter of the scheme

  • .MaxNumIter - maximum number of iterations

  • .MaxNumMapEval - maximum number of function evaluations

  • .MaxNumGmapEval - maximum number of subgradient evaluations

  • .TimeLimit - maximum running time

  • .epsilon - accuracy parameter

  • .x_opt - optimizer

  • .psi_opt - optimum

  • .adaptive - update lambda adaptively

  • .flag_x_error - 1: saves \(x_{error}\), 0: do not saves \(x_{error}\) (default)

  • .flag_psi_error - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .flag_time - 1: saves \(\psi_{error}\), 0: do not saves \(\psi_{error}\) (default)

  • .Stopping_Crit - stopping criterion

    1. stop if \(||grad|| \leq \epsilon\)

    2. stop if \(||nhxk|| \leq \epsilon\)

    3. stop if MaxNumIter is reached

    4. stop if MaxNumMapEval is reached

    5. stop if MaxNumGmapEval is reached

    6. stop if TimeLimit is reached

    7. stop if \(||grad|| \leq \textrm{max}(\epsilon, \epsilon^2 * ngradx0)\)

    8. stop if \(||nhxk|| \leq \textrm{max}(\epsilon, \epsilon^2 * nhx0)\)

    9. stop if (default) \(||hxk|| \leq \epsilon\) or MaxNumIter is reached

OUTPUT:

x_best: the best approximation of the optimizer psi_best: the best approximation of the optimum out: structure including more output information

  • .T - running time

  • .Niter - total number of iterations

  • .Nmap - total number of mapping evaluations

  • .Ngmap - total number of mapping gradient evaluations

  • .merit_func - array including all merit function values

  • .x_error - relative error \(\textrm{norm}(x_k(:)-x_{opt}(:))/\textrm{norm}(x_{opt})\)

  • .psi_error - relative error \((\psi_k-\psi_{opt})/(\psi_0-\psi_{opt}))\)

  • .Status - reason of termination

Rate_function1(opt, varargin)

USAGE:

[fxk, gfxk] = Rate_function1(opt, varargin)

INPUTS:

xk: current point; opt: structure includes required parameters;

  • .FR - concatenation of forward and reverse stoichiometric matrix

  • .A - Reduced forward stoichiometric matrix

  • .B - Reduced reverse stoichiometric matrix

  • .k - initial kinetic

OUTPUTS:

hxk: the vector h(xk) ghxk: gradient of h at xk

StopCriterion(grad, nhxk, Niter, Nmap, Ngmap, MaxNumIter, MaxNumMapEval, MaxNumGmapEval, T, TimeLimit, epsilon, nhx0, ngradx0, Stopping_Crit)

StopCriterion is a function checking that one of the stopping criteria holds to terminate LLM and GLM. It perepare the status determining why the algorithm is stopped.

USAGE:

[StopFlag, Status] = StopCriterion(grad, nhxk, Niter, Nmap, Ngmap, MaxNumIter, MaxNumMapEval, MaxNumGmapEval, T, TimeLimit, epsilon, nhx0, ngradx0, Stopping_Crit)

INPUTS:

grad: gradient of the merit funcrion nhxk: the norm 2 of h(xk) MaxNumIter: maximum number of iterations MaxNumMapEval: maximum number of function evaluations MaxNumGmapEval: maximum number of subgradient evaluations TimeLimit: maximum running time epsilon: accuracy parameter Stopping_Crit: stopping criterion

  1. stop if \(||grad|| \leq \epsilon\)

  2. stop if \(||nhxk|| \leq \epsilon\)

  3. stop if MaxNumIter is reached

  4. stop if MaxNumMapEval is reached

  5. stop if MaxNumGmapEval is reached

  6. stop if TimeLimit is reached

  7. stop if \(||grad|| \leq \textrm{max}(\epsilon, \epsilon^2 * ngradx0)\)

  8. stop if \(||nhxk|| \leq \textrm{max}(\epsilon, \epsilon^2 * nhx0)\)

  9. stop if (default) \(||hxk|| \leq \epsilon\) or MaxNumIter is reached

OUTPUTS:

StopFlag: 1: if one of the stopping criteria holds, 0: if none of the stopping criteria holds Status: the reason of the scheme termination

lin_sym_solver_mldivide(Hk, grad)

Solves the linear system \(Hkdk = -grad\).

USAGE:

dk = lin_sym_solver_mldivide(Hk, grad)

INPUTS:

ghxk: gradient of h at xk grad: gradient of the merit function at xk muk: the parameter muk

OUTPUT:

dk: the solution of the linear system