第13章 非線形計画法2
p.175 例2
$$\begin{aligned} z=&\sqrt{(x_1-1)^2+(x_2-12)^2}+\sqrt{(x_1-4)^2+(x_2-14)^2}+\sqrt{(x_1-15)^2+(x_2-10)^2}\\ &+\sqrt{(x_1-11)^2+(x_2-2)^2}+\sqrt{(x_1-5)^2+(x_2-5)^2} \end{aligned}$$
|
|
optim関数
|
|
res1;res2
$par
[1] 6.353805 8.163534
$value
[1] 32.87839
$counts
function gradient
85 NA
$convergence
[1] 0
$message
NULL
$par
[1] 6.353591 8.162658
$value
[1] 32.87839
$counts
function gradient
11 8
$convergence
[1] 0
$message
NULL
nlm関数
|
|
$minimum
[1] 32.87839
$estimate
[1] 6.353552 8.162883
$gradient
[1] 2.270229e-07 1.321352e-06
$code
[1] 1
$iterations
[1] 8
BBパッケージ
|
|
$par
[1] 6.353546 8.162880
$value
[1] 32.87839
$gradient
[1] 4.689582e-06
$fn.reduction
[1] 27.69725
$iter
[1] 8
$feval
[1] 10
$convergence
[1] 0
$message
[1] “Successful convergence”
$cpar
method M
2 50
$par
[1] 6.353540 8.162878
$value
[1] 32.87839
$gradient
[1] 8.100187e-06
$fn.reduction
[1] 27.69725
$iter
[1] 8
$feval
[1] 10
$convergence
[1] 0
$message
[1] “Successful convergence”
滑降シンプレックス法
|
|
$xmin
[1] 6.353555 8.162882
$fmin
[1] 32.87839
$fcount
[1] 223
$restarts
[1] 0
(おまけ)関数の視覚化
|
|