-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLK-2.html
395 lines (388 loc) · 16.2 KB
/
LK-2.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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
<!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">>{Mt,clb,tk,rlb}=readtable("Conquer.dat",>clabs,>rlabs);
>writetable(Mt[1:3],labc=clb,labr=rlb);
</pre>
<pre class="output"> ST SK BS AS PR LR
Wasserau 1662 0 0 1050 0 0
Std 320 500 500 700 250 750
Off 200 600 600 300 200 1000
</pre>
<pre class="prompt">>At:=[0,0,9042,0,0,2141], Df:=Mt[1]
</pre>
<pre class="output">[0, 0, 9042, 0, 0, 2141]
[1662, 0, 0, 1050, 0, 0]
</pre>
<pre class="prompt">>load "LK.e";
>rD:=Def'.Df'+1000; b:=rD; b'
</pre>
<pre class="output">[326728, 212728, 292660]
</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 7598 4950 9076
A 8182 9669 1952
K 4645 26605 4645
</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>
<pre class="prompt">>P&:=Pdef; P[4,3]:=Poff[4,3]; P&:=P;
</pre>
<p class="comment">Varianten
</p>
<pre class="prompt">>x1:=sum(Df.Def+1000)/sum((Df.P).A')*(Df.P)';
>x:=A\b;
>b[3]=0
</pre>
<pre class="output"> 326728
212728
0
</pre>
<pre class="prompt">>c0:=rD; c1:=[1,1,1]; c2:=sum(Kos[[2:3]]_Kos[6])'; c3:=[10,7.5,15.5]; c4:=Df.P/sum(Df.P);
>x2:=simplex(A,b,c1,>min,eq=1);
>startlpsolve; {x3,obj,duals}:=ilpsolve(A,b,c0,<max,eq=1);
>X:=x1|x|x2|x3; writetable(X',labr=["P.Df","Ax=b","min_1(x)","min_2(x)"],labc=lTR[[2,3,6]])
</pre>
<pre class="output"> SK BS LR
P.Df 0 4659.94 1782.61
Ax=b 3617.94 2246.83 635.15
min_1(x) 0 4366.63 1070.3
min_2(x) 0 4367 1071
</pre>
<pre class="prompt">>Xpro:=(X'/sum(X'))'; X:=8*ceil(X/8); writetable(Xpro'*100,labr=["P.Df", ...
"Ax=b","min_1(x)","min_2(x)"],labc=lTR[[2,3,6]],dc=1);
</pre>
<pre class="output"> SK BS LR
P.Df 0 72.3 27.7
Ax=b 55.7 34.6 9.8
min_1(x) 0 80.3 19.7
min_2(x) 0 80.3 19.7
</pre>
<h1 class="comment"><a name="Variantenvergleich">Variantenvergleich</a></h1>
<pre class="prompt">>sol:=(X_zeros([3,4]))'.U';
</pre>
<p class="comment">Ausgangsdisposition
</p>
<pre class="prompt">>{rA,rD,key,vA}:=bat(,);
</pre>
<pre class="output"> I A K sum
x 0 9042 2141 11183
loss 0 4450 2141 6591
rA 673848 432293 234345 1.34049e+006
rD 326728 212728 292660 832116
rA-rD 347120 219565 -58315 508370
Schaden 2.06 2.03 0.8 4.9
Verlust 0.48 0.49 1.25 2.23
</pre>
<p class="comment">x=P.Df
</p>
<pre class="prompt">>{rA,rD,key,vA}:=bat(sol[1],);
</pre>
<pre class="output"> I A K sum
x 0 4664 1784 6448
loss 0 3340 1784 5124
rA 372048 297064 163696 832808
rD 326728 212728 292660 832116
rA-rD 45320 84336 -128964 692
Schaden 1.14 1.4 0.56 3.09
Verlust 0.88 0.72 1.79 3.38
</pre>
<p class="comment">x=A\b
</p>
<pre class="prompt">>{rA,rD,key,vA}:=bat(sol[2],);
</pre>
<pre class="output"> I A K sum
x 3624 2248 640 6512
loss 3619 2241 639 6499
rA 327240 213440 293360 834040
rD 326728 212728 292660 832116
rA-rD 512 712 700 1924
Schaden 1 1 1 3.01
Verlust 1 1 1 2.99
</pre>
<p class="comment">x=intsimplex(A,b,c) mit c=[1,1,1]
</p>
<pre class="prompt">>{rA,rD,key,vA}:=bat(sol[3],);
</pre>
<pre class="output"> I A K sum
x 0 4368 1072 5440
loss 0 4364 1072 5436
rA 326880 212944 115584 655408
rD 326728 212728 292660 832116
rA-rD 152 216 -177076 -176708
Schaden 1 1 0.39 2.4
Verlust 1 1 2.53 4.53
</pre>
<p class="comment">x=intsimplex(A,b,c) mit c=[rDI, rDA, rDK]
</p>
<pre class="prompt">>{rA,rD,key,vA}:=bat(sol[4],);
</pre>
<pre class="output"> I A K sum
x 0 4368 1072 5440
loss 0 4364 1072 5436
rA 326880 212944 115584 655408
rD 326728 212728 292660 832116
rA-rD 152 216 -177076 -176708
Schaden 1 1 0.39 2.4
Verlust 1 1 2.53 4.53
</pre>
<h1 class="comment"><a name="Runden">Runden</a></h1>
<pre class="prompt">>{o,d}:=fight(,);
</pre>
<pre class="output"> Rnd ST SK BS AS PR LR Sum
0 0 0 9042 0 0 2141 11183
1 0 0 6817 0 0 1070 7887
2 0 0 5450 0 0 535 5985
3 0 0 4626 0 0 324 4950
4 0 0 4163 0 0 239 4402
5 0 0 3913 0 0 201 4114
6 0 0 3777 0 0 183 3960
Rnd ST SK BS AS PR LR Sum
0 1662 0 0 1050 0 0 2712
1 831 0 0 525 0 0 1356
2 415 0 0 262 0 0 677
3 207 0 0 131 0 0 338
4 103 0 0 65 0 0 168
5 51 0 0 32 0 0 83
6 25 0 0 16 0 0 41
</pre>
<pre class="prompt">>plot2d([0:rows(o)-1],o',color=blue); plot2d([0:rows(d)-1],d',style="-.-",>add);
</pre>
<p class="comment">x1=P.Df
</p>
<pre class="prompt">>{o,d}:=fight(sol[1],);
</pre>
<pre class="output"> Rnd ST SK BS AS PR LR Sum
0 0 0 4664 0 0 1784 6448
1 0 0 2994 0 0 892 3886
2 0 0 2013 0 0 446 2459
3 0 0 1429 0 0 223 1652
4 0 0 1077 0 0 111 1188
5 0 0 864 0 0 55 919
6 0 0 734 0 0 33 767
Rnd ST SK BS AS PR LR Sum
0 1662 0 0 1050 0 0 2712
1 831 0 0 525 0 0 1356
2 415 0 0 262 0 0 677
3 207 0 0 131 0 0 338
4 103 0 0 65 0 0 168
5 51 0 0 32 0 0 83
6 25 0 0 16 0 0 41
</pre>
<p class="comment">x2=A\b
</p>
<pre class="prompt">>{o,d}:=fight(sol[2],);
</pre>
<pre class="output"> Rnd ST SK BS AS PR LR Sum
0 0 3624 2248 0 0 640 6512
1 0 1814 1127 0 0 320 3261
2 0 907 563 0 0 160 1630
3 0 453 281 0 0 80 814
4 0 226 140 0 0 40 406
5 0 113 70 0 0 20 203
6 0 56 35 0 0 10 101
7 0 28 17 0 0 5 50
Rnd ST SK BS AS PR LR Sum
0 1662 0 0 1050 0 0 2712
1 831 0 0 525 0 0 1356
2 415 0 0 262 0 0 677
3 208 0 0 132 0 0 340
4 106 0 0 68 0 0 174
5 56 0 0 37 0 0 93
6 32 0 0 22 0 0 54
7 21 0 0 15 0 0 36
</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[3],);
</pre>
<pre class="output"> Rnd ST SK BS AS PR LR Sum
0 0 0 4368 0 0 1072 5440
1 0 0 2186 0 0 536 2722
2 0 0 1093 0 0 268 1361
3 0 0 546 0 0 134 680
4 0 0 273 0 0 67 340
5 0 0 136 0 0 33 169
6 0 0 68 0 0 16 84
7 0 0 34 0 0 8 42
Rnd ST SK BS AS PR LR Sum
0 1662 0 0 1050 0 0 2712
1 831 0 0 525 0 0 1356
2 416 0 0 263 0 0 679
3 209 0 0 133 0 0 342
4 107 0 0 69 0 0 176
5 57 0 0 38 0 0 95
6 33 0 0 23 0 0 56
7 22 0 0 16 0 0 38
</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[4],);
</pre>
<pre class="output"> Rnd ST SK BS AS PR LR Sum
0 0 0 4368 0 0 1072 5440
1 0 0 2186 0 0 536 2722
2 0 0 1093 0 0 268 1361
3 0 0 546 0 0 134 680
4 0 0 273 0 0 67 340
5 0 0 136 0 0 33 169
6 0 0 68 0 0 16 84
7 0 0 34 0 0 8 42
Rnd ST SK BS AS PR LR Sum
0 1662 0 0 1050 0 0 2712
1 831 0 0 525 0 0 1356
2 416 0 0 263 0 0 679
3 209 0 0 133 0 0 342
4 107 0 0 69 0 0 176
5 57 0 0 38 0 0 95
6 33 0 0 23 0 0 56
7 22 0 0 16 0 0 38
</pre>
<pre class="prompt">>writetable(Axab, labr=lKL,labc=lTR[[2,3,6]],dc=0,>fixed,)
</pre>
<pre class="output"> SK BS LR
I 7598 4950 9076
A 8182 9669 1952
K 4645 26605 4645
</pre>
<pre class="prompt">>rD/100000+x3'/1000
</pre>
<pre class="output">[3.26728, 6.49428, 3.9976]
</pre>
<pre class="prompt">>rD/1e5
</pre>
<pre class="output">[3.26728, 2.12728, 2.9266]
</pre>
<pre class="prompt">>x'/1000+1
</pre>
<pre class="output">[4.61794, 3.24683, 1.63515]
</pre>
<pre class="prompt">>r:=round(max(max(Axab)'),-4)/2;
>figure(2,2)
</pre>
<pre class="output">[72, 36, 494, 440]
</pre>
<pre class="prompt">>figure(4); i=2; j=3; ...
plot2d([Axab[1,i]|0|0|Axab[2,i]|Axab[3,i]|0], ...
[0|Axab[1,j]|Axab[2,j]|0|0|Axab[3,j]], ...
a=0,b=r,c=0,d=r)
>insimg
</pre>
<p class="image">
<img class="euler" src="images/LK-003.png" width="448" height="448" alt="LK" />
</p>
<pre class="prompt">>figure(0);
</pre>
</body>
</html>