Maxima 5.44.0 Manual: Examples for cobyla

Previous: Functions and Variables for cobyla, Up: cobyla-pkg [Contents][Index]

### 47.3 Examples for cobyla

Minimize x1*x2 with 1-x1^2-x2^2 >= 0. The theoretical solution is x1 = 1/sqrt(2), x2 = -1/sqrt(2).

    (%i1) load("fmin_cobyla")$

    (%i2) fmin_cobyla(x1*x2, [x1, x2], [1,1],
                      constraints = [x1^2+x2^2<=1], iprint=1);

       Normal return from subroutine COBYLA

       NFVALS =   66   F =-5.000000E-01    MAXCV = 1.999845E-12
       X = 7.071058E-01  -7.071077E-01
    (%o2) [[x1 = 0.70710584934848, x2 = - 0.7071077130248],
           - 0.49999999999926, [[-1.999955756559757e-12],[]], 66]

There are additional examples in the share/cobyla/ex directory.

Previous: Functions and Variables for cobyla, Up: cobyla-pkg [Contents][Index]