gbaygon said:
Collinsmark i will try how it works with the dry friction model.
Thank you very much, the formulas and explaantions where very useful!
This is for a personal project for a game of soccer that I'm doing.
Okay, if this is for your own personal project, perhaps I can help you a little further.
Before you completely abandon the F = -kv method of modeling friction, recall that differential equation.
<br />
\ddot{s} = -\frac{k}{m} \dot{s}. <br />
Its solution is
\vec s(t) = \vec s_0 +\frac{\vec v_0 m}{k} \left(1-e^{\frac{-kt}{m}} \right)
where \vec s_0 is the player's current position (the player with the ball),
m is the mass and
k is your drag coefficient. As we let
t --> infinity, then \vec s(t) becomes \vec s_d, where \vec s_d is the desired final destination of the ball.
\vec s_d = \vec s_0 +\frac{\vec v_0 m}{k}.
So your initial velocity is then
\vec v_0 = \frac{k}{m}(\vec s_d - \vec s_0).
You can use this to determine the initial velocity of the ball, given its initial and final positions, the drag coefficient, and the ball's mass. If your computer program does not model mass (and only relies on acceleration, as some computer programs do), then you probably just need to set
m to 1. But of course, that's dependent upon your implementation. Oh, and you might want to overshoot a little, as previously discussed.
Okay, now moving on to dry friction. If you change your program to use a dry friction model, you'll have to change your equation. As previously discussed,
F(s_d - s_0) = \frac{1}{2}mv_0^2.
v_0 = \sqrt{\frac{2F}{m}(s_d - s_0)}
Where
F is the constant frictional force,
m is the mass, and s_d and s_0 are the final and initial positions respectively. Point the ball in the direction of \vec s_d - \vec s_0 (point
F in the opposite direction). Oh, and don't forget you'll have to remove the frictional force when the ball stops.
So now the question you need to answer is whether to use a dry friction model or the F = -kv model. I don't have an answer for you. I suggest do whichever looks best and/or more realistic. If I had to guess, I'd probably guess the dry friction model might look better for a soccer ball. But I don't know for sure.
Good luck!