-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.py
59 lines (51 loc) · 1.77 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import curves
import tools
import geology
import algorithms
import sep
import scheduling.continuous as sc
import numpy as np
if __name__ == '__main__':
# Tools
# Bit
bit = tools.Bit(100, 0.0)
# Motor curves
rpmcurve = curves.Quadratic(np.array([[0., 100.],
[1400., 60.],
[2500., 0.]]))
torquecurve = curves.Quadratic(np.array([[0., 0.],
[1400., 3.5],
[2500., 5.0]]))
# Motor degradation curve
data = np.load('gp_data.npy')
x, y = data[:,0,None], data[:,1,None]
failurecurve = curves.WarpedGP(x, y, warping_terms=2)
initial_degradation = 1
# PDM
pdm = tools.PDM(rpmcurve,
torquecurve,
failurecurve,
initial_degradation,
1/1500/25)
# Drill string
drillstring = tools.DrillString(pdm, bit)
# Cost function maintenance
cost_maint = curves.Linear(np.array([[0., 4.],
[4000., 20.]]))
# Geology
rock1 = geology.Rock(315, 68.6, 50, 0.93, 33, 0.65)
rock2 = geology.Rock(278, 330, 125, 0.48, 157, 0.98)
geo = geology.Geology({0: rock1,
800: rock2})
# Enumeration
algo = algorithms.enum
# Boundary heuristic
# algo = algorithms.boundary_heuristic
# No-degradation heuristic
# algo = algorithms.no_degradation_start_heuristic
# Model
scheduler = sc.Deterministic(geo, drillstring, cost_maint, xfin=3500)
# scheduler = sc.Wolfe(geo, drillstring, cost_maint, xfin=3500, alpha=0.95)
scheduler.build()
scheduler, obj = algo(scheduler)
scheduler.print_schedule()