In [2]:

```
import math #Example 6_1
#To calculate how large is the average force retarding its motion
m=1500 #units in Kg
vf=15.0 #units in meters/sec
v0=20 #units in meters/sec
t=3 #units in sec
f=((m*vf)-(m*v0))/t #Units in Newtons
print "The average retarding force is F=",round(f)," Newtons"
```

In [3]:

```
import math #Example 6_2
#To estimate the average stopping force the tree exerts on the car
m=1200 #units in Kg
vf=0 #units in meters/sec
v0=20 #units in meters/sec
v=0.5*(vf+v0) #units in meters/sec
s=1.5 #units in meters
t=s/v #units in sec
f=((m*vf)-(m*v0))/t #Units in Newtons
print "The average stopping force the tree exerts on the car is F="
print f,"Newtons"
```

In [4]:

```
import math #Example 6_3
#To find out how fast and the direction car moving
m1=30000 #units in Kg
m2=1200 #units in Kg
v10=10 #units in meters/sec
v20=-25 #units in meters/sec
vf=((m1*v10)+(m2*v20))/(m1+m2) #unis in meters/sec
print "The car is moving at vf=",round(vf,2)," Meters/sec\n"
print "The positive sign of vf Indicate the car is moving in the direction the truck was moving"
```

In [5]:

```
import math #Example 6_5
#To find the velocity of each ball after collision
m1=0.04 #units in kg
m2=0.08 #units in kg
v1=0.3 #units in meters/sec
v2f=(2*m1*v1)/(m1+m2) #units in meters/sec
v2f1=v2f*100 #units in cm/sec
print "The velocity V2f=",round(v2f,1)," meters/sec or ",round(v2f1)," cm/sec\n"
v1f=((m1*v1)-(m2*v2f))/m1 #units in meters/sec
v1f1=-v1f*100 #units in cm/sec
print "The velocity V1f=",round(v1f,1)," meters/sec or ",round(v1f1)," cm/sec\n"
```

In [6]:

```
import math #Example 6_6
#To calculate the speed of the pellet before collision
h=0.30 #units in meters
g=9.8 #units in meters/sec**2
v=math.sqrt(2*g*h) #units in meters/sec
m1=2 #units in Kgs
m2=0.010 #units in kgs
v10=((m1+m2)*v)/m2 #units in meters/sec
print "The speed of the pelet before collision is V10=",round(v10)," meters/sec"
#In textbook the answer is printed wrong as V10=486 meters/sec the correct answer is V10=487 meters/sec
```

In [7]:

```
import math #Example 6_7
#To calculate how large a forward push given to the rocket
m=1300 #units in Kgs
vf=50000 #units in meters/sec
v0=0 #units in meters/sec
F=((m*vf)-(m*v0)) #units in Newtons
print "The Thrust is F=",round(F)," Newtons"
```

In [8]:

```
import math #Example 6_8
#To determine the velocity of the third peice
momentumbefore=0 #units in kg meter/s
m=0.33 #units in Kgs
vz=momentumbefore/m
print "The Z component of velocity is Vz=",round(vz)," meters/sec\n"
m=0.33 #units in Kgs
v0=0.6 #units in meters/sec
vy=-(m*v0)/m #interms of v0 and meters/sec
print "The Y component of velocity is Vy=",round(vy,1),"*V0\n"
v01=1 #units in meters/sec
v02=0.8 #units in meters/sec
vx=-((v01+v02)*m)/m #interms of v0 and units in meters/sec
print "The X component of velocity is Vx=",round(vx,1),"*V0"
```

In [9]:

```
import math #Example 6_9
#To find out the velocity of second ball after collision
v1=5 #units in meters/sec
theta=50.0 #units in degrees
v2=2 #units in meters/sec
vx=v1/(v2*math.cos(theta*math.pi/180)) #units in meters/sec
vy=-(v2*math.cos(theta*math.pi/180)) #units in meters/sec
v=math.sqrt(vx**2+vy**2) #units in meters/sec
print "After the collision the second ball moves at a speed of v=",round(v,2)," Meters/sec"
#in textbook the answer is printed wrong as 4.01 meters/sec the correct answer is 4.1 meters/sec
```

In [11]:

```
import math #Example 6_10
#To find the average speed of the nitrogen molecule in air
ap=1.01*10**5 #units in Newton/meter**2
nofmol=2.69*10**25 #Number of molecules
nitmass=4.65*10**-26 #units in Kg
v=math.sqrt((ap*3)/(nofmol*nitmass)) #units in meters/sec
print "The average speed of the nitrogen molecule in air is V=",round(v)," meters/sec"
```