Applying constant acceleration frame by frame

In summary, Diazona said that the equation for distance travelled is s = \frac{1}{2}(u + v)t, but that when using the equation s = ut + \frac{1}{2}at^2, the distance travelled will be less than the original value.
  • #1
CBridgman
2
0

Homework Statement



Hi, I am working on a camera system in flash, and am trying to implement an ease in/out effect where the camera moves between two points, with positive acceleration up to the midpoint, and then negative accelaration up to the end point.

I've had a look through the equations of motion article on wikipedia, and understand how to use the various formulas, but my understanding of how to apply acceleration is not matching what the formulas tell me, and I need to understand why in order to apply the acceleration per frame.

Homework Equations



Consider the following:

Given
u (initial velocity) = 0
v (end velocity) = ?
a (acceleration) = 2
t (time interval) = 5
s (distance) = ?

Calculate end velocity
v = u + at (where: v = ?, u = 0, a = 2, t = 5)
v = 0 + 2 * 5
v = 10

Calculate distance
s = 1/2(u + v)t
s = 1/2(0 + 10)5
s = 5 * 5
s = 25

Right, so fair enough, except that I don't understand how you can end up moving a distance of 25 (an odd number) if you're adding an even acceleration number (2) to the velocity per frame. I.e:
Frame 1. Velocity = 2, Distance = 2
Frame 2. Velocity = 4, Distance = 6
Frame 3. Velocity = 6, Distance = 12
Frame 4. Velocity = 8, Distance = 20
Frame 5. Velocity = 10, Distance = 30
(Per frame, I go: velocity = velocity + acceleration)

Since the camera is moved in discrete time intervals (for the simplicity's sake, let's say it's running at one frame per second), I must add the acceleration constant to the velocity in the manner shown above, which produces a distance value that doesn't equal what the equations are telling me.

The Attempt at a Solution



Well, after filling a few pages with calculations, I decided I'd try ask here. ;)

Could anyone please tell me where I'm going wrong?
 
Last edited:
Physics news on Phys.org
  • #2
The universe doesn't operate in discrete steps :wink: For example, in frame 1, you wrote velocity = 2 and distance = 2. Well, in reality, the velocity is indeed 2, but it hasn't been 2 in the entire time between "frame 0" and frame 1. It starts out at 0 and steadily increases up to 2. So the actual distance traveled will be less than 2 - in fact, it will be 1. That's just what you get out of the equation [itex]s = \frac{1}{2}(u + v)t[/itex].

Try using the equation [itex]s = ut + \frac{1}{2}at^2[/itex], it might be more useful for you.
 
  • #3
Ahaa, thanks diazona. (Slaps self for being silly, etc) It's not so much that I thought the universe operates in discrete steps, but that the formulae could be used in discrete steps, and indeed they can, if applied correctly.

So, instead of doing this:
velocity = velocity + acceleration
x = x + velocity

I'll do this:
velocity = velocity + (acceleration / 2)
x = x + veloicty
velocity = velocity + (acceleration / 2)

Since only half of the distance for the acceleration is applied over a particular time period, the velocity must be updated both before and after movement is applied.
 

FAQ: Applying constant acceleration frame by frame

What is constant acceleration?

Constant acceleration is the uniform rate at which an object's velocity is changing. This means that the object's speed increases or decreases by the same amount in each unit of time.

How is constant acceleration applied frame by frame?

To apply constant acceleration frame by frame, you must first determine the object's initial velocity and acceleration. Then, using the equations of motion, you can calculate the object's position and velocity at each frame by plugging in the values for time.

What are the equations of motion used in applying constant acceleration frame by frame?

The equations of motion used for applying constant acceleration frame by frame are:
- Velocity: v = v0 + at
- Displacement: x = x0 + v0t + 1/2at2
- Acceleration: a = (v - v0)/t
Where v is final velocity, v0 is initial velocity, a is acceleration, x is displacement, x0 is initial displacement, and t is time.

What are some real-life applications of applying constant acceleration frame by frame?

Constant acceleration is used in many real-life scenarios, such as:
- Objects falling due to gravity
- Cars accelerating or decelerating
- Rockets launching into space
- Roller coasters
- Projectile motion, like a basketball being thrown into a hoop

What are some common mistakes to avoid when applying constant acceleration frame by frame?

When applying constant acceleration frame by frame, it is important to remember the following:
- Make sure to use consistent units for time, velocity, and acceleration
- Double check your calculations to avoid errors
- Consider the direction of the acceleration when determining the sign of the velocity
- Use the appropriate equation of motion for the given scenario
- Take into account any external forces that may affect the object's motion

Similar threads

Replies
38
Views
3K
Replies
3
Views
813
Replies
5
Views
2K
Replies
6
Views
505
Replies
3
Views
1K
Replies
11
Views
1K
Replies
4
Views
1K
Replies
6
Views
1K
Back
Top