GithubHelp home page GithubHelp logo

jacobwilliams / nlesolver-fortran Goto Github PK

View Code? Open in Web Editor NEW
35.0 5.0 3.0 1.11 MB

Nonlinear Equation Solver with Modern Fortran

License: BSD 3-Clause "New" or "Revised" License

Fortran 100.00%
nonlinear-equation-solver fortran broyden-method newton-raphson nonlinear-equations fortran-package-manager lsqr lusol lsmr quasi-newton

nlesolver-fortran's Introduction

nlesolver-fortran

Nonlinear Equation Solver with Modern Fortran.

A basic Newton-Raphson type nonlinear equation solver for dense systems with m functions of n input variables.

A work in progress.

Status

Language CI Status GitHub release codecov last-commit

Features

  • Is object-oriented.
  • Works with square, under-determined, or over-determined systems.
  • Can use different methods to solve the linear system:
    1. LAPACK routines (dgesv or dgels) for dense systems: If n=m, uses dgesv (LU decomposition). If n/=m, uses dgels (if m>n uses QR factorization, if m<n uses LQ factorization).
    2. lsqr -- a conjugate-gradient type method for solving sparse linear equations and sparse least-squares problems.
    3. lusol -- A sparse LU factorization for square and rectangular matrices, with Bartels-Golub-Reid updates for column replacement and other rank-1 modifications.
    4. lsmr -- a conjugate-gradient type method for solving sparse linear equations and sparse least-squares problems
    5. The user can also provide a custom linear solver.
  • Has a Broyden update option (sparse and dense versions).
  • Has various line search options.
    • use a specified constant step size (0,1]
    • backtracking linesearch method
    • exact linesearch method using fmin minimizer
    • evaluate function at specified fixed points

Compiling

  • A Fortran Package Manager file is also included, so that the library and tests cases can be compiled with FPM. For example:
fpm build --profile release
fpm test --profile release

By default, the library is built with double precision (real64) real values. Explicitly specifying the real kind can be done using the following preprocessor flags:

Preprocessor flag Kind Number of bytes
REAL32 real(kind=real32) 4
REAL64 real(kind=real64) 8
REAL128 real(kind=real128) 16

For example, to build a single precision version of the library, use:

fpm build --profile release --flag "-DREAL32"

To use nlesolver within your fpm project, add the following to your fpm.toml file:

[dependencies]
nlesolver-fortran = { git="https://github.com/jacobwilliams/nlesolver-fortran.git" }

Or to use a specific version:

[dependencies]
nlesolver-fortran = { git="https://github.com/jacobwilliams/nlesolver-fortran.git", tag="1.1.0" }

Note that LAPACK is required to build. The fmin, lsqr, lusol, and lsmr libraries are also dependencies (which will be automatically downloaded by fpm).

Documentation

  • The API documentation for the current master branch can be found here. This is generated by processing the source files with FORD.

License

  • The NLESolver-Fortran source code and related files and documentation are distributed under a permissive free software license (BSD-3).

References

See also

  • MINPACK -- Modernized Minpack: for solving nonlinear equations and nonlinear least squares problems
  • LUSOL Stanford University Systems Optimization Laboratory
  • qr_mumps -- a software package for the solution of sparse, linear systems on multicore computers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.