[petsc-users] Does PETSc have these solvers bounded-constrained optimization problems?
Justin Chang
jychang48 at gmail.com
Wed Jun 15 19:03:50 CDT 2016
Attached is my petsc4py/firedrake code which has the implementation I
described.
As of right now, my current implementation with ASILS/ASFLS solvers work
(although they are much slower compared to TRON) but the SSILS/SSFLS
solvers don't even converge.
For example, if I run the code as:
> python NR_Nonlinear_poisson.py 50 50 2 -opt_tao_type asils
-opt_tao_monitor -opt_tao_max_it 10 -opt_tao_view
iter = 0, Function value: 10.268, Residual: 30.1512
iter = 1, Function value: 2.26616, Residual: 3.28276
iter = 2, Function value: 0.442395, Residual: 0.409106
iter = 3, Function value: 0.0180227, Residual: 0.0305439
iter = 4, Function value: 0.00381325, Residual: 0.0134287
iter = 5, Function value: 0.00191598, Residual: 0.00599256
iter = 6, Function value: 0.00114725, Residual: 0.00383069
iter = 7, Function value: 0.000888807, Residual: 0.0032619
iter = 8, Function value: 0.000434005, Residual: 0.00148022
iter = 9, Function value: 0.000179781, Residual: 0.000565633
iter = 10, Function value: 7.54948e-05, Residual: 0.000242123
iter = 11, Function value: 3.14898e-05, Residual: 0.000112043
Tao Object:(opt_) 1 MPI processes
type: asils
TaoLineSearch Object: (opt_) 1 MPI processes
type: armijo
KSP Object: (opt_) 1 MPI processes
type: gmres
total KSP iterations: 511
Active Set subset type: subvec
convergence tolerances: gatol=1e-16, steptol=0., gttol=0.
Residual in Function/Gradient:=0.000112043
convergence tolerances: function minimum=1e-08
Objective value=3.14898e-05
total number of iterations=11, (max: 10)
total number of constraint function evaluations=23
total number of Jacobian evaluations=12
Solver terminated: -2 Maximum Iterations
The above indicates that the solver converges. However if I run the same
code but with this:
> python NR_Nonlinear_poisson.py 50 50 2 -opt_tao_type ssils
-opt_tao_monitor -opt_tao_max_it 10 -opt_tao_view
iter = 0, Function value: 10.268, Residual: 30.1512
iter = 1, Function value: 10.268, Residual: 30.1512
iter = 2, Function value: 10.268, Residual: 30.1512
iter = 3, Function value: 10.268, Residual: 30.1512
iter = 4, Function value: 10.268, Residual: 30.1512
iter = 5, Function value: 10.268, Residual: 30.1512
iter = 6, Function value: 10.268, Residual: 30.1512
iter = 7, Function value: 10.268, Residual: 30.1512
iter = 8, Function value: 10.268, Residual: 30.1512
iter = 9, Function value: 10.268, Residual: 30.1512
iter = 10, Function value: 10.268, Residual: 30.1512
iter = 11, Function value: 10.268, Residual: 30.1512
Tao Object:(opt_) 1 MPI processes
type: ssils
TaoLineSearch Object: (opt_) 1 MPI processes
type: armijo
KSP Object: (opt_) 1 MPI processes
type: gmres
total KSP iterations: 451
Active Set subset type: subvec
convergence tolerances: gatol=1e-16, steptol=0., gttol=0.
Residual in Function/Gradient:=30.1512
convergence tolerances: function minimum=1e-08
Objective value=10.268
total number of iterations=11, (max: 10)
total number of constraint function evaluations=331
total number of Jacobian evaluations=1
Solver terminated: -2 Maximum Iterations
Clearly something is wrong. Any insight as to why?
Thanks,
Justin
On Tue, Jun 14, 2016 at 6:29 AM, Jed Brown <jed at jedbrown.org> wrote:
> Barry Smith <bsmith at mcs.anl.gov> writes:
> > In Tao it is solving it as an optimization problem while
> > SNESVINEWTONSSLS solves it as a "nonlinear equation" with
> > constraints; I think the answer should be the same.
>
> The latter may have more solutions.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160615/96d084c3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NR_Nonlinear_poisson.py
Type: text/x-python
Size: 5256 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160615/96d084c3/attachment.py>
More information about the petsc-users
mailing list