![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|||||||||
|
|
Thread Tools | Display Modes |
03-27-13, 08:22 AM
|
#11 |
|
Lieutenant
![]() Join Date: Nov 2006
Location: St. Petersburg, Russia
Posts: 264
Downloads: 73
Uploads: 0
|
Ok, here is the analysis:
Let's first derive the formula implied in the code: speed = 30.99133 x cube_root[ (7432.328 / 559500) x (XMM2 + ordered_speed x XMM1) x (ordered_speed x XMM1)^2 ] or: speed = 30.99133 x 0.23683266 x cube_root[ (XMM2 + ordered_speed x XMM1) x (ordered_speed x XMM1)^2 ] We can try to simplify it further but if we just insert this formula into excel/calc we will get to the following values (we drop the negative values since we cannot see what what is done with those from the code excerpt given): Code:
0 0,00000 0,1 4,38442 0,2 7,55932 0,3 10,58301 0,4 13,54768 0,5 16,48260 0,6 19,40030 0,7 22,30711 0,8 25,20658 0,9 28,10086 1 30,99133 The other thing to see is that the combination of constants 3.913995 (xmm1) and 7432.328/559500 works so that the max speed at order 1.0 will be equal to the constant given later in the code (30.99133) if we change this number to, say, 20, the speed at 1.0 setting will be also 20 with speeds at other settings changing accordingly (@TDW this can be the answer to your question), at 0.4 setting the speed will be 8.7 knots. What is puzzling is XMM2 which changes almost nothing. If we set it to 0 the max speed (30.99) will change only by 2 knots to 28 and the speed at 0.4 will be 11.49. Why this xmm2 variable is needed at all? To put some logic into the formula here is my thinking:
|
|
|
| Thread Tools | |
| Display Modes | |
|
|
