Showing posts with label elastic collision. Show all posts
Showing posts with label elastic collision. Show all posts

Monday, March 26, 2012

HP 50g: Elastic Collisions

Welcome to Blog Entry #66

This is a program for some solving elastic collision problems for the Hewlett Packard 50g calculator.

Variables (refer to the diagrams above):

MA = mass of object A
VA = initial velocity of object A
θA = initial angle of A

MB = mass of object B
VB = initial velocity of object B
θB = initial angle of B

FA = final velocity of object A
αA = final angle of object A

FB = final velocity of object B
αB = final angle of object B

To type θ, press ΑLPHA right-shift T

To type α, press ALPHA right-shift A

Program:

PROGRAM NAME: ELASTIC
(spaces added for readability)

<< DEG
{ ' MA * VA * COS(θA) + MB * VB * COS(θB) = MA * FA * COS(αA) + MB * FB * COS(αB) '
' MA * VA * SIN(θA) + MB * VB * SIN(θB) = MA * FA * SIN(αA) + MB * FB * SIN(αB) '
' .5 * MA * VA^2 + .5 * MB * VB^2 = .5 * MA * FA^2 + .5 * MB * FB^2 ' }
'EQ' STO
MINIT
"Elastic Collisions"
{ ' MA ' ' VA ' ' θA ' ' MB ' ' VB ' ' θB ' ' FA ' ' αA ' ' FB ' ' αB ' }
MITM MSOLVR >>

Angle Guide

Examples: (FIX 4)

Example 1:

Known:

MA = 1.2450
VA = 40.0000
θA = 30.0000

MB = 0.9780
VB = 45.0000
θB = 225.000

FA = 25.0000
αA = 170.0000

Solved:

FB = 57.1505
αB = 40.2485

Example 2:

Known:

MA = 4.0000
VA = 3.4565
θA = 0.0000

MB = 4.0000
VB = 4.5000
θB = 270.0000

FA = 2.8750
αA = 170.0000
αB = 80.0000

Solved:

FB = 10.2957


This blog is property of Edward Shore. © 2012



Wednesday, March 21, 2012

Collisions: Elastic and Inelastic

Welcome to blog entry #65! This is the first blog entry using the new Apple iPad (3rd generation, white with 64 GB, so excited)

Introduction

In physics when two objects collide, in general, one of two things can happen:

* They can stick together, producing an inelastic collision, or

* They can bounce off of each other, producing an elastic collision.

In realty, each collision lies somewhere in between inelastic and perfectly elastic, but we will deal with the general cases here.

As the diagram above shows objects A and B are headed on a collision course; each one with their own mass, velocity, and direction. If A and B combine, let C represent the object formed from both A and B.

Define the following variables as:

MA = mass of object A
MB = mass of object B
MC = combined mass of objects A and B = mass of object C

Prior to Collision
VA = initial velocity of object A
VB = initial velocity of object B
θA = initial angle of direction of object A
θB = initial angle of direction of object B

After Collision - Inelastic Collision
FC = final velocity of the aggregate object after objects A and B collide
ΦC = final angle of the aggregate object after objects A and B collide

After Collision - Elastic Collision
FA = final velocity of object A
FB = final velocity of object B
ΦA = final angle of object A
ΦB = final angle of object B

In this blog entry, we will assume we know all the initial conditions VA, VB, θA, and θB. Additionally, assume that friction is negligible, and not a factor in calculation.

A Word About Direction Angle
Angle is used to dictate the direction of the object. 0° is considered going due right (east) (postitive in the x-direction only). If the direction angle is 90°, the object is going due up (north), positive in the y direction only. Refer to the diagram below.



Inelastic Collisions

In inelastic collisions, when objects collide, they tend to "stick" together. Examples include a car wreck or a when football (rugby) defensive end tackles a wide receiver.

Only momentum is conserved in inelastic collisions. Kinetic energy that was given by the two objects is lost. Some energy is either vibrations or heat given by the combined object.

The equation for momentum is: P = m * v, where m is mass and v is velocity.

When solving for the general case, we have to deal with the total momentum in both the x-direction and the y-direction.

The initial momentum for each direction respectively is:

Px = MA * VA * cos θA + MB * VB * cos θB (1)
Py = MA* VA *sin θA + MB * VB * sin θB (2)

Since momentum is conserved, the total initial momentum must be equal to the total final momentum, in the x- and y-direction. Hence:

Px = MC * FC * cos ΦC (3)
Py = MC * FC * sin ΦC (4)

where MC = MA + MB (5)

As a result, we have two equations of two unknowns: VC and ΦC. A calculator (such as HP 50G, TI 89, TI nSpire) or a sufficient mathematics computer program can solve the set of equations easily.

Since the equations are relatively simple, we can find explicit solutions by the following strategy.

First, solve for ΦC. Either equation (3) or (4) can be used. For this blog entry, I will use equation (3).

Px = MC * FC * cos ΦC
Px / (MC * FC) = cos ΦC

Then ΦC = arccos (Px / (MC * FC)) (6)

Sub into (4) to get:

Py = MC * FC * sin (arccos (Px / (MC * FC)))

Note that sin(arccos x) = √ (1 - x^2). Also cos(arcsin x) = √ (1 - x^2)

Then:

Py = MC * FC * √ ( 1 - (Px / (MC * FC))^2 )
Py = MC * FC * √ ( ( MC^2 FC^2 - Px^2 ) / (MC^2 * FC^2) )
Py = (MC * FC * √ ( MC^2 FC^2 - Px^2 ) ) / (MC * FC)
Py = √ ( MC^2 * FC^2 - Px^2 )

Square both sides and rearrange terms:

MC^2 * FC^2 = Py^2 + Px^2

Solving for FC gives:

FC = √ ( (Py^2 + Px^2) / MC^2 ) (7)

(We can just take the principal root, since the ΦC will take care of the direction of object C)

In Summary:
MC = MA + MB
FC = √ ( (Py^2 + Px^2) / MC^2 )
ΦC = arccos (Px / (MC * FC))

This is a solution for an inelastic collision for any two objects of any mass, velocity, and direction angle.

Elastic Collisions

In perfectly elastic collisions, when objects collide, they tend to "bounce off" each other. Examples include a sub-atomic gas particle collision or two billiard balls hitting each other.

Like inelastic collisions, momentum is conserved in inelastic collisions. Unlike inelastic collisions, kinetic energy is also conserved.

The equation for momentum is: P = m * v, where m is mass and v is velocity.

When solving for the general case, we have to deal with the total momentum in both the x-direction and the y-direction.

The initial momentum for each direction respectively is:

Px = MA * VA * cos θA + MB * VB * cos θB (1)
Py = MA* VA *sin θA + MB * VB * sin θB (2)

The equation for kinetic energy is: KE = 1/2 * m * v^2. Kinetic energy does not take separate compenent directions into account.

The initial kinetic energy is:

KE = 1/2 * MA * VA^2 + 1/2 * MB * VB^2 (8)

Since momentum and kinetic energy are conserved, the total initial momentum must be equal to the total final momentum, in the x- and y-direction; and the total initial kinetic energy must be equal to the total final kinetic energy. Hence:

Px = MA * FA * cos ΦA + MB * FB * cos ΦB (9)
Py = MA * FA * sin ΦA + MB * FB * sin ΦB (10)
KE = 1/2 * MA * FA^2 + 1/2 * MB * FB^2 (11)

Note if we do not know anything about the final conditions, then we are dealing with a system of three equations with four unknowns: FA, ΦA, FB, and ΦB.

In order for this system to be solvable, we must know one of the final conditions. Then the system becomes three equations and three unknowns. A calculator (such as HP 50G, TI 89, TI nSpire) or mathematics computer program can assist in solving the set of equations.

What if one of the velocities is known?

Let's assume that FA is known. We can simplify the system of equations (9), (10), and (11). A similar strategy can be used if FB is known.

Start with (11). With FA known, solve for FB.

KE = 1/2 * MA * FA^2 + 1/2 * MB * FB^2
1/2 * MB * FB^2 = KE - 1/2 * MA * FA^2
FB^2 = 2 * KE / MB - MA * FA^2 / MB

Then:

FB = √ ( ( 2 * KE - MA * FA^2 ) / MB ) (12)

Now we are left with the system of two equations with two unknowns: ΦA and ΦB. Use your favorite calculating tool to solve for them.

Px = MA * FA * cos ΦA + MB * FB * cos ΦB (9)
Py = MA * FA * sin ΦA + MB * FB * sin ΦB (10)


For more information of elastic and inelastic collisions, click here (Hyperphysics Page). . Thanks Mime Grigsby, a very good friend of mine and fellow mathematician.


Until next time,

Eddie

Diagrams: drawn using Whiteboard

This blog entry is dedicated to Uncle Ralph (born March 21). Me and my family miss you and love you. Thank you for touching our lives.

This blog entry is property of Edward Shore. © 2012

Saturday, March 17, 2012

Billiards - Determining Final Velocity (Program for TI 84+ and HP 50g too!)

Welcome to blog entry #64!

HAPPY ST PATRICK'S DAY (WEEKEND)!

Billiards and Math

Ever wondered what happens with you take the cue stick, strike the cue ball, hit your target ball and the target ball sails right into a pocket? If you played billiards, commonly known as pool, you have experienced this many times.

We can use mathematics and physics to describe what happens when the cue ball hits the target ball. Since the balls do not "stick" together like steamed rice, the collision is considered to be nearly elastic.

In an elastic collision, two properties are conserved: momentum and kinetic energy. Momentum is the product of mass and it's velocity. Kinetic energy is the energy of movement. The equations for momentum and kinetic energy are, respectively:

P = m * v

KE = 1/2 * m * v^2

Note that direction is not considered in calculating kinetic energy.

Problem:

You hit a cue ball at a certain velocity VI, and hit a target ball at angle θ. We want to find out the direction of the cue ball after collision and the velocity of both balls.

Assume the following:

1. The masses of the cue ball and the target ball are the same. This will allow a great simplicafication in calculation, as we will see.

2. The Intial direction of the ball is 0° (due right). As a visual, you are on the left hitting the ball to due right.

Note the diagrams below:



3. The angles created after the hit add up to 90°.

From the diagram above, θ + Φ = 90°.

4. The cue ball does not hit any balls other than the target ball. If more than two balls were involved, calculation can get hairy, quick.

5. The cue ball is hit at it's sweet spot, which eliminates any friction developing between the ball and the felt of the pool table. According to The Real World Physics Problems web site, the sweet spot is 1.4 times the ball's radius.

An American billiard ball has a diameter of about 2.25 in, or 5.715 cm. The ball has a typical weight of 5.5 to 6 oz, or 156 to 170 grams. This link has more information on billiard balls.

Solution, Assuming All Masses Are Equal

Let:

VI = initial velocity of the cue ball, going due right. In the x-direction, VI cos 0° = VI. In the y-direction, VI sin 0° = 0, as expected.

VCF = final velocity of the cue ball

VBF = final velocity of the target ball. Note since the target ball was at rest, it's initial velocity is zero.

Φ = Angle where the cue ball goes after collision. Simply put, Φ = 90° - θ.

MC = mass of the cue ball

MB = mass of the target ball

Note: We assumed the masses were equal, MB = MC.

Momentum and kinetic energy has to be preserved. So for momentum in the x-direction:

MC * VI = MB * VBF cos θ + MC * VCF cos Φ

and momentum in the y-direction:

0 = MB * VBF sin θ - MC * VCF sin Φ

Note: Φ is a angle in the clockwise direction and sin (-Φ) = -sin Φ

and for kinetic energy:

1/2 * MC * VI^2 = 1/2 * MB * VBF^2 + 1/2 * MC * VCF^2

Note: Since mass is the same for all balls (MC = MB), mass "cancels" out in all three equations.

To Recap:
VI = VBF cos θ + VCF cos Φ
0 = VBF sin θ - VCF sin Φ
1/2 * VI^2 = 1/2 * VBF^2 + 1/2 * VCF^2

Making use of the trigonometric identities:

sin (90° - x) = cos x
cos (90° - x) = sin x


The equations simplify to:
VI = VBF cos θ + VCF sin θ
0 = VBF sin θ - VCF cos θ
1/2 * VI^2 = 1/2 * VBF^2 + 1/2 * VCF^2

Observe that if we solve for VBF in the second equation, we get:
VBF = VCF * (cos θ / sin θ)

Then:
VI = VBF cos θ + VCF sin θ
VI = VCF * (cos θ / sin θ) *cos θ + VCF sin θ
VI = VCF * (cos^2 θ / sin θ ) + VCF sin θ
VI = (VCF * cos^2 θ + VCF sin^2 θ) / sin θ

Note: sin^2 x + cos^2 x = 1 for an angle x.

And:
VI = VCF / sin θ

Solving for VCF yields:
VCF = VI sin θ

Let's get VBF in terms of VI:
VBF = VCF * (cos θ / sin θ)
VBF = VI sin θ* (cos θ / sin θ)
VBF = VI cos θ

Before we can celebrate, we need to satisfy the conservation of kinetic energy, not just momentum.
1/2 * VI^2 = 1/2 * VBF^2 + 1/2 * VCF^2

First, let's just multiply everything by 2:
VI^2 = VBF^2 + VCF^2
VI^2 = (VI cos θ )^2 + (VI sin θ)^2
VI^2 = VI^2 * (cos^2 θ + sin^2 θ )
VI = VI

So this checks out because we assumed the masses of both the cue ball and target ball were equal. .

Final solution - All Masses being Equal:

VBF = VI cos θ
VCF = VI sin θ
Φ = 90° - θ

What if the Mass of the Cue Ball and Target Ball are not equal?

Let:

MC = mass of the cue ball

MB = mass of the target ball

If I use the strategy of solving for VCF and VBF above, I get:

VCF = VI * sin θ.
VBF = (MC / MB) * VI * cos θ

We are working with elastic collisions, so conservation of kinetic energy must be considered:

1/2 * MC * VI^2 = 1/2 * MB * VBF^2 + 1/2 * MC * VCF^2

But:
1/2 * MB * VBF^2 + 1/2 * MC * VCF^2
= 1/2 * (MB * (VI * cos θ * MC / MB)^2 + MC * VI^2 * sin^2 θ))
= 1/2 * MC * VI^2 * (cos^2 θ / MB + sin^2 θ)
≠ 1/2 * MC * VI^2

Yep. No go. Confession, I thought the above way was good to go when MC ≠ MB too.

Here is a real solution if MC ≠ MB:

VBF = (MC * VCF) / (MB * tan θ)

And we have to solve the quadratic equation for VCF:

0 = VCF^2 * (MB * MC^2 * sin θ + MC^2 * cos^2 θ)
+ VCF * (MB * MC)
+ (MB * sin θ * (MC * VI + MC * VI^2))

The following calculator programs solve for Φ, VCF, and VBF with the assumption that the mass of both the cue ball and target ball are the same.

Variables for the programs:
C = VI
A = θ


TI 84 Plus:

NAME: BILLIARD

Degree
Disp "Deg MODE"
Input "INIT. VEL.",C
Input "ANGLE HIT",A
C*SIN(A) → S
C*COS(A) → T
Disp "ANGLE CUE=", 90 - A
Pause
Disp "FINAL VEL. CUE=",S
Disp "FINAL VEL. BALL=",T

HP 50g:

NAME: BILLIARD

<< DEG
"Degrees Mode" MSGBOX
"Initial Velocity, Cue" PROMPT
"Hit Angle" PROMPT
→ C A
<< "Finals:"
90 A - →NUM "Angle, Cue" →TAG
C A SIN * →NUM "Vel., Cue" →TAG
C A COS * →NUM "Vel., Ball" →TAG
>> >>

Test data:
VI = 5, θ = 15°; Results: VCF ≈ 1.2941, VBF ≈ 4.8296

VI = 2, θ = 30°; Results: VCF = 1, VBF = √3 ≈ 1.7321


Thank you, hope you enjoyed this blog entry. Next time I probably be blogging on a third generation iPad. For the first 64 entries, I have been using the Blogger+ App by ThinkTek Co. Ltd. on my iPad 2. Thanks everyone!

Eddie


This blog is property of Edward Shore. © 2012

Python in Numworks: Duplicating and Grayscale

Python in Numworks: Duplicating and Grayscale All three scripts presented today use the math, random, and the Numworks specific ...