0
$\begingroup$

I have developed a spinner view for an Android application. It's like the spinner wheel on the Price Is Right with Bob Barker (If you're not familiar with that show watch this video).

I am looking to write a mathematical function that realistically computes the drag as the wheel spins around. I don't want the thing to go on forever of course.

When a user "flicks" the wheel up or down, depending on the speed of the flick, the widget will continue at the same rate. I need to add an element of drag as some sort of exponential function with respect to time.

I am thinking of two directions to go with this. Either by using an inverse exponential S(s, t) where s is the original speed and t is time. Or, I can use a logarithmic function to compute drag, and subtract that from the original speed.

What would you do? Do you have any suggestions for implementing drag realistically?

  • 0
    Just an idea, since this is a computer program that you are writing and not really a mathematical or physical problem that you want to solve, you don't really need to know the exact position of the wheel as a function of time. Actually, if you have the position and angular velocity of the wheel at a given frame, you can determine its position and velocity at the next frame (this is like programming a differential equation, instead of solving it). To get the "exponential" behavior you want to multiply the velocity by a constant c<1 at each frame.2011-07-28

1 Answers 1

0

Inverse exponential is the way to go. The "drag" is caused by friction (with air, and the hinges around the wheel's edge) which is proportional to the speed of the rotation. Of course, in a purely realistic model, one has to take the air motion (both external and generated by the motion of the wheel itself) into account. But the structure of the wheel (heavy, smooth, leveraged on a hinge with minimal friction) and the fact that the friction which causes it to stop is generated mostly by the hinges, which cause stronger counter acceleration than the air resistance itself by orders of magnitude, are are dense enough to consider a continuous force rather than isolated bumps, is all made in favor of making these external forces negligible. On the bottom line, what causes the counter acceleration is constant in time, and only linearly depends on the speed of rotation, which rises a simple differential equation whose solution is an exponential with a negative power. The constants (the one in the power, and the one of the exponential itself) both depend on physical properties of the wheel, so I'd just monkey around with them until I get something which feels natural if I were you.

  • 0
    An advantage of having force independent of speed is that the wheel comes to rest in finite time.2011-07-28