Download Chapter AA

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Transmission (mechanics) wikipedia , lookup

Modified Newtonian dynamics wikipedia , lookup

Classical mechanics wikipedia , lookup

Newton's theorem of revolving orbits wikipedia , lookup

Coriolis force wikipedia , lookup

Derivations of the Lorentz transformations wikipedia , lookup

Equations of motion wikipedia , lookup

Vibration wikipedia , lookup

Precession wikipedia , lookup

Speeds and feeds wikipedia , lookup

Force wikipedia , lookup

Fictitious force wikipedia , lookup

Faster-than-light wikipedia , lookup

Hunting oscillation wikipedia , lookup

Newton's laws of motion wikipedia , lookup

Jerk (physics) wikipedia , lookup

Velocity-addition formula wikipedia , lookup

Inertia wikipedia , lookup

Variable speed of light wikipedia , lookup

G-force wikipedia , lookup

Classical central-force problem wikipedia , lookup

Kinematics wikipedia , lookup

Torque wikipedia , lookup

Rigid body dynamics wikipedia , lookup

Centripetal force wikipedia , lookup

Transcript
Chapter AA.
Physics Revision
1. Motion in 1D
What does notion in 1D concern? Typical examples are (i) a stone which falls
vertically in gravity, it speeds up (ii) a bubble in a glass of beer which rises, (iii) a car
travelling on a straight (Roman) road.
1.1 1D Motion without Friction
First, let’s consider some basic concepts such as speed and acceleration. Speed is how
far we go in a certain time and is measured in km/hr, metres/seconds and so on. The
“/” symbol is read as “per” but implies some sort of arithmetic division. Consider a
car moving with a certain speed v. Then we can appreciate that v can be expressed by
the following formula:
v
x
t
where the symbol  (known as “delta”) is to be understood as “change”. So the
above formula says that speed is the change in position of the car divided by the time
it takes to change its position. Sort of makes sense, since we get metres divided by
seconds.
Now, we have to re-arrange the above formula to use it in our simulations. Why?
Well we are given the speed of the car at a particular time and need to compute its
change in position x . We get this formula:
x  vt
xnew  xold  vt
in other words the change in position is the speed v times the time interval we are
observing the car. We would write this in computer code as follows
x = x + v*dT;
where the x on the left is the new x and the x on the right is the old. You should read
this line of code as “x becomes x plus v times delta t”
So far so good for speed. But now we need to consider the concept of acceleration.
We know that when a car accelerates, its speed changes. So acceleration is concerned
with change in speed. That’s part of the definition, but not the whole story. Consider a
motorbike whose speed changes from 30 km/hr to 70 km/hr in 2 seconds, and a bus
whose speed changes by the same amount in 20 seconds. Clearly the motorbike is
accelerating faster, so we need to take the time for the speed change into account. If
you think about this then a reasonable definition of acceleration is
a
v
t
As in the case of speed discussed above, we are usually presented with a value for
acceleration a and we have to compute the speed change v . So we rearrange the
above formula for a like this:
v  at
vnew  vold  at
Again, we could write this in the following computer code
v = v + a*dT;
Now this is becoming interesting, since both x and v are changing. How do we make
the computation? Well, we must always use the most up-to-date values of our
variables. Since v is changing and v is used to update x, we should first compute v
then x. So our code will look like this:
v = v + a*dT;
x = x + v*dT;
where it is clear that we use the latest value of v (computed in the first line) to update
the position x (computed in the second line). So these computations start from a given
acceleration, update the speed then update the position of the object.
There’s one small issue. Where does the acceleration come from? Well, physics tells
us that this is Newton’s second law, which presents the concept that an object
accelerates when a force is applied to it. So a car accelerates due to the force exerted
on its tires by the ground (mmm, think about that one). A cup attached to a rubber
band will accelerate upwards when the band is stretched downwards. Anyway,
Newton gave us the following relationship between acceleration force and mass:
a
F
m
This makes sense. Consider a car and a bus with the same engine which therefore will
produce the same force. What can we say about their accelerations? Clearly the car
will accelerate faster. The above formula tells us that, since when we divide the force
by the larger mass of the bus, the resulting acceleration will be smaller.
So this is our physics thinking
-
Find the force on the object
Calculate its acceleration
Update its speed
Update its position.
Here’s how we would write that in computer code (shown inside Unreal’s “tick”
function):
function Tick(float dT) {
local vector newLocn;
aX = ForceX/mmass;
vX += aX*dT;
x += vX*dT;
// ================ COMPUTATION
newLocn = origLocn;
newlocn.X = origlocn.x + x;
setLocation(newLocn);
localTime += dT;
// ================ VISUALISATION
}
1.2 Motion with Friction
Let’s take a simple case where there is a constant friction (or “damping”) force which
acts in the opposite direction to the accelerating force. This will turn out to be a
terrible example which never occurs in nature, but it will give us a place to start.
Here’s the situation, our car with the accelerating force F and the damping damp.
damp
F
The car is accelerating to the left and the damping is pushing on the front of the car,
attempting to model air-resistance.
The formula for the acceleration of the car now becomes
a
( F  damp)
m
Now let us consider the simple case, where the car is out of gear and it is coasting to
rest, ie F = 0, so it is being slowed down by damp.
Then we have
v
damp
a
t
m
and solving for the speed update we get
v  
damp
t
m
Let’s take some concrete values, mass=1, damp=2 and we shall take the time interval
to be 1 second. So each second, the speed changes by -2 units. If we start with an
initial speed of 10, then here’s how the speed will decrease:
v
0
1
2
3
4
5
10
8
6
4
2
0
constant damping
12
10
8
speed
t
6
Series1
4
2
0
0
1
2
3
4
5
6
time
and the car will come to rest after 5 seconds.
But physics does not work like this! Frictional damping has been widely studied and
there are several models of damping. One important one says that the faster you are
moving, the greater the damping. (Think about walking slowly or quickly in a
swimming pool or in the sea). This is translated into a formula as follows:
v
damp

v
t
m
so solving for speed change we have
v  
damp
vt
m
Let’s take some concrete values: damp = 0.2, mass = 1 and the time interval again is
1 second. Now the above formula becomes
v  0.2vt
So if we start with an initial speed of 10 units, the first v is -0.2 x 10 x 1 = 2. So the
speed drops to 8. Now in the next time interval of 1 second, the speed drops by – 0.2 x
8 x 1 = 1.6. So in each additional time interval, the speed drops by a smaller amount.
Carrying on, this is what we get.
12
speed
10
8.187308
6.7032
5.488116
4.49329
3.678794
3.011942
2.46597
2.018965
1.652989
1.353353
10
8
speed
time
0
1
2
3
4
5
6
7
8
9
10
6
Series1
4
2
0
0
2
4
6
8
10
12
time
This curve is called “exponential decay” and is a characteristic of damping in many
other physics situations, such as the height of water in a bucket with a hole in the
bottom as the water leaks out, and the amount of radioactivity in a rock as the
radioactive element decays.
But there is another reason why this damping formula is important. Let’s look at it
again:
v  
damp
vt
m
Look at the minus sign (“ – “ ). Well this is interesting, because we have velocity v on
the right hand side of this formula. So if v is positive (ie the car is moving to the right)
then v , the change in speed is negative (to the left), so the speed decreases. That
makes sense, since that’s what friction does. But what about if v is negative (ie the car
is moving to the left)? Well then v is positive (to the right) so again the speed
decreases. In both cases v is in the opposite direction to v, so in both cases the car
slows down due to damping.
In the case of the simple-minded damping described by the formula
v  
damp
t
m
then the damping is always in the negative direction, so if the car is moving in this
direction, then damping will make it accelerate. This is clearly nonsense!
How can we fix this formula? We have to include information about which direction
the car is moving in, in other words whether its speed is positive or negative. Here’s
the fix:
v  
damp  v 
  t
m  v 
 v 
Here the symbol v means the size of v. So the calculation   means divide v by
 v 
 
its size. So if v=+3 then we divide 3 by 3 to give 1. But if v=-3 then we divide -3 by
3 to give -1. The result is that in both cases v is in the opposite direction to v
(because of the minus sign).
How do we do this in code? Simple.
v = v – (damp/mmass)*(v/abs(v))*dT;
2. Motion in 2D: Projectiles.
Let’s consider a ball thrown into the air at a certain angle upwards like this:
z
vZ
vX
x
where it is moving in the x-z plane. The crucial point to note is that since the x and z
axes are at right-angles (“orthogonal”), no amount of pushing or pulling in the x
direction can change the object’s speed in the z direction (and vice-versa). These axes
are independent, they do not affect each other. So we can write update equations for
each axis separately, like this. First for the x direction
Fx
m
v x  a x  t
ax 
x  vx t
and second for the z direction
Fz
m
v z  a z t
az 
z  v z t
where vx means the velocity component in the x direction and so forth. So our code
would read something like this:
function Tick(float dT) {
local vector newLocn;
aX = ForceX/mmass;
vX += aX*dT;
x += vX*dT;
// ================ COMPUTATION
aZ = ForceZ/mmass;
vZ += aZ*dT;
z += vZ*dT;
newLocn = origLocn;
newlocn.X = origlocn.X + x;
newlocn.Z = origlocn.Z + z;
setLocation(newLocn);
localTime += dT;
// ================ VISUALISATION
}
However, we can make the computation in a much more elegant way, using the
vector data type. Let’s see how. The location of an object in our level, and its velocity
can be represented by two vectors, as shown below on the left. Note that underlined
symbols implies a vector quantity, so s represents the location vector of our moving
object and v represents its velocity (both in 3D, although our drawing will use 2D
space).
vt
v
s
s NEW
s
When the object moves, the vector s is changed by the addition of an additional
displacement along the direction of the velocity given by vt . As shown above on the
right, this results in a new location vector s NEW .
The code to compute with these vectors is shown below, which is clearly quite
compact.
function Tick(float dT) {
local vector acceln;
acceln = force/mmass;
vely = vely + acceln*dT;
s = s + vely*dT;
// =========== COMPUTATION
newLocn = origLocn + s;
setLocation(newLocn);
// =========== VISUALISATION
}
3. Rotational Motion
The above examples have concerned movement though space, where the location of
the object changes with time. There is another aspect to movement, where an object
remains at the same location in space, but rotates around that location. An example of
such a system is the “Skymaster” fairground ride at Butlins, Minehead. Here are a
couple of images of the ride with some familiar people there.
JSM on ride
CBP on ride
Here’s a series of images of the motion of the ride, (from the side view) which shows
one complete cycle of the oscillation of the ride. The Skymaster rotates, and
ultimately turns over a complete circle. This rotation is driven by an impulse applied
by the ride operator, via a small joystick.
The physics of this ride is very similar to the physics of a falling object (force ->
acceleration -> speed change -> position change) except here we are considering
rotation and not translation. So we need to introduce some new vocabulary and
symbols, but these are directly related to those of the physics of translation. Here’s a
first mapping:
Translation
time
position
speed / velocity
acceleration
force
mass (inertia)
law of motion
t
x
v
a
F
m
F = ma
Rotation
time
angle
angular velocity
angular acceleration
torque
moment of inertia
law of motion
t



T
I
T  I
Let’s now have a look at the definition of the translation quantities, and so discover
the definition of the rotation quantities
Translation
time
position
t
x
Rotation
time
angle
t

x
t
v
a
t
F= ma
m
speed / velocity
v
acceleration
force
mass (intertia)
angular velocity
angular acceleration
torque
moment of inertia

t


t
T  I
I   mr 2

The position x in translation dynamics corresponds to the angle  in rotational
dynamics. Here’s our calculations for the translational dynamics (copied from above,
with the equivalent rotational dynamics);
ax 
Fx
m
v x  a x  t
T
I
  t
x  vx t
  t
translational dynamics

rotational dynamics
but there are two new concepts here. First we do not have a force but we have a
torque and second, we do not have a mass but we have a moment of inertia. Let’s
explore these concepts. First let’s look at the concept of torque. Look at the figure
below.
F
F
(a)
(b)
This shows a top-down view on a door (horizontal rectangle) which is hinged on its
pivot (solid circle). Two people try to open this door, the guy in (a) tries to push the
door near the hinge and the guy in (b) pushes the door well away from the hinge.
Which door opens faster/easier? If you can’t work it out, then find out by doing an
experiment on your nearest door.
It’s clear, by thought or experiment that the door (b) opens ‘faster’. In both cases, the
force applied to the doors is the same, so there is some other factor which influences
the speed of opening. This is clearly the distance from the application of the force to
the pivot point, and this leads us to the definition of ‘torque’.
So here’s a pictorial definition of torque (think ‘torque wrench’) in a more general
scenario. Here we’re pulling down with a force, but the bar is at an angle. The torque
is calculated as the force times the perpendicular distance to the pivot point. This
distance is L sin  . So the torque is FL sin  ,

L
L sin 
F
This kind-of makes sense: Say that the bar is pointing downwards. Then pulling down
will not make it rotate, so there is no torque. Here  is zero and sin  is also zero.
Another view on the situation may help. It is clear that any force along the axis of the
bar will not make it rotate, it’s only the component of the force at right-angles to this
which makes the bar rotate. So this component of the force, which has magnitude
F sin  provides the torque which again is FL sin  . Here’s a diagram to help:

L
F sin 

F
The Skymaster, when positioned at a particular angle  from the vertical looks like
this,
Here the arrow pointing down labelled “mg” is the force of gravity pulling the
Skymaster down. Normally this force would accelerate the Skymaster downwards, but
of course this does not happen because the pivot point (empty circle) exerts an equal
force upwards. The total force on the Skymaster is zero, so it doesn’t budge. But the
downward force does something else it generates a torque.
We have drawn the Skymaster at an angle  . We can split the downward force mg
into two components, one through the pivot mg cos  , and one at right-angles to it
mg sin  . As we saw in class, only the component at right-angles can cause a rotation
L
since this provides a torque mg sin    where L is the total length (height) of the
2
Skymaster. Of course there is also a damping term (from air resistance and
mechanical friction) which acts in the opposite direction to the angular velocity. So
then the expression for the torque becomes
L
mg sin     b
2
T
where I is the moment of
I
inertia of the object. Here we will make a drastic assumption, that all of the mass of
the Skymaster is contained in the cage at the bottom. It makes life easier and does not
detract from the fidelity of the physics simulation, only its accuracy. In that case if m
is the mass of the cage and L is the length of the SkyMaster’s arm then we have
Now this torque T produces an angular acceleration  
I m
L2
4
The above two expressions are sufficient to allow us to calculate the angular
acceleration and therefore compute the behaviour of the SkyMaster and hence to
visualise it.
The visualisation code is quite straightforward.
newRot = origRot;
rolll = 65536*theta/(2*pi);
newRot.roll = origRot.roll + rolll;
self.setRotation(newRot);