Sie sind auf Seite 1von 3

Monte – Carlo method for the constrained minimization

Bui The Tam – Hanoi, Vietnam – 22/8/2017


(Material for this lecture can be download in the comment section below)
1. Problem formulation
𝑀𝐼𝑁 𝑓(𝑥) (1)
Subject to
𝑥 ∈ 𝐷 ⊂ 𝑅𝑛 (2)
𝑎𝑗 ≤ 𝑥𝑗 ≤ 𝑏𝑗 , 𝑗 = 1, 2, … , 𝑛 (3)

2. Algorithm
it – number of the random points (iterations)
np - number of the feasible points
change – number of the best point changes
fb – a best value of a objective function
xb – a best feasible point
The function objfunc1() computes a objective function
The function constraints1() tests the constraint satisfaction of point x
The function randomnumber() creates a random number.
Step 0. Set it = 0, np = 0, change = 0, fb = 1.0e30
Step 1. Increase it = it + 1.
Step 2. Compute
𝑥𝑗 = 𝑎𝑗 + 𝑟𝑎𝑛𝑑𝑜𝑚 ∗ (𝑏𝑗 − 𝑎𝑗 ), 𝑗 = 1, 2, … , 𝑛
where random is a random number that is uniformly distributed over [0, 1].
Step 3. Check 𝑥 ∈ 𝐷. If 𝑥 ∉ 𝐷 , then go to Step 2. Otherwise np = np + 1, go to Step 4
Step 4. Compute r = f(x). If r => fb, then go to Step 2.
Step 5. If r < fb, then 𝑓𝑏 ← 𝑟, 𝑥𝑏 ← 𝑥 and do a local search in a box
𝑎1𝑗 ≤ 𝑥𝑗 ≤ 𝑏1𝑗 , 𝑗 = 1, 2, … , 𝑛
𝑎1𝑗 = 𝑚𝑎𝑥{𝑎𝑗 , 𝑥𝑏𝑗 − 0.1(𝑏𝑗 − 𝑎𝑗 )}, 𝑏1𝑗 = 𝑚𝑖𝑛{𝑏𝑗 , 𝑥𝑏𝑗 + 0.1(𝑏𝑗 − 𝑎𝑗 )}
Go to Step 2.
Example1. Minimize
f(x) = 37.293239*x[1] + 0.8356891*x[1]*x[2] + 5.3578547*x[3]*x[3] - 0792.141
subject to
-0.0022053*x[3]*x[5] + 0.0056858*x[2]*x[5] + 0.0006262*x[1]*x[4] - 6.665593 <= 0
0.0022053*x[3]*x[5] - 0.0056858*x[2]*x[5] - 0.0006262*x[1]*x[4] - 85.334407 <= 0
0.0071317*x[2]*x[5] + 0.0021813*x[3]*x[3] + 0.0029955*x[1]*x[2] - 29.48751 <= 0
-0.0071317*x[2]*x[5] - 0.0021813*x[3]*x[3] - 0.0029955*x[1]*x[2] + 9.48751 <= 0
0.0047026*x[3]*x[5] + 0.0019085*x[3]*x[4] + 0.0012547*x[1]*x[3] - 15.699039 <= 0
-0.0047026*x[3]*x[5] - 0.0019085*x[3]*x[4] - 0.0012547*x[1]*x[3] + 10.699039 <= 0
78 <= x[1] <= 102, 33 <= x[2] <= 45, 27 <= x[3] , x[4], x[5] <= 45
Example 2. Minimize
f(x) = x[1]+x[2]+x[3]
subject to
-1.0+ 0.0025*(x[4]+x[6]) <= 0
-1.0+ 0.0025*(-x[4]+x[5]+x[7]) <= 0
-1.0+ 0.01*(-x[5]+x[8]) <= 0
100.0*x[1]-x[1]*x[6]+833.33252*x[4]-83333.333 <= 0
x[2]*x[4] - x[2]*x[7]-1250*x[4]+1250*x[5] <= 0
x[3]*x[5]-x[3]*x[8]-2500*x[5]+1250000 <= 0
100 <= x[1] <= 10000, 1000 <= x[2], x[3] <= 10000
10 <= x[4], x[5], x[6], x[7], x[8] <= 1000

Reference
1. Mô hình điều khiển hợp lý nhà máy thủy điện Hòa Bình. Trường Đại học Tổng hợp Hà Nội, 1988.
Đây là công trình hợp tác nghiên cứu khoa học giữa Đề tài 48A-04-05 (chủ nhiệm đề tài GS Nguyễn Quý
Hỷ) của xê-mi-na “Các phương pháp ngẫu nhiên và giải tích số” và đề tài 10A-02-05 (Chủ nhiệm đề tài
TS Lưu Công Đào) của Viện nghiên cứu khoa học kỹ thuật điện. Tài liệu 84 trang khổ giấy A4.

 Bạn hãy ĐĂNG KÝ kênh này để nhận được thông báo khi có video mới
 Bạn hãy Like và Share video này cho bạn bè và người quen quan tâm
đến các thuật toán tối ưu và lập trình C++
 Cám ơn các bạn đã chú ý theo dõi

Das könnte Ihnen auch gefallen