fsolve Subroutine

public subroutine fsolve(obj, n, x, fVec, tol, info)

Seeks a zero of N non-linear equations in N variables

Finds a zero of a system of N non-linear functions in N variables by a modification of the Powell hybrid method. This is done by using the more general non-linear equation solver HYBRD. The user provides a subroutine which calculates the functions.
The jacobian is calculated by a forward-difference approximation.

Arguments

Type IntentOptional Attributes Name
class(fSolve_t), intent(in) :: obj

External object with the user-supplied subroutine which calculates the functions.

integer, intent(in) :: n

Number of functions and variables

real(kind=dp), intent(inout) :: x(n)

Initial estimate of the solution vector / the estimate of the solution vector

real(kind=dp), intent(out) :: fVec(n)

The functions evaluated at the output X

real(kind=dp), intent(in) :: tol

Satisfactory termination occurs when the algorithm estimates that the relative error between X and the solution is at most TOL. TOL should be non-negative.

integer, intent(out) :: info

Status flag

  1. Improper input parameters.
  2. Algorithm estimates that the relative error between X and the solution is at most TOL.
  3. Number of calls to FCN has reached or exceeded 200*(N+1).
  4. TOL is too small. No further improvement in the approximate solution X is possible.
  5. Iteration is not making good progress, as measured by the improvement from the last five jacobian evaluations.
  6. Iteration is not making good progress, as measured by the improvement from the last ten iterations.

Calls

proc~~fsolve~~CallsGraph proc~fsolve fsolve proc~hybrd hybrd proc~fsolve->proc~hybrd fcn fcn proc~hybrd->fcn proc~dogleg dogleg proc~hybrd->proc~dogleg proc~enorm eNorm proc~hybrd->proc~enorm proc~fdjac1 fdJac1 proc~hybrd->proc~fdjac1 proc~qform qform proc~hybrd->proc~qform proc~qrfac qrFac proc~hybrd->proc~qrfac proc~r1mpyq r1mpyq proc~hybrd->proc~r1mpyq proc~r1updt r1updt proc~hybrd->proc~r1updt proc~dogleg->proc~enorm proc~fdjac1->fcn proc~qrfac->proc~enorm

Called by

proc~~fsolve~~CalledByGraph proc~fsolve fsolve proc~solve_junction solve_junction proc~solve_junction->proc~fsolve proc~junction_resolution_from_and_to_ports Junction_resolution_from_and_to_ports proc~junction_resolution_from_and_to_ports->proc~solve_junction proc~main_loop main_loop proc~main_loop->proc~junction_resolution_from_and_to_ports program~reims_p reims_p program~reims_p->proc~main_loop