Another Look at Friction in Bad Piggies

How does friction work in Bad Piggies? Wired Science blogger Rhett Allain gives this persistent problem another shot.
Image may contain Angry Birds

I have been bothered with my last model for the frictional force in Bad Piggies. It seems the biggest problem with my last Bad Piggies friction post was the data. I used a level that didn't really let the vehicle roll far enough. Add to that, I had a moving background. With the background moving and the vehicle moving, there are two things that needed to be "tracked". I suspect the error associated with this made it difficult to find a good model.

I am ready to try again. Here is a shot from the level I used. It is level 2-21.

Screenshot 3 1 13 4 49 pm

Why is this level? First, it is nice and flat. Everyone likes flat, right? Second, I did something useful. I left the pig on the ground at the starting location. If you put the pig in the vehicle, the "camera" will want to follow the pig. I want the camera to be stationary. Without the pig, it does just that. And now I only need to track one thing - the vehicle.

Here is the position of a cart after I turned off the fan. Of course, I am using Tracker Video Analysis to get this data.

Screenshot 3 1 13 5 07 pm

Ok, a super quick friction review. If friction in Bad Piggies works like it does in our real world, then the following would be true for a block sliding on flat ground (which would be just like the friction force for a cart rolling - well, almost).

Screenshot 3 1 13 5 14 pm

I know I skipped a few steps - but if you want a more detailed view on friction, look at my previous friction post. The point is that if I use the typical real-world model for friction, a cart should have a constant acceleration. Well? Does the above data show constant acceleration? It would appear so - only it doesn't. Here is a plot of the velocity for that same cart.

Screenshot 3 1 13 5 17 pm

If the acceleration was constant, this would be a straight line with the slope being the acceleration. In this case, I can fit a quadratic function that seems to work. This quadratic fit gives a function for velocity. If I take the derivative with respect to time, I can get an expression for the acceleration.

Screenshot 3 1 13 5 27 pm

Well, is that it? Is that how friction works in Bad Piggies? I'm not sure. Let's try a couple more runs and see if they have a similar fit for the acceleration.

Here are 5 more runs. I know, I got out of control. For this data, I adjusted each run so it started at the position x = 0 m and time t = 0 seconds.

Screenshot 3 2 13 6 41 pm

For each of these runs, a cubic equation fits very nicely. So, this leads me to try to develop some model for the acceleration. My first guess was that the carts didn't have a constant acceleration (well, that's obvious) but instead had a constant time derivative of the acceleration (technically, this is called the jerk). I can use the letter j to represent the jerk such that.

Screenshot 3 2 13 6 51 pm

Actually, because a cubic equation fits the position data so well that implies that there is a constant jerk (which I could call K). I won't derive it, but instead just give you the kinematic equation for an object with constant jerk.

Screenshot 3 2 13 9 00 pm

By comparing this to cubic fit, I can get the initial acceleration and the jerk.

Let me stop for a second. I keep saying "jerk" and I can't help but think of the Steve Martin movie The Jerk. To celebrate this movie, I made an image.

Screenshot 3 2 13 6 54 pm

I just hope that Google Glass doesn't cause the same problem the optigrab caused. Although that would make a good element to a movie about Google. Update: I just listened to previous episode of This Week in Tech and they basically had the EXACT same joke. Maybe we both stole this joke from some other place or maybe it is just an obvious joke.

Ok, back to physics. The jerk values for these 5 runs are low - but they aren't the same. I actually thought that the jerk value was dependent on the initial velocity, but now I'm not so sure. Here is a plot and fit of the initial velocity and the jerk.

Screenshot 3 2 13 9 52 pm

Really, I need more data. This looks linear, but you could also say it looks quadratic. Or maybe you could say that these are all about the same. Let me start with the idea that the jerk is the same for all of these runs. From this data, I get an average jerk of 0.192 m/s3. Using this with a numerical model gives a position very close to the data from the game. Of course, why wouldn't it? Well, the one reason would be that the different runs had a slightly different value for the jerk. But for now, I will not worry about that. I think there is one more thing to do. I need to get a better estimate for the initial values for acceleration and velocity. In the above, I used the fit to find the initial acceleration.

Here is a fit from the same cart in Bad Piggies. However, for this case I will look at both the speeding up part and the slowing down part. This plot shows both the velocity and the position for this cart.

Screenshot 3 2 13 10 24 pm

What can I get from this graph? It looks like the velocity and position at the beginning of the friction part of the motion are the same as right before that motion started. But what about the acceleration? With the fan on, it has a positive acceleration and then this goes to a negative value with the fan off. Ok - maybe there is a relationship between these two. The problem is that the jerk for this example is 0.306 m/s3. In case you aren't reading carefully, this is higher than my previous values.

I'm going to stop here. Let me summarize what I have.

  • For a cart slowing down with just friction, it seems to have a constant jerk.
  • The value of the jerk depends on something. Different cases have slightly different jerks.
  • I'm not sure about the starting acceleration for this friction motion.

What can I do? I guess I need to collect more data. With more data I can try to get a model for both the jerk and the initial acceleration. I guess that will be another post. This one is already too long. I hate when I don't finish my projects - mostly because I can't stop thinking about new ways to get to the answer.