[SciPy-user] examples in docs

Sebastian Haase haase at msg.ucsf.edu
Tue May 5 11:58:24 EDT 2009


On Tue, May 5, 2009 at 5:46 PM,  <josef.pktd at gmail.com> wrote:
> Rob Falck just pointed out a nice set of examples for fmin_slsqp at
> http://projects.scipy.org/scipy/attachment/ticket/570/slsqp_test.py.
>
> What's the best way to include them in the docs? the tutorial?
> Is there a way to include or link to examples that are too long for a docstring?
>
> Josef

very interesting  - thanks for the info.
Just in case someone else is interested, I pasted the output I got below
--
Sebastian Haase


Unbounded optimization. Derivatives approximated.
  NIT    FC           OBJFUN            GNORM
    1     4     7.000000E+00     8.485281E+00
    2     9    -2.000000E-01     1.697056E+00
    3    13    -1.928000E+00     3.394112E-01
    4    17    -2.000000E+00     6.664002E-08
Optimization terminated successfully.    (Exit mode 0)
            Current function value: -2.0
            Iterations: 4
            Function evaluations: 17
            Gradient evaluations: 4
Elapsed time: 0.897169113159 ms
Results [[1.9999999422580017, 0.99999995250254925],
-1.9999999999999969, 4, 0, 'Optimization terminated successfully.']



Unbounded optimization.  Derivatives provided.
  NIT    FC           OBJFUN            GNORM
    1     4     7.000000E+00     8.485281E+00
    2     9    -2.000000E-01     1.697056E+00
    3    13    -1.928000E+00     3.394112E-01
    4    17    -2.000000E+00     6.664002E-08
Optimization terminated successfully.    (Exit mode 0)
            Current function value: -2.0
            Iterations: 4
            Function evaluations: 17
            Gradient evaluations: 4
Elapsed time: 0.773191452026 ms
Results [[1.9999999422580017, 0.99999995250254925],
-1.9999999999999969, 4, 0, 'Optimization terminated successfully.']



Bound optimization.  Derivatives approximated.
  NIT    FC           OBJFUN            GNORM
    1     4     7.000000E+00     8.485281E+00
    2     8     8.881784E-16     2.000000E+00
    3    12    -9.722222E-01     2.603417E+00
    4    16    -1.000000E+00     2.828427E+00
Optimization terminated successfully.    (Exit mode 0)
            Current function value: -1.0
            Iterations: 4
            Function evaluations: 16
            Gradient evaluations: 4
Elapsed time: 0.833034515381 ms
Results [[1.0000000042219968, 1.0000000042219968],
-0.99999999999999956, 4, 0, 'Optimization terminated successfully.']



Bound optimization (equality constraints).  Derivatives provided.
  NIT    FC           OBJFUN            GNORM
    1     1     7.000000E+00     8.485281E+00
    2     2     8.881784E-16     2.000000E+00
    3     3    -9.722222E-01     2.603417E+00
    4     4    -1.000000E+00     2.828427E+00
Optimization terminated successfully.    (Exit mode 0)
            Current function value: -1.0
            Iterations: 4
            Function evaluations: 4
            Gradient evaluations: 4
Elapsed time: 0.710964202881 ms
Results [[0.99999999999999978, 0.99999999999999978], -1.0, 4, 0,
'Optimization terminated successfully.']



Bound optimization (equality and inequality constraints).  Derivatives provided.
  NIT    FC           OBJFUN            GNORM
    1     1     7.000000E+00     8.485281E+00
    2     2    -7.500000E-01     2.236068E+00
    3     3    -9.932445E-01     2.946957E+00
    4     4    -1.000000E+00     2.828427E+00
Optimization terminated successfully.    (Exit mode 0)
            Current function value: -1.0
            Iterations: 4
            Function evaluations: 4
            Gradient evaluations: 4
Elapsed time: 0.903844833374 ms
Results [[0.99999999999999978, 0.99999999999999978], -1.0, 4, 0,
'Optimization terminated successfully.']



Bound optimization (equality and inequality constraints).  Derivatives
provided via functions.
  NIT    FC           OBJFUN            GNORM
    1     1     7.000000E+00     8.485281E+00
    2     2     3.444444E+00     6.599663E+00
    3     5     1.636490E+00     5.614645E+00
    4     8     9.071530E-01     5.091175E+00
    5    10     4.618203E-01     4.748310E+00
    6    11    -1.269073E+00     2.418143E+00
    7    12    -1.034890E+00     2.778647E+00
    8    13    -1.000605E+00     2.827571E+00
    9    14    -1.000000E+00     2.828427E+00
Optimization terminated successfully.    (Exit mode 0)
            Current function value: -1.00000018313
            Iterations: 9
            Function evaluations: 14
            Gradient evaluations: 9
Elapsed time: 3.03888320923 ms
Results [[1.0000000915654403, 1.0], -1.0000001831308722, 9, 0,
'Optimization terminated successfully.']



Bound optimization (equality and inequality constraints).  Derivatives
provided via functions.  Constraint jacobians provided via functions
  NIT    FC           OBJFUN            GNORM
    1     1     7.000000E+00     8.485281E+00
    2     2     3.444444E+00     6.599663E+00
    3     5     1.636489E+00     5.614644E+00
    4     8     9.071728E-01     5.091190E+00
    5    10     4.618196E-01     4.748311E+00
    6    11    -1.269070E+00     2.418148E+00
    7    12    -1.034890E+00     2.778648E+00
    8    13    -1.000605E+00     2.827571E+00
    9    14    -1.000000E+00     2.828427E+00
Optimization terminated successfully.    (Exit mode 0)
            Current function value: -1.00000018311
            Iterations: 9
            Function evaluations: 14
            Gradient evaluations: 9
Elapsed time: 2.02298164368 ms
Results [[1.000000091552611, 1.0], -1.0000001831052137, 9, 0,
'Optimization terminated successfully.']



More information about the SciPy-User mailing list