-
Notifications
You must be signed in to change notification settings - Fork 6
/
libipoptfort2.dll
188 lines (152 loc) · 4.83 KB
/
libipoptfort2.dll
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
param NE == 5;
var tf >= 1;
var hi = tf/NE;
param N1{j in {1}};
param N2{j in {1}};
param N3{j in {1}};
################################# 车道尺寸参数
set I :={1..NE};
set I1:={1..NE-1};
set J :={1..3};
set K :={0..3};
param tauj{j in K};
param dljtauk{j in K,k in K};
param omega{j in J};
set A1;
set A2;
set A3;
set ALL :={1..(N1[1] + N2[1] + N3[1])};
param PXPY{j in ALL,k in {1..2}};
param NC == N1[1] + N2[1] + N3[1];
################################# 边界限制参数
param amax == 0.5;
param vmax == 15;
param wmax == 0.3;
param phymax == 0.576;
param jerkmax == 0.2;
param n == 0.96;
param l = 2.8;
param m = 0.929;
param b = 0.971;
################################# 声明
var x0{i in I,j in K,k in ALL};
var y0{i in I,j in K,k in ALL};
var x{i in I,j in K,k in ALL};
var y{i in I,j in K,k in ALL};
var theta{i in I,j in K,k in ALL};
var v{i in I,j in K,k in ALL};
var phy{i in I,j in K,k in ALL};
var w{i in I,j in K,k in ALL};
var a{i in I,j in K,k in ALL};
var jerk{i in I,j in K,k in ALL};
################################# 优化时间
minimize criterion:
tf;
################################# Vehicle kinematics described via DAEs ####
s.t. DIFF_dxdt {i in I, k in J, xx in ALL}:
sum{j in K}(dljtauk[j,k]*x[i,j,xx]) - hi * v[i,k,xx] * cos(theta[i,k,xx]) = 0;
s.t. DIFF_dydt {i in I, k in J, xx in ALL}:
sum{j in K}(dljtauk[j,k]*y[i,j,xx]) - hi * v[i,k,xx] * sin(theta[i,k,xx]) = 0;
s.t. DIFF_dtdt {i in I, k in J, xx in ALL}:
sum{j in K}(dljtauk[j,k]*theta[i,j,xx]) - hi*(sin(phy[i,k,xx]))*v[i,k,xx]/2.8 = 0;
s.t. EQ_diffx {i in I1, xx in ALL}:
x[i+1,0,xx] = sum{j in K}((prod{k in K:k<>j}((1-tauj[k])/(tauj[j]-tauj[k])))*x[i,j,xx]);
s.t. EQ_diffy {i in I1, xx in ALL}:
y[i+1,0,xx] = sum{j in K}((prod{k in K:k<>j}((1-tauj[k])/(tauj[j]-tauj[k])))*y[i,j,xx]);
s.t. EQ_difftheta {i in I1, xx in ALL}:
theta[i+1,0,xx] = sum{j in K}((prod{k in K:k<>j}((1-tauj[k])/(tauj[j]-tauj[k])))*theta[i,j,xx]);
s.t. DIFF_dvdt {i in I, k in J, xx in ALL}:
sum{j in K}(dljtauk[j,k]*v[i,j,xx]) - hi*a[i,k,xx] = 0;
s.t. DIFF_dpdt {i in I, k in J, xx in ALL}:
sum{j in K}(dljtauk[j,k]*phy[i,j,xx]) - hi*w[i,k,xx] = 0;
s.t. EQ_diffv {i in I1, xx in ALL}:
v[i+1,0,xx] = sum{j in K}((prod{k in K:k<>j}((1-tauj[k])/(tauj[j]-tauj[k])))*v[i,j,xx]);
s.t. EQ_diffphy {i in I1, xx in ALL}:
phy[i+1,0,xx] = sum{j in K}((prod{k in K:k<>j}((1-tauj[k])/(tauj[j]-tauj[k])))*phy[i,j,xx]);
s.t. Bonds_w {i in I,j in K,xx in ALL}:
(w[i,j,xx])^2 <= (wmax)^2;
s.t. Bonds_a {i in I,j in K,xx in ALL}:
(a[i,j,xx])^2 <= (amax)^2;
s.t. Bonds_jerk {i in I,j in K,xx in ALL}:
(jerk[i,j,xx])^2 <= (jerkmax)^2;
s.t. DIFF_dadt {i in I, k in J, xx in ALL}:
sum{j in K}(dljtauk[j,k]*a[i,j,xx]) - hi*jerk[i,k,xx] = 0;
s.t. EQ_diffa {i in I1, xx in ALL}:
a[i+1,0,xx] = sum{j in K}((prod{k in K:k<>j}((1-tauj[k])/(tauj[j]-tauj[k])))*a[i,j,xx]);
################################# Starting Configurations #################################
s.t. EQ_starting_theta {xx in ALL}:
theta[1,0,xx] = 0;
s.t. EQ_ending_theta {xx in ALL}:
theta[NE,3,xx] = 0;
s.t. EQ_starting_phy {xx in ALL}:
phy[1,0,xx] = 0;
s.t. EQ_ending_phy {xx in ALL}:
phy[NE,3,xx] = 0;
s.t. EQ_starting_v_all {xx in ALL}:
v[1,0,xx] = 10;
s.t. EQ_ending_v_all {xx in ALL}:
v[NE,3,xx] = 10;
s.t. EQ_starting_a_all {xx in ALL}:
a[1,0,xx] = 0;
s.t. EQ_ending_a_all {xx in ALL}:
a[NE,3,xx] = 0;
s.t. EQ_starting_w_all {xx in ALL}:
w[1,0,xx] = 0;
s.t. EQ_ending_w_all {xx in ALL}:
w[NE,3,xx] = 0;
s.t. EQ_starting_j_all {xx in ALL}:
jerk[1,0,xx] = 0;
s.t. EQ_ending_j_all {xx in ALL}:
jerk[NE,3,xx] = 0;
################################# 状态及控制变量的上下界限制
s.t. Bonds_v1 {i in I,j in K,xx in ALL}:
v[i,j,xx] <= vmax;
s.t. Bonds_v2 {i in I,j in K,xx in ALL}:
v[i,j,xx] >= 0;
s.t. Bonds_phy {i in I,j in K,xx in ALL}:
phy[i,j,xx]^2 <= (phymax)^2;
############################# 场景拆分 ##################################
s.t. EQ_ending_theta_A1 {xx in A1}:
y[NE,3,xx] = -3.75;
s.t. EQ_ending_theta_A2 {xx in A2}:
y[NE,3,xx] = 0;
s.t. EQ_ending_theta_A3 {xx in A3}:
y[NE,3,xx] = 3.75;
s.t. EQ_starting_x_all {xx in ALL}:
x[1,0,xx] = PXPY[xx,1];
s.t. EQ_starting_y_all {xx in ALL}:
y[1,0,xx] = PXPY[xx,2];
data;
param: PXPY := include PXPY;
param: N1 := include OLD1;
param: N2 := include OLD2;
param: N3 := include OLD3;
set A1 := include A1;
set A2 := include A2;
set A3 := include A3;
param: dljtauk :=
0 0 -9
0 1 -4.1394
0 2 1.7394
0 3 -3
1 0 10.0488
1 1 3.2247
1 2 -3.5678
1 3 5.5320
2 0 -1.3821
2 1 1.1678
2 2 0.7753
2 3 -7.5320
3 0 0.3333
3 1 -0.2532
3 2 1.0532
3 3 5;
param: tauj :=
0 0
1 0.1550510257216822
2 0.6449489742783178
3 1.0;
param: omega:=
1 3.76403062700467e-1
2 5.12485826188421e-1
3 1.11111111111111e-1;