forked from IDAES/idaes-ext
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
John Eslick
committed
Dec 22, 2021
1 parent
76de6c5
commit c2a15b6
Showing
12 changed files
with
155 additions
and
660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
# README | ||
|
||
This is a first pass at creating an AMPL executable for the PETSc solver library, allowing PETSc to be used with Pyomo. This version supports the TS (time-stepping) and SNES (nonlinear) solvers; however in the future TAO (optimization) solvers and additional features may also be supported. | ||
This is a first pass at creating an AMPL executable for the PETSc solver library, | ||
allowing PETSc to be used with Pyomo via the AMPL Solver Library (ALS). This | ||
version supports the TS (time-stepping) and SNES (nonlinear) solvers; however in | ||
the future TAO (optimization) solvers and additional features may also be | ||
supported. | ||
|
||
## Usage | ||
|
||
The petsc executable solver will run like any other AMPL executable and can take the standard PETSc options. The options can be set from within Pyomo. For use with Pyomo it is easiest if the petsc executable is in your executable path. | ||
|
||
<TODO> Will fill out later, for now see examples and PETSc docs. PETSc command line options work with the PETSc solvers. The are some additional command line arguments (see ```petsc -help```). Command line arguments can be passed through Pyomo's solver interface. | ||
## Building | ||
|
||
## Testing | ||
The solver wrapper build uses the PETSc build system. On Linux, compile PETSc | ||
with the desired features (https://petsc.org/release/install/). The ASL can be | ||
obtained from http://www.netlib.org/ampl/solvers/. Before building the wrapper | ||
set the following environment variables: | ||
|
||
The included tl.nl file can be used to test the petsc solver. The problem is an old version of the IDAES MEA model, but that's not important. The initial values of variables in the file are the solution. To test the solver the initial values can be perturbed before solving the problem the new solution can be compared to the old initial values to ensure the problem solved. | ||
* ASL_INC - directory with ASL header files | ||
* ASL_LIB - ASL library file | ||
* PETSC_DIR - see PETSc docs | ||
* PETSC_ARCH - see PETSc docs | ||
|
||
To test the petsc executable run: | ||
|
||
petsc -s t1 -snes_monitor -perturb_test 1.1 | ||
## Usage | ||
|
||
This multiplies the initial values by 1.1 and resolves. The results shows any differences between the new and old solutions greater than 1e-6, and the values of those variables. Depending on the value of the variables, difference of more than 1e-6 are not necessarily bad. | ||
The SNES solvers can be used with Pyomo to solve sets of nonlinear equations | ||
as a standard AMPL solver. Tools to use the time stepping solver with Pyomo.DAE | ||
are under development as part of the IDAES project, and example can be found | ||
there (https://github.com/IDAES/idaes-pse/pull/552). |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.