In [3]:

```
#given
F=(6,2) #Constant force in vector form 6i+2j in N
s=(3,5) #Displacement in vector form 3i+5j in N
#Calculations
import math
W=(F[0]*s[0])+(F[1]*s[1])
q=math.acos(W/(math.sqrt(F[0]**2+F[1]**2)*math.sqrt(s[0]**2+s[1]**2)))*180/3.14
#Output
print"Workdone by the force is ",W,"J"
print"Angle between Force and displacement is ",round(q,1),"degrees"
```

In [4]:

```
#given
m=10 #Mass of block in kg
q=40 #Angle made by the force with horizontal in degrees
s=5 #Horizontal displacement of the block in m
u=0.3 #Coefficient of kinematic friction
#Calculations
import math
F=(u*m*9.8)/(math.cos(q*3.14/180.0)+(u*math.sin(q*3.14/180.0)))
W=(F*math.cos(q*3.14/180.0))*s
#Output
print"Workdone by the pulling force is ",round(W,1),"J"
```

In [4]:

```
#plot
import matplotlib.pyplot as plt
fig = plt.figure()
x=[0,1,2,3,4,5]
F=[0,6,6,12,12,0]
xlabel("x (m)")
ylabel("F (N)")
plt.xlim((0,5))
plt.ylim((0,14))
a=plot(x,F)
show(a)
```

In [3]:

```
#given
m=0.05 #Mass of the body in kg
v=(3,5) #Velocity in vector form 3i+4j in m/s
#Calculations
ke=(1/2.0)*m*(v[0]**2+v[1]**2)
#Output
print"Kinetic energy is ",ke,"J"
```

In [4]:

```
#given
k=50 #Spring force constant in N/m
x=-0.02 #Length of compression in m
#Calculations
W=(1/2.0)*k*(x)**2
#Output
print"Work done by the spring when the block comes from the compressed position to the equilibrium position is ",W,"J"
```

In [6]:

```
#given
x=0.03 #Length stretched by the spring in m
m=0.25 #Mass of the body in kg
#Calculations
k=(m*9.8)/x
#Output
print"Force constant of the spring is ",round(k,3),"N/m"
```

In [7]:

```
#given
m=5 #Mass of block in kg
F=20 #Constant force in N
x=6 #Distance moved by the block in m
#Calculations
import math
W=(F*x)
v=math.sqrt((2*W)/m)
#Output
print"Speed of the block when it moves through a distance of ",x,"m is",round(v,2),"m/s"
```

In [8]:

```
#given
m=50 #Mass of the object in kg
v=8 #Speed in m/s
t=4 #Time taken in s
#Calculations
a=(v-0)/t
s=(v**2/(2.0*a))
W=(m*a*s)
P=(W/t)
#Output
print"Workdone on the object is ",W,"J"
print"The average power delivered by the force in the first ",t,"s is ",P,"watt"
```