- #1
fishingspree2
- 139
- 0
Hello, I have defined a C2 continuous path using piecewise functions, and I want to estimate the time a car takes to go from the beginning to the end. There are many things left out, such as weight transfer. Here is the "pseudocode" of what I tried:
deltaT is set to 0.1 seconds
input: beginning, end, deltaT
t=0
v=0
a="some acceleration i choose"
position= beginning
while "end of path not reached" do
output: t
A few questions:
this basic algorithm assumes the car can always decelerates from speed v to the next maximum speed, for any delta T. Any ideas on how to take deceleration limits into account?
deltaT is set to 0.1 seconds
input: beginning, end, deltaT
t=0
v=0
a="some acceleration i choose"
position= beginning
while "end of path not reached" do
travelleddistance=[tex]v\Delta t+0.5a\Delta t^{2}[/tex]
position="new position on the path, given the traveled distance"
t=[tex]t+\Delta t[/tex]
[tex]v=\min \left(\sqrt{\frac{curveradius\cdot \mu_{s}\left(mass\cdot g+downforce)}{mass}},v+a\Delta t,\left(\textrm{maxspeed given power of car, bounded by air drag}\right)\right)[/tex]
[tex]a=\min\left ( \sqrt{\textrm{formula derived from tractioncircle}},\frac{Power of car}{v\cdot mass} \right )[/tex]
end doposition="new position on the path, given the traveled distance"
t=[tex]t+\Delta t[/tex]
[tex]v=\min \left(\sqrt{\frac{curveradius\cdot \mu_{s}\left(mass\cdot g+downforce)}{mass}},v+a\Delta t,\left(\textrm{maxspeed given power of car, bounded by air drag}\right)\right)[/tex]
[tex]a=\min\left ( \sqrt{\textrm{formula derived from tractioncircle}},\frac{Power of car}{v\cdot mass} \right )[/tex]
output: t
A few questions:
this basic algorithm assumes the car can always decelerates from speed v to the next maximum speed, for any delta T. Any ideas on how to take deceleration limits into account?