# Distance travelled with constant increasing force

1. Jul 19, 2012

### nrowe

Hi,

First I should explain I am a software engineer and my knowledge of maths and physics has gapping holes.

I also appologise if I have posted in the wrong place.

Here is my problem, I have a known constant increase in my force
f = t * i

f = force
t = time
i = constant increase

so my acceleration becomes a = 0.5 * f * t^2. Producing a nice curved acceleration.

How do I now find distance travelled?

Regards,

Neil

2. Jul 19, 2012

### pgardn

What you have put down looks to be used for a constant force. You would also have to divide the whole right side by m.

You need an equation that describes in what manner the force is Changing with time, most likely.

Is there some equation F = Ma where a = 2(t^2)? or some other mathematical description?

3. Jul 19, 2012

### Ibix

Acceleration is proportional to force, unless the mass is changing. Newton's second law: F=ma. So, in your case, a=(i/m)t. I'm not quite sure where you got your quadratic acceleration from - if you can explain the derivation I might be able to comment.

To get to velocity from acceleration, you integrate with respect to time (you said your maths knowledge has holes - the integral of $ax^n$ with respect to x is $ax^{n+1}/(n+1)$ if a is a constant) and add on the velocity the object had at the start. To get to distance from velocity you integrate one more time.

Does that give you the tools you need?

4. Jul 19, 2012

### cepheid

Staff Emeritus
Just to clarify: "i" is a number with a fixed value? E.g. i = 4 throughout the run of the program? If so, I will call it C because this notation is more typical for a constant. So you have a force that increases linearly with time: F = Ct

How did you get your expression for the acceleration? Unfortunately, I dont think it is correct. It's always the case that F = ma, so it would simply be a = (C/m)t.

Velocity is the derivative of position and acceleration is the derivative of velocity. Therefore, conversely, you would apply the opposite operation of a derivative (an integral) to go the other way. Velocity is the integral of acceleration:

$$v(t) = \int a(t)dt$$

Position is the integral of velocity:

$$x(t) = \int v(t)dt$$

So, to get position as a function of time, you would integrate the acceleration function a(t) = (C/m)t twice.

There are a couple of options. You could compute these integrals analytically (ie with pencil and paper) and get an expression for x(t) that you then put into your code. Or you could compute the integrals numerically (I.e. with the computer itself) by approximating each integral as a sum. Over a small time interval $\Delta t$, the change in velocity is just the rate of change of velocity (acceleration) multiplied by the time interval. Add up all of these small changes to get the total change in velocity over the time range of interest:

$$\Delta v = \sum_i a(t_i) \Delta t$$

Where $t_i$ is the ith time step value. Actually, an integral is just the limit of this sum as delta t approaches 0 anyway. So, in your main loop of your code, if your time step size is called dt, you might compute the new velocity value at the current timestep from the old one like so:

v += a*dt

You could then compute the position values by "integrating" the velocity values in a similar way. This is not a good numerical integration method, but it might be good enough.

If I have misunderstood you, let me know and I will try again.

5. Jul 19, 2012

### nrowe

I am using it to set the rotation increment on a camera. I need to have a nice s curve on the increase of rate of turn and control the max rate of turn, I then need to be able to calculate the distance (number of degrees) to bring the rotation to a fininh so I can land on a target heading.

my first function decides if the cameras rotational Velocity needs to increase or decrease so for the first half of the max rate of turn
f = f + i
then for the second half (till max rate of turn is reached)
f = f - i

Rate of turn is at the same time increased by the force.

rateOfTurn = rateOfTurn + f

Then the plan was to calculate the time to reduce the rate of turn to 0, and to start the process when I was that distance from my target heading.

I welcome any other approaches, but I always hit a brick wall when I wanted a max rate of turn, an ease in to it and to know the displacment.

Thanks again,

Neil

6. Jul 19, 2012

### pgardn

Distance traveled and the number of degrees traveled are different things.

related by D = theta*r

But you appear to just be interested in theta which would be the number of radians which is easily converted to degrees.

When you say and S-curve, you mean an angular acceleration that would create an S- shaped curve for angular velocity v. time? That would require an angular acceleration that also changes with time.

There are also a couple of different "S-curves" you could have for angular velocity in relation to time. I am assuming you want one that starts out slowly (small slopes) and increases to some maximum slope and then levels off again to some maximum angular velocity?

7. Jul 19, 2012

### nrowe

Thanks pgardn

Yes thats correct, so if the max rate of turn was 6 degrees a second then it would start to slow its increase after 3 degrees a second until it got to 6.

8. Jul 19, 2012

### nrowe

Thank you also cepheid

I need this to be faily fast as it will have to run for many objects and update every frame, not that i think it would be a problem but do you think since I explained the problem further that the method you suggested would be a good approach?

Neil

9. Jul 19, 2012

### pgardn

So you would need a function like this degrees (t) = 6degrees(1/(1+(e^-t)))

If you use the above and started a t =-6 seconds and went to t= +6 seconds you would start off slowly, at time 0 (or after 6 seconds you would reach 3 degrees/ second) and then the last 6 seconds you would approach 6 degrees a second. This is just a simple example for you to play with. There are a number of different approaches depending on what rate you want this to change at. You could reach 6 degrees per second very slowly or get very close to starting at 0 degrees per second and reaching 6 degrees/second in 12 seconds.

Bottom line is I have given you one example of an equation you could use in which the angular acceleration changes over a 12 second time period ( I had you go from -6 seconds to 6 seconds just so you could plug in the numbers for yourself for t and see how it looks).

I may be shooting way below your math level but its just an example.

10. Jul 19, 2012

### nrowe

thanks, I will give it a try first thing tomorrow and let you know how it goes.

Neil

11. Jul 19, 2012

### michaelc187

distance is a measure of change in position(x) = x1-x2
velocity is a measure of change in distance = v*t-v*t = x1-x2
acceleration is a measure of change in velocity = a*t*t - a*t*t = v*t-v*t = x1-x2

per newton/per professor antonio rodriguze, dbcc (daytona 1994)
such that
x1-x2 = v(t1-t2) + a(t1-t2)(t1-t2)
oh and force = mass * acceleration... so acceleration = force/mass (newton) != 0.5 * f * t^2

Last edited: Jul 19, 2012
12. Jul 20, 2012

### sophiecentaur

That is correct for uniform acceleration. This problem is more complicated than that.

13. Jul 20, 2012

### michaelc187

Hold editing
excuse me:

x1 - x2= (Sum) [a0*t^(0) + a1*t^(1) + a2*t^(2) + ... + a_z*t^(z)]
z->infinity

14. Jul 20, 2012

### nrowe

I now have super smooth rotation controlled by a super efficient formula. Brilliant!

One question though. I can calculate stopping distance perfectly with maxrateofturn/2*t when at maxrateofturn. But if my rateofturn is lower whats my stopping distance?

(got a feeling my answer is in my question!! so I will keep trying).

Thanks again,

Neil

15. Jul 20, 2012

### pgardn

When you say stopping distance are you talking about a wheel, a flywheel, or what is rotating?

It should be fairly obvious if it is a wheel on the ground, then it depends on the radius of the wheel. A wheel with a radius of 0.1 m is not going to "travel" nearly as far as a wheel with a radius of 1 m given that both are using the same angular acceleration equation. Also in my example, I had you just go for 12 seconds just so you could plug and see numbers. But in reality this equation could be used over a long period of time in which you could end up doing close to "6 degrees a second" (which is not a distance in needs to be converted to distance after we know the radius) for a very large portion of your "trip". So t is important and how "you spread it out" is important.

In my example you would reach very close to 6 degrees/second after only 12 seconds. If you went another 12 seconds (ie from -6 sec to +18 sec) you would be traveling at an angular speed that is coming closer and closer to 6 degrees/second with very tiny changes in angular speed. The longer you go, the the smaller the rate of change of angular velocity (ie you are getting closer and closer to 6 degrees/sec). Now if you use -18 sec to +18 seconds you get a symmetric S (ie one end of the S is not super long)

There are ways to figure it out though. We need the time and we need r. And then we can do this.
BTW I am not a math guy by training Im a biochem guy. So we may need some help from other members once we get t and r...

Last edited: Jul 20, 2012
16. Jul 20, 2012

### nrowe

Sorry I was using bad terminology what Im after is the change in angle from the start of the deceleration.

So if I start this simulation

var maxRateOfTurn = 36;

function onUpdate()
{

object.rot = RotationMath.combine(new Rotation(0, headingVelocity*system.timerDelta, 0), object.rot);
}

My object starts with a heading of 0 degrees and turning clockwise at 36 degrees a second and will come to a stop with a heading of 18 degrees. (maxRateOfTurn/2)

So if I want to start my simulation with a heading velocity 3/4 of the max by setting headingDirection to start at 0.75, what will be my heading when I come to a stop?

Cheers,

Neil

17. Jul 20, 2012

### sophiecentaur

Integral notation would be a better way of stating it, surely and that's been done near the start of this thread.

18. Jul 20, 2012

### pgardn

Jeez... You said you come to a stop at a heading of 18 degrees?

In the equation I gave you... you dont come to a stop (ie 0 degrees/sec).

And also, if you want just the heading you are at end of a certain amount of time in degrees, you are going to have to integrate the equation.

Its like saying I got some complicated equation that describes my velocity thru time. I know what velocity I start at (analogous to your 36 degrees/sec), I know what velocity I will end at after this certain period of time (I dont see this given?). I also know where I started on the number line (this is analogous to you starting at 0 degrees).

Then the question is where do I end up on the number line? You integrate a velocity with respect to time equation to get a change in position with respect to time equation. Then you plug in all your givens and solve. In your case you do not care about the total number of degrees you have traveled, you just want where you end up...