-
Notifications
You must be signed in to change notification settings - Fork 0
/
LK.html
335 lines (329 loc) · 14.3 KB
/
LK.html
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<!DOCTYPE html>
<html>
<head>
<title>The Programming Language of Euler</title>
<style type="text/css">
body {
width : 700px;
font-family: arial, sans-serif;
font-size: 10pt;
margin: 20px;
margin-left: 100px;
}
pre {
font-family : "Courier New", monospace;
background: #EEE;
padding: 10px;
margin-left: 15%;
}
pre.output {
background:none;
margin-left: 5%;
}
pre.udf {
margin-left: 0;
}
pre.prompt {
margin-left: 0;
}
pre.comment {
background: none;
margin-left: 7%;
}
p.comment {
margin-left: 5%;
margin-right: 5%;
}
p.indentedcomment {
margin-left: 10%;
}
h1.title {
font-family : arial, sans-serif;
text-align : right;
font-size : 24pt;
padding-bottom: 5pt;
}
h1.comment, h1.comment a {
font-family : arial, sans-serif;
text-align : right;
font-size : 16pt;
}
h2.comment, h2.comment a {
font-family : arial, sans-serif;
text-align : right;
font-size : 12pt;
}
h1.title, h1.comment, h2.comment {
border-bottom: 2px solid;
}
ul.comment {
font-family : arial, sans-serif;
font-size : 10pt;
margin-left: 10%;
margin-right: 10%;
padding-left:0;
}
img.euler { }
p.image {
text-align:center; margin-left:50px;
}
a:link {
font-weight:bolder;
text-decoration:none;
}
a:visited {
font-weight:bolder;
text-decoration:none;
}
</style>
</head>
<body>
<h1 class="title">LK</h1>
<pre class="prompt">>load "LK.e";
>{Mt,clb,tk,rlb}=readtable("ABC.dat",>clabs,>rlabs);
>writetable(Mt[[1:4],[1:6]],labc=clb[1:6],labr=rlb);
</pre>
<pre class="output"> ST SK BS AS PR LR
003_Fest 3766 2490 2335 3707 2684 1325
006_Fest 4516 4059 4543 3556 3671 2201
X_10.0 5316 2328 4110 4443 2364 0
X_10.1 4047 0 3952 5536 5031 351
</pre>
<pre class="prompt">>s:=1; Mt:=Mt[,[1:6]];
>At:=[0,11,20882,0,2175,29174], Df:=Mt[s]
</pre>
<pre class="output">[0, 11, 20882, 0, 2175, 29174]
[3766, 2490, 2335, 3707, 2684, 1325]
</pre>
<pre class="prompt">>rD:=1.2*Def'.Df'+8000; b:=rD; b'
</pre>
<pre class="output">[1.81239e+006, 1.48155e+006, 1.54477e+006]
</pre>
<pre class="prompt">>k0:=1000*(A\[1,1,1]'); K:=Def.inv(A); writetable(K'|k0,labr=lTR[[2,3,6]],labc=lTR+"k0")
</pre>
<pre class="output"> ST SK BS AS PR LR k0
SK 0.32 0.21 0.49 2.07 1.95 0.83 9.02
BS 0.76 0.34 -0.51 -1.38 0.42 0.15 6.12
LR 0.56 0.6 0.97 2.35 -0.55 -0.18 5.79
</pre>
<p class="comment">Stärken
</p>
<pre class="prompt">>writetable(Off|Def,wc=9,labr=lTR,labc=lSK)
</pre>
<pre class="output"> oI oA oK dI dA dK
ST 8 6 13 69 44 130
SK 43 26 63 56 28 83
BS 66 22 11 69 32 23
AS 23 17 10 201 132 72
PR 17 26 23 60 132 81
LR 36 109 63 28 56 35
</pre>
<p class="comment">3D-Achsabschnitte
</p>
<pre class="prompt">>Axab:=rD/A; writetable(Axab, labr=lKL,labc=lTR[[2,3,6]],dc=0,>fixed,)
</pre>
<pre class="output"> SK BS LR
I 42149 27460 50344
A 56983 67343 13592
K 24520 140433 24520
</pre>
<pre class="prompt">>simDia(A,b):
</pre>
<p class="image">
<img class="euler" src="images/LK-001.png" width="448" height="448" alt="LK" />
</p>
<p class="comment">Varianten
</p>
<pre class="prompt">>x:=A\b;
>c0:=rD; c1:=[1,1,1]; c2:=sum(Kos[[2:3]]_Kos[6])'; c3:=[10,7.5,15.5];
>x1:=simplex(A,b,c1,>min,eq=1);
>startlpsolve; {x2,obj,duals}:=ilpsolve(A,b,c0,<max,eq=1);
>X:=x|x1|x2; writetable(X',>fixed,dc=0,labr=["Ax=b","min_1(x)", ...
"min_2(x)"],labc=lTR[[2,3,6]])
</pre>
<pre class="output"> SK BS LR
Ax=b 14846 13828 7260
min_1(x) 14846 13828 7260
min_2(x) 4 15568 21798
</pre>
<pre class="prompt">>Xpro:=(X'/sum(X'))'; X:=8*ceil(X/8); writetable(Xpro'*100,labr=[ ...
"Ax=b","min_1(x)","min_2(x)"],labc=lTR[[2,3,6]],dc=1);
</pre>
<pre class="output"> SK BS LR
Ax=b 41.3 38.5 20.2
min_1(x) 41.3 38.5 20.2
min_2(x) 0 41.7 58.3
</pre>
<h1 class="comment"><a name="Variantenvergleich">Variantenvergleich</a></h1>
<pre class="prompt">>sol:=(X_zeros([3,3]))'.U';
</pre>
<p class="comment">Ausgangsdisposition
</p>
<pre class="prompt">>{rA,rD,key,vA}:=bat(At,rD');
</pre>
<pre class="output"> I A K sum
x 11 20882 29174 50067
loss 9 8371 21275 29655
rA 2.46592e+006 3.69621e+006 2.11838e+006 8.28051e+006
rD 1.81239e+006 1.48155e+006 1.54477e+006 4.8387e+006
rA-rD 653537 2.21466e+006 573616 3.44181e+006
Schaden 1.36 2.49 1.37 5.23
Verlust 0.73 0.4 0.73 1.87
</pre>
<p class="comment">x=A\b
</p>
<pre class="prompt">>{rA,rD,key,vA}:=bat(sol[1],rD);
</pre>
<pre class="output"> I A K sum
x 14848 13832 7264 35944
loss 14844 13827 7262 35933
rA 1.81288e+006 1.48213e+006 1.54521e+006 4.84022e+006
rD 1.81239e+006 1.48155e+006 1.54477e+006 4.8387e+006
rA-rD 492.8 580.8 442.4 1516
Schaden 1 1 1 3
Verlust 1 1 1 3
</pre>
<p class="comment">x=intsimplex(A,b,c) mit c=[1,1,1]
</p>
<pre class="prompt">>{rA,rD,key,vA}:=bat(sol[2],rD);
</pre>
<pre class="output"> I A K sum
x 14848 13832 7264 35944
loss 14844 13827 7262 35933
rA 1.81288e+006 1.48213e+006 1.54521e+006 4.84022e+006
rD 1.81239e+006 1.48155e+006 1.54477e+006 4.8387e+006
rA-rD 492.8 580.8 442.4 1516
Schaden 1 1 1 3
Verlust 1 1 1 3
</pre>
<p class="comment">x=intsimplex(A,b,c) mit c=[rDI, rDA, rDK]
</p>
<pre class="prompt">>{rA,rD,key,vA}:=bat(sol[3],rD);
</pre>
<pre class="output"> I A K sum
x 8 15568 21800 37376
loss 8 8484 21795 30287
rA 1.81263e+006 2.7189e+006 1.54515e+006 6.07669e+006
rD 1.81239e+006 1.48155e+006 1.54477e+006 4.8387e+006
rA-rD 244.8 1.23736e+006 386.4 1.23799e+006
Schaden 1 1.84 1 3.84
Verlust 1 0.54 1 2.54
</pre>
<h1 class="comment"><a name="Runden">Runden</a></h1>
<pre class="prompt">>{o,d}:=fight(At,Df);
</pre>
<pre class="output"> Rnd ST SK BS AS PR LR Sum
0 0 11 20882 0 2175 29174 52242
1 0 7 17413 0 1517 20355 39292
2 0 5 15389 0 1195 16037 32626
3 0 4 14274 0 1036 13912 29226
4 0 3 13685 0 957 12860 27505
5 0 2 13382 0 918 12338 26640
6 0 1 13228 0 898 12079 26206
7 0 0 13151 0 888 11951 25990
8 0 0 13113 0 883 11887 25883
9 0 0 13094 0 880 11855 25829
Rnd ST SK BS AS PR LR Sum
0 3766 2490 2335 3707 2684 1325 16307
1 1883 1245 1167 1853 1342 662 8152
2 941 622 583 926 671 331 4074
3 470 311 291 463 335 165 2035
4 235 155 145 231 167 82 1015
5 117 77 72 115 83 41 505
6 58 38 36 57 41 20 250
7 29 19 18 28 20 10 124
8 14 9 9 14 10 5 61
9 7 4 4 7 5 2 29
</pre>
<pre class="prompt">>plot2d([0:rows(o)-1],o',color=blue); plot2d([0:rows(d)-1],d',style="-.-",>add);
</pre>
<p class="comment">x2=A\b
</p>
<pre class="prompt">>{o,d}:=fight(sol[1],Df);
</pre>
<pre class="output"> Rnd ST SK BS AS PR LR Sum
0 0 14848 13832 0 0 7264 35944
1 0 8690 8102 0 0 4253 21045
2 0 5613 5236 0 0 2747 13596
3 0 4075 3803 0 0 1994 9872
4 0 3307 3086 0 0 1618 8011
5 0 2923 2728 0 0 1430 7081
6 0 2732 2550 0 0 1336 6618
7 0 2637 2462 0 0 1289 6388
8 0 2590 2418 0 0 1266 6274
9 0 2566 2396 0 0 1254 6216
Rnd ST SK BS AS PR LR Sum
0 3766 2490 2335 3707 2684 1325 16307
1 1883 1245 1167 1853 1342 662 8152
2 941 622 583 926 671 331 4074
3 470 311 291 463 335 165 2035
4 235 155 145 231 167 82 1015
5 117 77 72 115 83 41 505
6 58 38 36 57 41 20 250
7 29 19 18 28 20 10 124
8 14 9 9 14 10 5 61
9 7 4 4 7 5 2 29
</pre>
<pre class="prompt">>plot2d([0:rows(o)-1],o',style=".-.",color=red,>add);
</pre>
<p class="comment">x=intsimplex(A,b,c) mit c=[1,1,1]
</p>
<pre class="prompt">>{o,d}:=fight(sol[2],Df);
</pre>
<pre class="output"> Rnd ST SK BS AS PR LR Sum
0 0 14848 13832 0 0 7264 35944
1 0 8690 8102 0 0 4253 21045
2 0 5613 5236 0 0 2747 13596
3 0 4075 3803 0 0 1994 9872
4 0 3307 3086 0 0 1618 8011
5 0 2923 2728 0 0 1430 7081
6 0 2732 2550 0 0 1336 6618
7 0 2637 2462 0 0 1289 6388
8 0 2590 2418 0 0 1266 6274
9 0 2566 2396 0 0 1254 6216
Rnd ST SK BS AS PR LR Sum
0 3766 2490 2335 3707 2684 1325 16307
1 1883 1245 1167 1853 1342 662 8152
2 941 622 583 926 671 331 4074
3 470 311 291 463 335 165 2035
4 235 155 145 231 167 82 1015
5 117 77 72 115 83 41 505
6 58 38 36 57 41 20 250
7 29 19 18 28 20 10 124
8 14 9 9 14 10 5 61
9 7 4 4 7 5 2 29
</pre>
<pre class="prompt">>plot2d([0:rows(o)-1],o',style="-.-",color=green,>add); insimg;
</pre>
<p class="image">
<img class="euler" src="images/LK-002.png" width="448" height="448" alt="LK" />
</p>
<p class="comment">x=intsimplex(A,b,c) mit c=[rDI, rDA, rDK]
</p>
<pre class="prompt">>{o,d}:=fight(sol[3],Df);
</pre>
<pre class="output"> Rnd ST SK BS AS PR LR Sum
0 0 8 15568 0 0 21800 37376
1 0 4 12052 0 0 12765 24821
2 0 2 9819 0 0 8403 18224
3 0 1 8488 0 0 6294 14783
4 0 0 7742 0 0 5267 13009
5 0 0 7344 0 0 4763 12107
6 0 0 7138 0 0 4514 11652
7 0 0 7034 0 0 4391 11425
8 0 0 6982 0 0 4330 11312
9 0 0 6956 0 0 4300 11256
Rnd ST SK BS AS PR LR Sum
0 3766 2490 2335 3707 2684 1325 16307
1 1883 1245 1167 1853 1342 662 8152
2 941 622 583 926 671 331 4074
3 470 311 291 463 335 165 2035
4 235 155 145 231 167 82 1015
5 117 77 72 115 83 41 505
6 58 38 36 57 41 20 250
7 29 19 18 28 20 10 124
8 14 9 9 14 10 5 61
9 7 4 4 7 5 2 29
</pre>
</body>
</html>