In [1]:

```
import math #Example 5_1
#To calculate the work done
Fs=8.0 #units in meters
W=Fs*round(math.cos(math.pi/2.0)) #units in Joules
print "The work done is W=",round(W)," Joules"
```

In [2]:

```
import math #Example 5_2
#To calculate the work done when lifting object as well as lowering the object
Fs=1.0 #units in terms of Fs
theta=0 #units in degrees
W=Fs*math.cos(theta*math.pi/180) #units in terms of m, g and h
print "Work done when lifting is W=mgh*",round(W),"\n"
theta=180.0 #units in degrees
W=Fs*math.cos(theta*math.pi/180) #units in terms of m, g and h
print "Work done when downing is W=mgh*",round(W),"\n"
```

In [3]:

```
import math #Example 5_3
#To find the work done by the pulling force
F=20.0 #units in Newtons
d=5 #units in meters
W=F*d #units in joules
print "Work done is W=",round(W)," Joules"
```

In [4]:

```
import math #Example 5_4
#To find out the power being developed in motor
m=200 #units on Kg
g=9.8 #units in meters/sec**2
Fy=m*g #units in Newtons
vy=0.03 #units in meter/sec
P=Fy*vy #units in Watts
P=P*(1.0/746) #units in hp
print "Power developed P=",round(P,5)," hp"
```

In [5]:

```
import math #Example 5_5
#To calculate the average frictional force developed
m=2000 #units in Kg
vf=20 #units in meters/sec
d=100 #units in meters
f=(0.5*m*vf**2)/d #units in Newtons
print "Average frictional force f=",round(f)," N"
```

In [8]:

```
import math #Example 5_6
#To find out how fast the car is going
f=4000.0 #units in Newtons
s=50.0 #units in meters
theta=180.0 #units in degrees
m=2000.0 #units in Kg
v0=20 #units in meter/sec
vf=math.sqrt((2*((f*s*math.cos(theta*math.pi/180))+(0.5*m*v0**2)))/m) #units in meter/sec
print "The speed of the car is vf=",round( vf,1)," meters/sec"
```

In [9]:

```
import math #Example 5_7
#To find the required tension in the rope
m=40 #units in Kg
g=9.8 #units in meters/sec**2
theta=0 #units in degrees
vf=0.3 #units in meters/sec
s=0.5 #units in meters
T=round((m*g)+((0.5*m*vf**2)/(s*math.cos(theta*math.pi/180)))) #units in Newtons
print "Tension in the rope is T=",round(T)," N"
```

In [10]:

```
import math #Example 5_8
#To calculate the frictional force
m=900.0 #units in Kg
v0=20.0 #units in meters/sec
s=30 #units in meters
f=(0.5*m*v0**2)/s #units in Newtons
print "Frictional force required is f=",round(f)," N"
```

In [12]:

```
import math #Example 5_9
#To find out how fast a a ball is going
m=3 #units in Kg
g=9.8 #units in meters/sec**2
hf=0 #units in meters
h0=4 #units in meters
vf=2*math.sqrt(((m*g*-(hf-h0))*0.5)/m) #units in meters/sec
print "The ball is moving with a speed of vf=",round(vf,2)," meters/sec"
```

In [13]:

```
import math #Example 5_10
#To calculate how large the average frictional force
a=9.8 #units in meters/sec**2
s=4 #units in meters
v=6 #units in meters/sec
m=3 #units on Kg
f=m*((a*s)-(0.5*v**2))/s #units in Newtons
print "The average frictional force f=",round(f,1)," N"
```

In [14]:

```
import math #Example 5_11
#To find out how fast a car is going at points B and C
m=300 #units in Kg
g=9.8 #units in meters/sec**2
hb_ha=10 #units in meters
f=20 #units in Newtons
s=60 #units in meters
vf=2*math.sqrt((0.5*((m*g*(hb_ha))-(f*s)))/m) #units in meters/sec
print "The car is going at a speed of vf=",round(vf,1)," meters/sec at point B\n"
hc_ha=2 #units in meters
vf=2*math.sqrt((0.5*((m*g*(hc_ha))-(f*s)))/m) #units in meters/sec
print "The car is going at a speed of vf=",round(vf,2)," meters/sec at point C\n"
```

In [15]:

```
import math #Example 5_12
#How far the average velocity and how far beyond B does the car goes
m=2000 #units in Kg
vb=5 #units in meters/sec
va=20 #units in meters/sec
hb_ha=8 #units in meters
g=9.8 #units in meters/sec**2
sab=100 #units in meters
f=-((0.5*m*(vb**2-va**2))+(m*g*(hb_ha)))/sab #units in Newtons
print "Average frictional force is f=",round(f)," N\n"
Sbe=(0.5*m*vb**2)/f #units in meters
print "The distance by which the car goes beyond is Sbe=",round(Sbe,1)," meters"
#In text book answer is printed wrong as f=2180 N but correct answer is f=2182N
```

In [16]:

```
import math #Example 5_13
#To find out how large the force is required
m=2 #units in Kg
g=9.8 #units in meters/sec**2
hc_ha=10.03 #units in meters
sbc=0.030 #units in meters
f=(m*g*(hc_ha))/sbc #units in Newtons
print "The average force required is f=",round(f)," N"
#In text book answer is printed wrong as f=6550 N correct answer is f=6552N
```

In [18]:

```
import math #Example 5_14
#To find out how fast the pendulum is moving
#At point A
hb_ha=0.35 #units in Meters
g=9.8 #units in meters/sec**2
vb=math.sqrt((g*hb_ha)/0.5) #units in meters/sec
print "The velocity of pendulum at point B is vb=",round(vb,2)," meters/sec\n"
print "From A to C hc=ha and Vc=Va=0 so Frictional force is Negligible at point C"
```

In [19]:

```
import math #Example 5_15
#To find out how large a force is required
m=2000 #units in Kg
vf=15 #units in meters/sec
f1=500 #units in Newtons
F=((0.5*m*(vf**2))/80)+f1 #units in Newtons
print "Force required is F=",round(F)," N"
#In text book the answer is printed wrong as F=3300 N but the correct answer is 3312 N
```

In [20]:

```
import math #Example 5_16
#To find IMA AMA and Efficiency of the system
si=3.0
so=1
IMA=si/so
Fo=2000.0 #units in Newtons
Fi=800.0 #units in Newtons
AMA=Fo/Fi
effi=AMA/IMA*100
print "IMA=",round(IMA,2),"\n"
print "AMA=",round(AMA,2),"\n"
print "Percentage of efficiency is ",round(effi)," percent"
```