Enlsip.jl

Enlsip.jl: A Julia optimization package to solve constrained nonlinear least-squares problems - Published in JOSS (2024)

https://github.com/uncertainlab/enlsip.jl

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.4%) to scientific vocabulary

Scientific Fields

Engineering Computer Science - 60% confidence
Last synced: 6 months ago · JSON representation ·

Repository

Enlsip.jl is the Julia version of a Fortran77 optimization library designed to solve nonlinear least squares problems under general nonlinear constraints.

Basic Info
  • Host: GitHub
  • Owner: UncertainLab
  • License: mit
  • Language: Julia
  • Default Branch: main
  • Size: 395 KB
Statistics
  • Stars: 8
  • Watchers: 1
  • Forks: 2
  • Open Issues: 1
  • Releases: 3
Created over 2 years ago · Last pushed 11 months ago
Metadata Files
Readme License Citation

README.md

Enlsip.jl

DOI DOI

Package Enlsip.jl is the Julia version of ENLSIP, an open source algorithm originally written in Fortran77 and designed to solve nonlinear least-squares problems subject to nonlinear constraints. The optimization method implemented in ENLSIP is described in

Per Lindström and Per-Åke Wedin, Gauss Newton based algorithms for constrained nonlinear least squares problems. Technical Report S-901 87, Institute of Information processing, University of Umeå, Sweden, 1988.

The source code of the Fortran77 library is available at https://plato.asu.edu/sub/nonlsq.html.

Problems that can be solved using Enlsip.jl are modeled as follows:

math \begin{aligned} \min_{x \in \mathbb{R}^n} \quad & \dfrac{1}{2} \|r(x)\|^2 \\ \text{s.t.} \quad & c_i(x) = 0, \quad i \in \mathcal{E} \\ & c_i(x) \geq 0, \quad i \in \mathcal{I}, \\ & l_i \leq x_i \leq u_i, \quad i \in \{1,\ldots,n\}, \end{aligned}

where:

  • the residuals $ri:\mathbb{R}^n\rightarrow\mathbb{R}$ and the constraints $ci:\mathbb{R}^n\rightarrow\mathbb{R}$ are assumed to be $\mathcal{C}^2$ functions;
  • norm $||\cdot||$ denotes the Euclidean norm;
  • $l$ and $u$ are respectively vectors of lower and upper bounds.

In the formulation above, bound constraints are written seperately but they are treated as classical inequality constraints in the method implemented in ENLSIP.

How to install

To add Enlsip, use Julia's package manager by typing the following command inside the REPL:

julia using Pkg Pkg.add("Enlsip")

How to Use

Solving a problem with Enlsip is organized in two steps.

First, you need to create a model of your problem with the CnlsModel structure.

Creating a model

An object of type CnlsModel can be created using a constructor, whose arguments are the following:

  • residuals : function that computes the vector of residuals

  • nb_parameters : number of variables

  • nb_residuals : number of residuals

  • stating_point : initial solution

  • jacobian_residuals : function that computes the jacobian matrix of the residuals. If not passed as argument, it is computed numericcaly by forward differences

  • eq_constraints : function that computes the vector of equality constraints

  • jacobian_eqcons : function that computes the jacobian matrix of the equality constraints. If not passed as argument, it is computed numericcaly by forward differences

  • nb_eqcons : number of equality constraints

  • ineq_constraints : function that computes the vector of inequality constraints

  • jacobian_ineqcons : function that computes the jacobian matrix of the inequality constraints. If not passed as argument, it is computed numericcaly by forward differences

  • nb_ineqcons : number of inequality constraints

  • x_low and x_upp : respectively vectors of lower and upper bounds

Solving a model

Then, once your model is instantiated, you can call the solve! function to solve your problem.

Example with problem 65 from Hock Schittkowski collection[^HS80]

```julia

Import Enlsip

using Enlsip

Dimensions of the problem

n = 3 # number of parameters m = 3 # number of residuals

Residuals and jacobian matrix associated

r(x::Vector) = [x[1] - x[2]; (x[1]+x[2]-10.0) / 3.0; x[3]-5.0]

jac_r(x::Vector) = [1. -1. 0; 1/3 1/3 0.; 0. 0. 1.]

Constraints (one nonlinear inequality and box constraints)

c(x::Vector) = [48.0 - x[1]^2-x[2]^2-x[3]^2] jacc(x::Vector) = [ -2x[1] -2x[2] -2x[3]] xl = [-4.5, -4.5, -5.0] x_u = [4.5, 4.5, 5.0]

Starting point

x0 = [-5.0, 5.0, 0.0]

Instantiate a model associated with the problem

hs65model = Enlsip.CnlsModel(r, n, m ;jacobianresiduals=jacr, startingpoint=x0, ineqconstraints = c, jacobianineqcons=jacc, nbineqcons = 1, xlow=xl, xupp=xu)

Call of the solve! function

Enlsip.solve!(hs65_model)

Print solution and objective value

println("Algorithm termination status: ", Enlsip.status(hs65model)) println("Optimal solution: ", Enlsip.solution(hs65model)) println("Optimal objective value: ", Enlsip.sumsqresiduals(hs65_model)) ```

[^HS80]: W. Hock and K. Schittkowski. Test Examples for Nonlinear Programming Codes, volume 187 of Lecture Notes in Economics and Mathematical Systems. Springer, second edition, 1980.

Owner

  • Name: UncertainLab
  • Login: UncertainLab
  • Kind: organization

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Borie
  given-names: Pierre
  orcid: "https://orcid.org/0009-0000-1043-5057"
- family-names: Marcotte
  given-names: Alain
  orcid: "https://orcid.org/0009-0009-5964-8892"
- family-names: Bastin
  given-names: Fabian
  orcid: "https://orcid.org/0000-0003-1323-6787"
- family-names: Dellacherie
  given-names: Stéphane
  orcid: "https://orcid.org/0009-0005-9043-9328"
doi: 10.5281/zenodo.11206280
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Borie
    given-names: Pierre
    orcid: "https://orcid.org/0009-0000-1043-5057"
  - family-names: Marcotte
    given-names: Alain
    orcid: "https://orcid.org/0009-0009-5964-8892"
  - family-names: Bastin
    given-names: Fabian
    orcid: "https://orcid.org/0000-0003-1323-6787"
  - family-names: Dellacherie
    given-names: Stéphane
    orcid: "https://orcid.org/0009-0005-9043-9328"
  date-published: 2024-05-22
  doi: 10.21105/joss.06226
  issn: 2475-9066
  issue: 97
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 6226
  title: "Enlsip.jl: A Julia optimization package to solve constrained
    nonlinear least-squares problems"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.06226"
  volume: 9
title: "Enlsip.jl: A Julia optimization package to solve constrained
  nonlinear least-squares problems"

GitHub Events

Total
  • Watch event: 2
  • Create event: 1
Last Year
  • Watch event: 2
  • Create event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 70
  • Total Committers: 2
  • Avg Commits per committer: 35.0
  • Development Distribution Score (DDS): 0.014
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Pierre Borie p****8@g****m 69
Tangi Migot t****t@g****m 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 8
  • Total pull requests: 5
  • Average time to close issues: about 1 month
  • Average time to close pull requests: about 5 hours
  • Total issue authors: 4
  • Total pull request authors: 4
  • Average comments per issue: 4.0
  • Average comments per pull request: 0.2
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • tmigot (5)
  • JuliaTagBot (1)
  • odunbar (1)
  • pierre-borie (1)
Pull Request Authors
  • pierre-borie (3)
  • tmigot (2)
  • jbytecode (2)
  • xuanxu (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • julia 1 total
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 9
juliahub.com: Enlsip

Enlsip.jl is the Julia version of a Fortran77 optimization library designed to solve nonlinear least squares problems under general nonlinear constraints.

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1 Total
Rankings
Dependent repos count: 10.2%
Dependent packages count: 37.6%
Average: 42.0%
Forks count: 54.2%
Stargazers count: 66.0%
Last synced: 6 months ago