Applying constant acceleration frame by frame

AI Thread Summary
The discussion focuses on implementing a camera ease in/out effect using constant acceleration in a Flash system. The user struggles with applying acceleration frame by frame, leading to discrepancies between calculated and expected distances. They initially used a simplistic approach to update velocity and distance but realized that the formulas needed to account for the gradual increase in velocity over time. A suggestion was made to use the equation s = ut + 1/2 at^2 for more accurate distance calculations. The user acknowledged the mistake and adapted their approach to update velocity before and after movement, effectively resolving the issue.
CBridgman
Messages
2
Reaction score
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
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 s = \frac{1}{2}(u + v)t.

Try using the equation s = ut + \frac{1}{2}at^2, it might be more useful for you.
 
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.
 
I multiplied the values first without the error limit. Got 19.38. rounded it off to 2 significant figures since the given data has 2 significant figures. So = 19. For error I used the above formula. It comes out about 1.48. Now my question is. Should I write the answer as 19±1.5 (rounding 1.48 to 2 significant figures) OR should I write it as 19±1. So in short, should the error have same number of significant figures as the mean value or should it have the same number of decimal places as...
Thread 'A cylinder connected to a hanging mass'
Let's declare that for the cylinder, mass = M = 10 kg Radius = R = 4 m For the wall and the floor, Friction coeff = ##\mu## = 0.5 For the hanging mass, mass = m = 11 kg First, we divide the force according to their respective plane (x and y thing, correct me if I'm wrong) and according to which, cylinder or the hanging mass, they're working on. Force on the hanging mass $$mg - T = ma$$ Force(Cylinder) on y $$N_f + f_w - Mg = 0$$ Force(Cylinder) on x $$T + f_f - N_w = Ma$$ There's also...

Similar threads

Replies
3
Views
719
Replies
38
Views
4K
Replies
5
Views
3K
Replies
6
Views
914
Replies
10
Views
962
Replies
4
Views
2K
Back
Top