Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork196
Static Equilibrium Extension#201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
8e2748a
f0e1cd2
7c0c4f5
a8a3130
4bd0306
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -39,8 +39,9 @@ import matplotlib.pyplot as plt | ||||||
In this tutorial you will use the following NumPy tools: | ||||||
* [`np.linalg.norm`](https://numpy.org/doc/stable/reference/generated/numpy.linalg.norm.html) : This function determines the measure of vector magnitude | ||||||
rossbar marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||||||
* [`np.cross`](https://numpy.org/doc/stable/reference/generated/numpy.cross.html) : This function takes two matrices and produces the cross product | ||||||
* [`np.linalg.solve`](https://numpy.org/doc/stable/reference/generated/numpy.linalg.solve.html) : This function produces the solution (x) to a linear system of equations in the form of A * x = B | ||||||
+++ | ||||||
@@ -245,10 +246,10 @@ forceCord = cordUnit * cordTension | ||||||
print("Force from the cord =", forceCord) | ||||||
``` | ||||||
In order to find the moment you need the cross product of thedistanceand theforce vector. | ||||||
```{code-cell} | ||||||
momentCord = np.cross(poleDirection, forceCord) | ||||||
print("Moment from the cord =", momentCord) | ||||||
``` | ||||||
@@ -263,107 +264,105 @@ print("Reaction moment =", M) | ||||||
``` | ||||||
### Another Example | ||||||
Let's look at a slightly more complicated model. In this example you will be observing a beam with two cables and an applied force. This time you need to find both the tension in the cords and the reaction forces of the beam. *(Source: [Vector Mechanics for Engineers: Statics, 12th Edition](https://www.mheducation.com/highered/product/vector-mechanics-engineers-statics-beer-johnston/M9781259977268.html), Problem 4.106. ISBN13: 9781259977268)* | ||||||
 | ||||||
Define distance *a* as 3 meters. The ball joint at A can apply reaction forces, but no reation torques. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Suggested change
| ||||||
As before, start by defining the location of each relevant point as an array. For this problem vertical arrays are more convenient. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is not obvious - in fact, I'd argue that carrying around the extra dimension in the shape makes it more difficult to interpret the arrays. AFAICT, the main reason for doing so is so that the unknown_forces=np.hstack((Unit_BD[:,np.newaxis],Unit_BE[:,np.newaxis],np.eye(3))) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Just a quick ping on this one@h2o-DS - WDYT? If you don't have the bandwidth to make these updates but are not opposed to them, I'd be happy to push them up! | ||||||
```{code-cell} | ||||||
A = np.array([[0], [0], [0]]) | ||||||
B = np.array([[0], [3], [0]]) | ||||||
C = np.array([[0], [6], [0]]) | ||||||
D = np.array([[1.5], [0], [-3]]) | ||||||
E = np.array([[1.5], [0], [3]]) | ||||||
F = np.array([[-3], [0], [2]]) | ||||||
``` | ||||||
From these equations, you start by determining vector directions with unit vectors. | ||||||
```{code-cell} | ||||||
AB = B -A | ||||||
AC = C - A | ||||||
BD = D - B | ||||||
BE = E - B | ||||||
CF = F - C | ||||||
Unit_BD = BD / np.linalg.norm(BD) | ||||||
Unit_BE = BE / np.linalg.norm(BE) | ||||||
Unit_CF = CF / np.linalg.norm(CF) | ||||||
Rad_BD = np.cross(AB,Unit_BD, axis=0) | ||||||
Rad_BE = np.cross(AB,Unit_BE, axis=0) | ||||||
Rad_CF = np.cross(AC,Unit_CF, axis=0) | ||||||
``` | ||||||
This lets you represent the tension (T) and reaction (R) forces acting on the system as | ||||||
$\sum F_{x} = 0 = \frac{1}{3}T_{BD}+\frac{1}{3}T_{BE}-\frac{3}{7}T_{CF}+R_{x}$ | ||||||
$\sum F_{y} = 0 = (-\frac{2}{3})T_{BD}-\frac{2}{3}T_{BE}-\frac{6}{7}T_{CF}+R_{y}$ | ||||||
$\sum F_{z} = 0 = (-\frac{2}{3})T_{BD}+\frac{2}{3}T_{BE}+\frac{2}{7}T_{CF}+R_{z}$ | ||||||
and the moments as | ||||||
$\sumM_{x} = 0 = (-2)T_{BD}+2T_{BE}+\frac{12}{7}T_{CF}$ | ||||||
$\sumM_{y} = 0 = (0)T_{BD}-(0)T_{BE}+(0)T_{CF}$ | ||||||
$\sum M_{z} = 0 =(-)T_{BD}-T_{BE}+\frac{18}{7}T_{CF}$ | ||||||
Where $T$ is the tension in the respective cord and $R$ is the reaction force in a respective direction. $M_{y}$ contains no information and can be discarded. $T_{CF}$ is known to be 455N and can be moved to the opposite side of the equation. You now have five unknowns with five equations that can be represented by a linear system. Stacking the vectors solved above produces a matrix, a 2D array. With the matrix of coefficients for each of the unkown variables on the left hand side of the equation and all of the known values on the right hand side, we can use NumPy's linear solver to obtain the solution. | ||||||
$$ \begin{bmatrix} | ||||||
1/3 & 1/3 & 1 & 0 & 0 \\ | ||||||
-2/3 & -2/3 & 0 & 1 & 0 \\ | ||||||
-2/3 & 2/3 & 0 & 0 & 1 \\ | ||||||
-2 & 2 & 0 & 0 & 0 \\ | ||||||
-1 & -1 & 0 & 0 & 0 \\ | ||||||
\end{bmatrix} | ||||||
\begin{bmatrix} | ||||||
T_{BD} \\ | ||||||
T_{BE} \\ | ||||||
R_{x} \\ | ||||||
R_{y} \\ | ||||||
R_{z} \\ | ||||||
\end{bmatrix} | ||||||
= | ||||||
\begin{bmatrix} | ||||||
195 \\ | ||||||
390 \\ | ||||||
-130 \\ | ||||||
-780 \\ | ||||||
-1170 \\ | ||||||
\end{bmatrix} $$ | ||||||
```{code-cell} | ||||||
# sum forces | ||||||
unknown_Forces = np.hstack((Unit_BD, Unit_BE, np.eye(3))) | ||||||
# sum torques | ||||||
unknown_Torques = np.hstack((Rad_BD, Rad_BE, np.zeros((3,3)))) | ||||||
# -1 due to being moved to the RHS | ||||||
T_CF = 455 | ||||||
known_Forces = -1 * T_CF * Unit_CF | ||||||
known_Torques = -1 * T_CF * Rad_CF | ||||||
# remove M_y | ||||||
unknown_Torques = np.delete(unknown_Torques, 1, 0) | ||||||
known_Torques = np.delete(known_Torques, 1, 0) | ||||||
# combine into a single system | ||||||
LHS = np.vstack((unknown_Forces, unknown_Torques)) | ||||||
RHS = np.vstack((known_Forces, known_Torques)) | ||||||
solution = np.linalg.solve(LHS, RHS) | ||||||
print(solution) | ||||||
``` | ||||||
$\ T_{BD} = 780N$ | ||||||
@@ -387,5 +386,5 @@ This same process can be applied to kinetic problems or in any number of dimensi | ||||||
### References | ||||||
1. [Vector Mechanics for Engineers: Statics (Beer & Johnston & Mazurek)](https://www.mheducation.com/highered/product/vector-mechanics-engineers-statics-beer-johnston/M9781259977268.html) | ||||||
2. [NumPy Reference](https://numpy.org/doc/stable/reference/) |