Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


physics help


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 noobnerd   Members   -  Reputation: 128

Like
0Likes
Like

Posted 31 January 2013 - 09:52 AM

hi there. I have been working on a pool simulator in DarkBasic for a while now and it doesnt work correctly. And i cant see why. 

 

so the problem is that when sliding on the table the balls angular velocity doesnt change as fast as it does in real life ( i have a pool table available so i have checked it over and over. (i also found some highspeed videos online which confirm the error) 

 

I use the following to calculate the motion of the ball on the table:

 

where 

V = vector for velocity of ball

W = vector for angular velocity of ball

P = vector for position of ball

Vt = vector for perimeter velocity at contact point ( with table)

r = radius of ball

R = vector from center of ball to the table ( length r)

m = mass ( 0.16 kg )

g = acceleration due gravity ( 9.81)

us = coefficient of friction while slipping (0.2) ( have tried all kinds of values)

ur = coefficient of friction while rolling (0.01)

x is cross product

d is delta

dt = time-step of the simulation ( on the order of 5x10^-5 )

 

Vt = (R x W) + V

if Vt = 0 then the ball is rolling without any slip

dV = -us*g*dt*(Vt/|Vt|)                                 (Vt/|Vt|) is the unit vector in direction Vt

V = V+dV

dW = [(-us*m*g*r*(Vt/|Vt|)]x R) * (5*dt)/(2*m*r^2)

W = W+dW

if the ball is rolling:

    V = V-(ur*g*dt)*(Vt/|Vt|)

endif

Wz = Wz*(1-uz*dt)               where Wz is the z(perpendicular to table) component of the angular velocity and uz is a friction to slow it down ( nothing in the "real" physics would stop pure z spin)

 

this seems to produce approximately 10-15 times too weak dW. Why is this?

 

any help very much appreciated 

 

 

 

 

 



Sponsor:

#2 Selenaut   Members   -  Reputation: 102

Like
0Likes
Like

Posted 31 January 2013 - 11:58 AM

Where did you get the equation for dW? It's very difficult to dissect the entirety of this problem without knowing where the equations came from.



#3 noobnerd   Members   -  Reputation: 128

Like
0Likes
Like

Posted 31 January 2013 - 12:40 PM

sorry, i will clarify:

 

from newton, F = ma -> F = m*dv/dt 

Fu = u*N                                                                            force of friction = coefficient of friction times normal force

Fu = u*m*g*(r?)                                                              

cant say i see why the r is there now that i think of it i got this from here where it says so but cant see why? maybe this explains it. with my radius of 0.02857 it would cause quite the difference at least.

 

Fu x R = torque caused by the friction force

T = I*a                                                                                 Torque = moment of inertia times angular accelleration

T = I*dw/dt                                     

dw = T*dt/I

 

moment of inertia for a sphere is (2/5)*mass*radius^2

 

thank you for your time



#4 deekr   Members   -  Reputation: 191

Like
0Likes
Like

Posted 11 February 2013 - 03:05 AM

The torque is given by R x F, not F x R.

 

In the z-direction: N=mg. In the forward direction: ma=-uNv^=-umgv^=f, where f is the force due to friction.

The torque on the contact point is then R x f = -umgr (r^ x v^) = I dw/dt, so dw = -(5ug)/(2r) dt (r^ x v^).

 

If Ww^ (magnitude and direction) is the current angular momentum, the update after euler integration is [ W w^ - ((5ug)/(2r)) (r^ x v^) dt ].

 

There is more analysis that could be done, but check if this sign change in the cross product does anything for you.


Edited by deekr, 11 February 2013 - 03:07 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS