You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -724,7 +700,7 @@ public float SlipDerivationPercentpS
724
700
}
725
701
726
702
doubleintegratorError;
727
-
intwaitBeforeIntegreationRate;
703
+
intwaitBeforeChangingRate;
728
704
729
705
/// <summary>
730
706
/// Read/Write relative slip speed warning threshold value, in percent of maximal effective slip
@@ -868,21 +844,23 @@ public void Save(BinaryWriter outf)
868
844
/// <summary>
869
845
/// Integrates the wheel rotation movement using a RK4 method,
870
846
/// calculating the required number of substeps
847
+
/// To maintain the accuracy of the integration method, the number of substeps needs to increase when slip speed approaches the slip threshold speed.
848
+
/// The folloi=wing section attempts to calculate the optimal substep limit. This is a trade off between the accuracy of the slips calculations and the CPU load which impacts the screen FPS
871
849
/// Outputs: wheel speed, wheel angular position and motive force
// this speeds up the substep increase if the slip speed approaches the threshold or has exceeded it, ie "critical conditions".
906
+
NumOfSubstepsPS+=10;
907
+
waitBeforeChangingRate=5;
908
+
}
909
+
else
910
+
{
911
+
// this speeds ups the substeps under "non critical" conditions
912
+
NumOfSubstepsPS+=3;
913
+
waitBeforeChangingRate=30;
914
+
}
915
+
926
916
}
927
917
}
928
918
elseif(targetNumOfSubstepsPS<NumOfSubstepsPS)// decrease sub steps
929
919
{
930
-
if(--waitBeforeIntegreationRate<=0)//wait for a while before changing the integration rate
920
+
if(--waitBeforeChangingRate<=0)//wait for a while before changing the integration rate
931
921
{
932
-
NumOfSubstepsPS-=5;
933
-
waitBeforeIntegreationRate=20;
922
+
NumOfSubstepsPS-=3;
923
+
waitBeforeChangingRate=30;
934
924
}
935
925
}
936
926
927
+
// keeps the substeps to a relevant upper and lower limits
937
928
if(NumOfSubstepsPS<lowerSubStepLimit)
938
929
NumOfSubstepsPS=(int)lowerSubStepLimit;
939
930
@@ -1178,7 +1169,6 @@ public double SlipCharacteristics(double slipSpeedMpS)
1178
1169
}
1179
1170
}
1180
1171
1181
-
1182
1172
/// <summary>
1183
1173
/// Uses the Polach creep force curves calculation described in the following document
1184
1174
/// "Creep forces in simulations of traction vehicles running on adhesion limit" by O. Polach 2005 Wear - http://www.sze.hu/~szenasy/VILLVONT/polachslipvizsg.pdf
0 commit comments