Skip to content

The Evil Head of Friction

This tutorial introduces the notion of friction. Basically speaking, friction is any force that retards or consumes energy from another system — like Facebook.

In all previous tutorials, all surfaces were assumed to be smooth, and that objects could slide as far as they wanted, without encountering any resistance to their motion. Yet, it is clear that no surface is perfectly smooth, as even the smoothest looking surfaces are rough and jagged when viewed at the atomic level.

People often associate friction as something that should be reduced and eliminated at best. For example, automobiles use roughly forty percent of the available energy to overcome friction from thermal conversion or mechanical frictions, which means that about twenty percent of the petrol tanked is used for nothing but to overcome internal frictions. Clearly, reducing that friction would be very desirable.

On the other hand, however, there would be no movement without friction. It is the friction between our feet and the Earth that allows us to move — just look at how hard it is when friction is but reduced when trying to walk on ice, for example.

Since friction is caused by random, microscopic irregularities and since it is affected by factors that cannot be controlled, it is impossible to state a simple law of nature that would govern all frictional forces. It is however possible to state a few rules of thumb that allow to compute approximations to model frictional forces well enough.


Let be a force. As in the previous tutorials, by abuse of language, we will write , if it is clear, from the context, that we are only interested in the magnitude of the force, and not in its direction or sens.


Kinetic Friction

Kinetic friction comes into play whenever surfaces slide against each other. The force generated by this type of friction will be denoted by . As a general rule of thumb, the norm of the force of kinetic friction is proportional to the magnitude of the normal force acting upon an object: , where is the acceleration due to gravity. The constant expressing that proportionality is the * coefficient of kinetic friction*. In other words, the greater the greater the friction. Note that the above equation is not a vector equation, as the direction of the kinetic friction is, in general, not the same as the direction of the normal force, but parallel to the direction of motion, in the opposite direction.

It is also important to note that the magnitude of kinetic friction does not depend on the relative speed of the surface, nor on the area of contact between surfaces. This second statement might be a bit counterintuitive, but it follows the same reasoning used when computing the centroid of a convex polygon: If the area of contact is considerable, the normal force is spread out over a large area, resulting in small forces per area, and thus the atomic imperfections are not pressed as deeply against each other. If the area of contact is small, the atomic imperfections in that area come into consideration with full force.

Kinetic Friction

Static Friction

Static friction is the force that keeps two surfaces from moving relative to one another — once again due to atomic imperfections of the surfaces that are in contact. Static friction is often stronger than kinetic friction because when surfaces are in static contact, their imperfection, i.e. the microscopic hills and dents, had time to deeply nestle into each other.

There is an upper limit to the magnitude of static friction, denoted by , which denotes the point at which the static friction can no longer keep an object from being moved, thus the force of static friction, noted by , can have any value between zero and the maximal value mentioned above: , where the magnitude of is once again proportional to the magnitude of the normal force , with being called the coefficient of static friction.

As for kinetic friction, the static friction does not depend on the area of contact.

The coefficient of static friction is, as was already mentioned, often greater than the coefficient of kinetic friction. The following table lists a few of the most common frictional coefficients:

MaterialKinetic FrictionStatic Friction
Rubber on dry Concrete0,80,9
Steel on Steel0,570,74
Wood on Leather0,40,5
Rubber on Grass0,350,35
Rubber on wet Concrete0,250,3
Steel on Ice0,060,1
Glass on Glass0,40,94

Anti-Lock Breaking Systems

Imagine a car driving on the road with the tires rolling freely. Is the friction between the tires and the road kinetic or static?

The answer might be a bit surprising, the friction between the tires and the road is actually static. An easier way to understand that, is to watch your motion: Each time your foot is on the ground, it is actually static, as in, not moving relative to the ground. The same is true for the tires of a car: as long as the tires are rolling, the friction is static: if the car skips, however, the friction is kinetic. It follows that a car can be stopped in less distance over time if its wheels are rolling than if its wheels are locked up, which is the idea behind the anti-lock breaking system (ABS). When the brakes are applied on a car with ABS, an electronic sensor detects whether a wheel is about to start skidding, and if so, a small computer quickly modulates the hydraulic pressure in the brake lines in short bursts, causing the brakes to release and then reapply in rapid succession. This way, the tire can continue rolling, and thus static friction still determines the stopping distance over time.

Implementation

As seen in the previous tutorial, all forces can be represented in the same way , thus, to model friction, it is enough to add the magnitude of the frictional force as a negative acceleration to the by now well-known equation of motion and once again the symplectic semi-implicit Euler integrator will do all the hard work for us. Note that it is possible to apply as many frictional forces to an object as needed, by simply adding them up.

Demo: Kicker

As an example, I created a small kicker or air hockey demo. Pressing the space button fires a ball on a virtual kicker table in a random direction. Using the arrow keys, the direction of movement and the initial velocity of the ball can be changed. The keys Q and A can be used to increase or decrease the coefficient of kinetic friction.

The position of the ball is updated using semi-implicit Euler, as follows:

void Ball::update(const double deltaTime, const float frictionK)
{
if (isRolling)
{
physics::Kinematics::semiImplicitEuler(*position, *velocity, *acceleration, deltaTime);
// adjust sign of the acceleration
acceleration->x = std::copysignf(acceleration->x, -velocity->x);
acceleration->y = std::copysignf(acceleration->y, -velocity->y);
if (velocity->getSquareLength() < 0.1f)
reset(frictionK);
}
}

Once the symplectic integrator returns the new position and velocity of the ball, the new acceleration is set to point in the opposite direction of the movement using the std::copysignf function.

Note that to simulate collisions with the rectangular table, it is sufficient to remember that the angle of reflection equals the angle of incidence. Read the tutorial about basic collision response for more details on this subject.



You can download the source code from here.


Friction on an Inclined Plane

To see how friction works on an inclined plane, it is useful to first analyse the situation of a mass being in equilibrium on an inclined plane. We set the axes of the coordinate system to be along the movement of the object, i.e. the -axis is o the same line as the static friction vector, and the -axis is perpendicular to the -axis:

Object with mass m on an inclined plane

To see what happens, we break down the forces into their - and -components.

For the -axis, we have a force due to gravity, namely , where is the angle of inclination, and a force due to the static frictional coefficient, namely . Since the object is in equilibrium, the sum of those forces, noted as is zero: .

For the -axis, we only have the gravitational force to consider, which is in the opposite direction of the normal force: .

From this second equation, we can deduce the value of the normal force: , thus the first equation can be written as: , thus . From this equation, we can deduce the critical angle, at which the mass starts to slide, , or, in English, the critical angle is equal to the inverse tangent of the static coefficient of friction.


Now what happens when the mass actually starts to slide? As we have seen, the movement is governed by the following equation: . Note the use of the coefficient of kinetic friction in this formula!


To use this in a game, remember that , thus each cycle the velocity of the mass is increased by in the -direction. Just note that all the computations were done in the coordinate system defined by the object itself. To use the coordinate system of the underlying screen, simply multiply the new velocity vector by the vector , where continues to be the angle of inclination:

// update position
posX += velX;
posY += velY;
// update velocity
velX += cos(theta) * g * (sin(theta) - friction * cos(theta));
velY += sin(theta) * g * (sin(theta) - friction * cos(theta));

References

  • Differential Equations, by Prof. Dr. K.-F. Siburg
  • Dynamical Systems, by Prof. Dr. K.-F. Siburg
  • Geogebra
  • Physics, by James S. Walker
  • Tricks of the Windows Programming Gurus, by A. LaMothe
  • Wikipedia