https://github.com/juliasmoothoptimizers/percival.jl
Implementation of an Augmented Lagrangian method
https://github.com/juliasmoothoptimizers/percival.jl
Last synced: about 1 year ago
JSON representation
Implementation of an Augmented Lagrangian method
- Host: GitHub
- URL: https://github.com/juliasmoothoptimizers/percival.jl
- Owner: JuliaSmoothOptimizers
- License: other
- Created: 2019-03-09T20:24:31.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2025-06-04T01:40:44.000Z (about 1 year ago)
- Last Synced: 2025-06-04T05:11:47.916Z (about 1 year ago)
- Language: Julia
- Homepage:
- Size: 3.02 MB
- Stars: 58
- Watchers: 8
- Forks: 17
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Citation: CITATION.cff
- Zenodo: .zenodo.json
Awesome Lists containing this project
README
# Percival.jl - An augmented Lagrangian solver
[](https://github.com/JuliaSmoothOptimizers/Percival.jl/actions)
[](https://codecov.io/github/JuliaSmoothOptimizers/Percival.jl?branch=main)
[](https://JuliaSmoothOptimizers.github.io/Percival.jl/stable)
[](https://JuliaSmoothOptimizers.github.io/Percival.jl/dev)
[](https://doi.org/10.5281/zenodo.3969045)
Percival is an implementation of the augmented Lagrangian solver described in
S. Arreckx, A. Lambe, Martins, J. R. R. A., & Orban, D. (2016).
A Matrix-Free Augmented Lagrangian Algorithm with Application to Large-Scale Structural Design Optimization.
Optimization And Engineering, 17, 359–384. doi:10.1007/s11081-015-9287-9
with internal solver `tron` from [JSOSolvers.jl](https://github.com/JuliaSmoothOptimizers/JSOSolvers.jl).
To use Percival, you have to pass it an [NLPModel](https://github.com/JuliaSmoothOptimizers/NLPModels.jl).
## How to Cite
If you use Percival.jl in your work, please cite using the format given in [CITATION.cff](https://github.com/JuliaSmoothOptimizers/Percival.jl/blob/main/CITATION.cff).
## Install
Use `]` to enter `pkg>` mode of Julia, then
```julia
pkg> add Percival
```
## Examples
Consider the following 2-dimensional optimization problem with an equality constraint
```math
\begin{equation}
\min_{(x_1,x_2)} \quad (x_1 - 1)^2 + 100 (x_2 - x_1^2)^2 \quad \text{s.to} \quad x_1^2 + x_2^2 = 1.
\end{equation}
```
You can solve an JuMP model `model` by using [NLPModelsJuMP.jl](https://github.com/JuliaSmoothOptimizers/NLPModelsJuMP.jl) to convert it.
```julia
using JuMP, NLPModelsJuMP, Percival
model = Model(NLPModelsJuMP.Optimizer)
set_attribute(model, "solver", Percival.PercivalSolver)
@variable(model, x[i=1:2], start = [-1.2; 1.0][i])
@objective(model, Min, (x[1] - 1)^2 + 100 * (x[2] - x[1]^2)^2)
@constraint(model, x[1]^2 + x[2]^2 == 1)
optimize!(model)
solution_summary(model)
```
`percival` accept as input any instance of `AbstractNLPModel`, for instance, using automatic differentiation via [ADNLPModels.jl](https://github.com/JuliaSmoothOptimizers/ADNLPModels.jl) to solve the same problem.
```julia
using ADNLPModels, Percival
nlp = ADNLPModel(
x -> (x[1] - 1)^2 + 100 * (x[2] - x[1]^2)^2,
[-1.2; 1.0],
x -> [x[1]^2 + x[2]^2],
[1.0],
[1.0],
)
output = percival(nlp, verbose = 1)
```
# Bug reports and discussions
If you think you found a bug, feel free to open an [issue](https://github.com/JuliaSmoothOptimizers/Percival.jl/issues).
Focused suggestions and requests can also be opened as issues. Before opening a pull request, start an issue or a discussion on the topic, please.
If you want to ask a question not suited for a bug report, feel free to start a discussion [here](https://github.com/JuliaSmoothOptimizers/Organization/discussions). This forum is for general discussion about this repository and the [JuliaSmoothOptimizers](https://github.com/JuliaSmoothOptimizers), so questions about any of our packages are welcome.