Examples for cobyla (Maxima 5.46.0 Manual)

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

### 43.3 Examples for cobyla

x1*x2を1-x1^2-x2^2 >= 0の条件で最小化します。 理論的解は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]

追加の例はshare/cobyla/exディレクトリにあります。

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