I want to simulate the horizontal motion of a vehicle driven by an engine of given power P. For start in the simplified case with no friction (no dissipative forces).
My problem is with P = Fv: Suppose the vehicle was launched backwards with an initial velocity -v0 while the engine pushes forward -- it will decelerate, stop, and then reverse direction. When the vehicle changes direction v = 0, so if I calculate the force F = P/v I get infinity.
I asked an AI assistant and it said to limit the magnitude of the force. But it doesn't work nicely, the force graph still has a weird shape around the stopping point.
I need the force for the case when I introduce drag: F_acceleration = F_engine + F_drag, where F_drag = - k*v. My goal is to simulate a very simple vehicle with an interactive "acceleration pedal" (gas pedal), to show that it does not control the acceleration of the vehicle.
What is the customary way of dealing with this 'infinite force at rest` problem in numerical simulations (an ODE solver)?