# Free Body Diagram for particles¶

Renato Naville Watanabe

In [2]:
import numpy as np
import matplotlib.pyplot as plt

%matplotlib notebook


### Steps to draw a free-body diagram¶

1 - Draw separately each object considered in the problem. How you separate depends on what questions you want to answer.

2 - Identify the forces acting on each object. If you are analyzing more than one object, remember the third Newton law (action and reaction), and identify where the reaction of a force is being applied.

3 - Draw all the identified forces, representing them as vectors. The vectors should be represented with the origin in the object. In the case of particles, the origin should be in the center of the particle.

4 - If necessary, you should represent the reference frame in the free-body diagram.

5 - After this, you can solve the problem using the Second Newton Law (see, e.g, Newton Laws) to find the motion of the particle.

## Basic element and forces¶

### Spring¶

Is an element used to represent a force proportional to some length or displacement. It produces a force in the same direction of the vector linking the spring extremities and opposite to its length or displacement from an equilibrium length. Frequently it has a linear relation, but it could be nonlinear as well. The force exerted by the spring in one of the extremities is:

$$\vec{\bf{F}} = - k(||\vec{\bf{r}}||-l_0)\frac{\vec{\bf{r}}}{||\vec{\bf{r}}||} = -k\vec{\bf{r}} +kl_0\frac{\vec{\bf{r}}}{||\vec{\bf{r}}||} = -k\left(1-\frac{l_0}{||\vec{\bf{r}}||}\right)\vec{\bf{r}}$$

where $\vec{\bf{r}}$ is the vector linking the extremity applying the force to the other extremity and $l_0$ is the equilibrium length of the spring.

Since the spring element is a massless element, the force in both extremities have the same absolute value and opposite directions.

### Damping¶

Is an element used to represent a force proportional to the velocity of displacement. It produces a force in the same direction of the vector linking the element extremities and opposite to its velocity.

Frequently it has a linear relation, but it could be nonlinear as well. The force exerted by the damping element in one of its extremities is:

$$\vec{\bf{F}} = - b||\vec{\bf{v}}||\frac{\vec{\bf{v}}}{||\vec{\bf{v}}||} = -b\vec{\bf{v}} = -b\frac{d\vec{\bf{r}}}{dt}$$

where $\vec{\bf{r}}$ is the vector linking the extremity applying the force to the other extremity.

For the same reason of the spring, the force in both extremities have the same absolute value and opposite directions.

### Gravity¶

The gravity force acts on two masses, each one atracting each other:

$$\vec{{\bf{F}}} = - G\frac{m_1m_2}{||\vec{\bf{r}}||^2}\frac{\vec{\bf{r}}}{||\vec{\bf{r}}||}$$

where $G = 6.67.10^{−11} Nm^2/kg^2$ and $\vec{\bf{r}}$ is a vector with length equal to the distance between the masses and directing towards the other mass. Note the forces acting on each mass have the same absolute value.

Since the mass of the Earth is $m1=5.9736×10^24kg$ and its radius is 6.371×10^6m (see this notebook, for details), the gravity force on Earth is:

$$\vec{{\bf{F}}} = m\vec{\bf{g}}$$

with the absolute value of $\vec{\bf{g}}$ approximately equal to 9.81 $m/s^2$, and point towards the center of Earth.

Below, will be shown some examples of how to draw the free-body diagram and obtain the motion equations to solve the problems.

## 1) No force acting on the particle¶

The most trivial situation is a particle with no force acting on it.

The free-body diagram is below, with no force vectors acting on the particle.

## 2) Gravity force acting on the particle¶

Now, we will consider a ball with the gravity force acting on it. The free-body diagram is depicted below.

## 3) Ground reaction force¶

Now, we will analyze the situation of a particle in contact with the ground. To simplify the analysis, only the vertical movement will be considered.

## 4) Linear spring in horizontal movement¶

The example below is mass attached to a spring. The other extremity of the spring is fixed.

In [3]:
k = 40
m = 2
l0 = 0.5
x0 = 0.8
v0 = 0

x = x0
v = v0

dt = 0.001
t = np.arange(0, 3, dt)

r = np.array([x])

for i in t[1:]:
dxdt = v
dvxdt = -k/m*(x-l0)
x = x + dt*dxdt
v = v + dt*dvxdt
r = np.vstack((r,np.array([x])))

plt.figure()
plt.plot(t,r)
plt.show()


## 5) Linear spring in bidimensional movement in horizontal plane¶

This example has two masses attached to the spring. To solve the motion of both masses, we must draw a free-body diagram for each one of the masses.

In [4]:
x01 = 0
y01= 0.5
x02 = 0
y02 = -0.5
vx01 = 0.1
vy01 = 0
vx02 = -0.1
vy02 = 0

x1= x01
y1 = y01
x2= x02
y2 = y02
vx1= vx01
vy1 = vy01
vx2= vx02
vy2 = vy02
r1 = np.array([x1,y1])
r2 = np.array([x2,y2])

k = 30
m1 = 1
m2 = 1
l0 = 0.5

dt = 0.0001
t = np.arange(0,5,dt)

for i in t[1:]:

dvx1dt = -k/m1*(x1-x2)*(1-l0/np.sqrt((x2-x1)**2+(y2-y1)**2))
dvx2dt = -k/m2*(x2-x1)*(1-l0/np.sqrt((x2-x1)**2+(y2-y1)**2))
dvy1dt = -k/m1*(y1-y2)*(1-l0/np.sqrt((x2-x1)**2+(y2-y1)**2))
dvy2dt = -k/m2*(y2-y1)*(1-l0/np.sqrt((x2-x1)**2+(y2-y1)**2))

dx1dt = vx1
dx2dt = vx2
dy1dt = vy1
dy2dt = vy2

x1 = x1 + dt*dx1dt
x2 = x2 + dt*dx2dt
y1 = y1 + dt*dy1dt
y2 = y2 + dt*dy2dt

vx1 = vx1 + dt*dvx1dt
vx2 = vx2 + dt*dvx2dt
vy1 = vy1 + dt*dvy1dt
vy2 = vy2 + dt*dvy2dt

r1 = np.vstack((r1,np.array([x1,y1])))
r2 = np.vstack((r2,np.array([x2,y2])))

springLength = np.sqrt((r1[:,0]-r2[:,0])**2+(r1[:,1]-r2[:,1])**2)
plt.figure()
plt.plot(t, springLength)
plt.show()


## 6)Particle with gravity and linear air resistance¶

Below is the free-body diagram of a particle with the gravity force and a linear drag force due to the air resistance.

## 7) Particle with gravity and nonlinear air resistance¶

Below, is the free-body diagram of a particle with the gravity force and a drag force due to the air resistance proportional to the square of the particle velocity.

## 8) Linear spring and damping on bidimensional horizontal movement¶

This situation is very similar to the example of horizontal movement with one spring and two masses, with a damper added in parallel to the spring.

In [5]:
x01 = 0
y01= 1
x02 = 0
y02 = -1

vx01 = -2
vy01 = 0
vx02 = 1
vy02 = 0

x1= x01
y1 = y01
x2= x02
y2 = y02
vx1= vx01
vy1 = vy01
vx2= vx02
vy2 = vy02
r1 = np.array([x1,y1])
r2 = np.array([x2,y2])

k = 10
m1 = 1
m2 = 2
b = 0.6
l0 = 0.5

dt = 0.001
t = np.arange(0,5,dt)

for i in t[1:]:
dvx1dt = -b/m1*(vx1-vx2) -k/m1*(1-l0/np.sqrt((x2-x1)**2+(y2-y1)**2))*(x1-x2)
dvx2dt = -b/m2*(vx2-vx1) -k/m2*(1-l0/np.sqrt((x2-x1)**2+(y2-y1)**2))*(x2-x1)
dvy1dt = -b/m1*(vy1-vy2) -k/m1*(1-l0/np.sqrt((x2-x1)**2+(y2-y1)**2))*(y1-y2)
dvy2dt = -b/m2*(vy2-vy1) -k/m2*(1-l0/np.sqrt((x2-x1)**2+(y2-y1)**2))*(y2-y1)
dx1dt = vx1
dx2dt = vx2
dy1dt = vy1
dy2dt = vy2
x1 = x1 + dt*dx1dt
x2 = x2 + dt*dx2dt
y1 = y1 + dt*dy1dt
y2 = y2 + dt*dy2dt
vx1 = vx1 + dt*dvx1dt
vx2 = vx2 + dt*dvx2dt
vy1 = vy1 + dt*dvy1dt
vy2 = vy2 + dt*dvy2dt
r1 = np.vstack((r1,np.array([x1,y1])))
r2 = np.vstack((r2,np.array([x2,y2])))

springDampLength = np.sqrt((r1[:,0]-r2[:,0])**2+(r1[:,1]-r2[:,1])**2)
plt.figure()
plt.plot(t, springDampLength)
plt.show()

plt.figure()
plt.plot(r1[:,0], r1[:,1],'r.')
plt.plot(r2[:,0], r2[:,1],'b.')
plt.plot((m1*r1[:,0]+m2*r2[:,0])/(m1+m2), (m1*r1[:,1]+m2*r2[:,1])/(m1+m2),'g.')
plt.xlim(-2,2)
plt.ylim(-2,2)
plt.show()


## 9) Simple muscle model¶

The diagram below shows a simple muscle model. The spring in the left represents the tendinous tissues and the spring in the right represents the elastic properties of the muscle fibers. The damping is present to model the viscous properties of the muscle fibers, the element CE is the contractile element (force production) and the mass $m$ is the muscle mass.

The length $L_{MT}$ is the length of the muscle plus the tendon. In our model $L_{MT}$ is constant, but it could be a function of the joint angle.

In [6]:
m = 2
b = 10
km = 1500
kt = 1000
lt0 = 0.28
lm0 = 0.07

Lmt = 0.35
vt0 = 0

dt = 0.0001
t = np.arange(0, 10, dt)

Fce = 90

lt = lt0
vt = vt0
ltp = np.array([lt0])
lmp = np.array([lm0])
Ft = np.array([0])
for i in range(1,len(t)):
dvtdt = -b/m*vt-(kt+km)/m*lt  + Fce/m + kt/m*lt0 +km/m*(Lmt-lm0)
dltdt = vt
vt = vt + dt*dvtdt
lt = lt + dt*dltdt
Ft = np.vstack((Ft,np.array(kt*(lt-lt0))))
ltp = np.vstack((ltp,np.array(lt)))
lmp = np.vstack((lmp,np.array(Lmt - lt)))

plt.figure()
plt.plot(t,Ft)
plt.xlabel('t')
plt.ylabel('Tendon force (N)')
plt.show()
plt.figure()
plt.plot(t,ltp)
plt.plot(t,lmp)
plt.xlabel('t')
plt.ylabel('Length (m)')
plt.show()


## Problems¶

Solve the problems 3.3.9, 3.3.20, 10.1.6, 12.1.6(a,b,c,d,f), 12.1.7, 12.1.10 (a,b) from Ruina and Pratap book