{"id":47910118,"url":"https://github.com/bertcarnell/nleqslv","last_synced_at":"2026-04-04T05:15:31.601Z","repository":{"id":342434235,"uuid":"1173108802","full_name":"bertcarnell/nleqslv","owner":"bertcarnell","description":"Solve a system of nonlinear equations using a Broyden or a Newton method with a choice of global strategies such as line search and trust region.","archived":false,"fork":false,"pushed_at":"2026-03-28T03:30:14.000Z","size":1703,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-28T07:58:14.986Z","etag":null,"topics":["equation-solver","non-linear-equation","r-package"],"latest_commit_sha":null,"homepage":"https://bertcarnell.github.io/nleqslv/","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bertcarnell.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-05T02:40:13.000Z","updated_at":"2026-03-28T03:30:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bertcarnell/nleqslv","commit_stats":null,"previous_names":["bertcarnell/nleqslv"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bertcarnell/nleqslv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertcarnell%2Fnleqslv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertcarnell%2Fnleqslv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertcarnell%2Fnleqslv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertcarnell%2Fnleqslv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertcarnell","download_url":"https://codeload.github.com/bertcarnell/nleqslv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertcarnell%2Fnleqslv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31388399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["equation-solver","non-linear-equation","r-package"],"created_at":"2026-04-04T05:15:30.980Z","updated_at":"2026-04-04T05:15:31.592Z","avatar_url":"https://github.com/bertcarnell.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\u003cimg align=\"left\" width=\"200\" height=\"200\" src=\"logo.svg\"/\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n|                                                                                \u003csub\u003eActions\u003c/sub\u003e                                                                                |                                                       \u003csub\u003eCode Coverage\u003c/sub\u003e                                                       |                                          \u003csub\u003eWebsite\u003c/sub\u003e                                          |                                  \u003csub\u003eCRAN Downloads\u003c/sub\u003e                                   |                                              \u003csub\u003eCRAN\u003c/sub\u003e                                               |\n|:-------------:|:-------------:|:-------------:|:-------------:|:-------------:|\n| [![R-CMD-check](https://github.com/bertcarnell/nleqslv/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/bertcarnell/nleqslv/actions/workflows/R-CMD-check.yaml) | [![Codecov test coverage](https://codecov.io/gh/bertcarnell/nleqslv/graph/badge.svg)](https://app.codecov.io/gh/bertcarnell/nleqslv) | [![](https://img.shields.io/badge/pkgdown-nleqslv-blue.svg)](https://bertcarnell.github.io/nleqslv/) | [![](https://cranlogs.r-pkg.org/badges/nleqslv)](https://cran.r-project.org/package=nleqslv) | [![CRAN status](https://www.r-pkg.org/badges/version/nleqslv)](https://cran.r-project.org/package=nleqslv) |\n\n# nleqslv\n\nSolve a system of nonlinear equations using a Broyden or a Newton method\nwith a choice of global strategies such as line search and trust region.\nThere are options for using a numerical or user supplied Jacobian, for\nspecifying a banded numerical Jacobian and for allowing a singular or\nill-conditioned Jacobian.\n\nOriginal Author: Berend Hasselman\n\n## Installation\n\nYou can install the released version of `nleqslv` from\n[CRAN](https://CRAN.R-project.org) with:\n\n``` r\ninstall.packages(\"nleqslv\")\n```\n\nYou can also install the development version of `lhs` from github with:\n\n``` r\nif (!require(devtools)) install.packages(\"devtools\")\ndevtools::install_github(\"bertcarnell/nleqslv\")\n```\n\n## Quick Start\n\nStart with a function to find solutions for: High-degree polynomial\nsystem from Kearfott (1987).\n\n``` r\nrequire(nleqslv)\n```\n\n    ## Loading required package: nleqslv\n\n``` r\nhdp \u003c- function(x) {\n  stopifnot(length(x) == 3)\n  f \u003c- numeric(3)\n  f[1] \u003c- 5 * x[1]^9 - 6 * x[1]^5 * x[2]^2 + x[1] * x[2]^4 + 2 * x[1] * x[3]\n  f[2] \u003c- -2 * x[1]^6 * x[2] + 2 * x[1]^2 * x[2]^3 + 2 * x[2] * x[3]\n  f[3] \u003c- x[1]^2 + x[2]^2 - 0.265625\n  f\n}\n\nsln \u003c- nleqslv(c(0.2, 0.3, 0.7), hdp, control=list(trace=1))\n```\n\n    ##   Algorithm parameters\n    ##   --------------------\n    ##   Method: Broyden  Global strategy: double dogleg (initial trust region = -2)\n    ##   Maximum stepsize = 1.79769e+308\n    ##   Scaling: fixed\n    ##   ftol = 1e-08 xtol = 1e-08 btol = 0.001 cndtol = 1e-12\n    ## \n    ##   Iteration report\n    ##   ----------------\n    ##   Iter         Jac     Lambda      Eta     Dlt0     Dltn         Fnorm   Largest |f|\n    ##      0                                                    1.378974e-01  4.221216e-01\n    ##      1  N(1.2e-01) N            0.7206   1.0941   1.0941  7.861105e-02  3.280423e-01\n    ##      2  B(1.6e-01) N            0.8846   0.4073   0.8147  9.816774e-04  3.712402e-02\n    ##      3  B(1.5e-01) N            0.9568   0.0325   0.0649  5.648068e-05  8.954167e-03\n    ##      4  B(1.4e-01) N            0.7584   0.0185   0.0185  3.258227e-05  6.104201e-03\n    ##      5  B(1.6e-01) N            0.8301   0.0082   0.0164  2.478058e-07  5.429045e-04\n    ##      6  B(1.6e-01) N            0.9604   0.0005   0.0005  2.518127e-07  5.875496e-04\n    ##      7  N(4.3e-02) N            0.2754   0.0090   0.0179  3.356158e-09  8.006713e-05\n    ##      8  B(4.5e-02) N            0.9894   0.0001   0.0002  4.425283e-13  6.020421e-07\n    ##      9  B(4.8e-02) N            0.5297   0.0000   0.0000  1.824856e-15  4.427695e-08\n    ##     10  B(4.6e-02) N            0.6679   0.0000   0.0000  1.380907e-19  3.970110e-10\n\n``` r\nsln$x\n```\n\n    ## [1]  0.27985470  0.43278904 -0.01418919\n\nEvaluate solutions from the same starting location using multiple\nmethods and global strategies.\n\n``` r\ntestnslv(c(0.2, 0.3, 0.7), hdp)\n```\n\n    ## Call:\n    ## testnslv(x = c(0.2, 0.3, 0.7), fn = hdp)\n    ## \n    ## Results:\n    ##     Method Global termcd Fcnt Jcnt Iter Message     Fnorm\n    ## 1   Newton  cline      1    5    5    5   Fcrit 1.431e-21\n    ## 2   Newton  qline      1    5    5    5   Fcrit 1.431e-21\n    ## 3   Newton  gline      1    5    5    5   Fcrit 1.431e-21\n    ## 4   Newton pwldog      1    5    5    5   Fcrit 1.431e-21\n    ## 5   Newton dbldog      1    5    5    5   Fcrit 1.431e-21\n    ## 6   Newton   hook      1    5    5    5   Fcrit 1.431e-21\n    ## 7   Newton   none      1    5    5    5   Fcrit 1.431e-21\n    ## 8  Broyden  cline      1   10    2   10   Fcrit 1.381e-19\n    ## 9  Broyden  qline      1   10    2   10   Fcrit 1.381e-19\n    ## 10 Broyden  gline      1   10    2   10   Fcrit 1.381e-19\n    ## 11 Broyden pwldog      1   10    2   10   Fcrit 1.381e-19\n    ## 12 Broyden dbldog      1   10    2   10   Fcrit 1.381e-19\n    ## 13 Broyden   hook      1   10    2   10   Fcrit 1.381e-19\n    ## 14 Broyden   none      1   17    1   17   Fcrit 9.498e-18\n\nSearch for multiple solutions from a variety of starting locations.\n\n``` r\nset.seed(1245323)\n\nN \u003c- 40\nxstart \u003c- matrix(runif(3*N, min = -1, max = 1), nrow = N, ncol = 3)\nans \u003c- searchZeros(xstart, hdp, method = \"Broyden\", global = \"dbldog\")\nans$x\n```\n\n    ##                [,1]          [,2]          [,3]\n    ##  [1,] -5.153882e-01  1.156243e-08 -1.244560e-02\n    ##  [2,] -4.669800e-01 -2.180704e-01 -2.257786e-09\n    ##  [3,] -4.669800e-01  2.180704e-01 -8.809291e-11\n    ##  [4,] -2.798547e-01 -4.327890e-01 -1.418919e-02\n    ##  [5,] -2.798547e-01  4.327890e-01 -1.418919e-02\n    ##  [6,]  3.744009e-08 -5.153882e-01 -6.610876e-11\n    ##  [7,]  5.553708e-09  5.153882e-01 -6.161770e-11\n    ##  [8,]  2.798547e-01 -4.327891e-01 -1.418919e-02\n    ##  [9,]  2.798547e-01  4.327890e-01 -1.418919e-02\n    ## [10,]  4.669800e-01 -2.180703e-01  1.659893e-10\n    ## [11,]  4.669800e-01  2.180703e-01 -4.756912e-10\n    ## [12,]  5.153882e-01 -6.330974e-09 -1.244560e-02\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertcarnell%2Fnleqslv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertcarnell%2Fnleqslv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertcarnell%2Fnleqslv/lists"}