Solving a variant of problem 6.3, Gray, Costanzo, and Plesha (Gray, G.L., Costanzo, F., and Plesha, M.E., *Engineering Mechanics: Dynamics*, McGraw Hill, New York, 2010.), where kinetics are included ($I_1, I_2, I_3$) and a moment $M$ is applied to the rightmost gear.

The problem statement is ``A Moment $M$ is applied to the rightmost gear (gear 3). Find the acceleration of the gear as a resulting moment presuming inertias $I_1, I_2, I_3$.''

For my class: this is Wright State  University, ME 3210, Quiz 2, Spring 2016

This notebook uses Python 3.5 in iPython (now called Jupyter).  

Image awaiting copyright approval.


```python
#
```


```python
# import symbolic capability to Python
from sympy import *
```


```python
# print things all pretty
from sympy.abc import *
init_printing()
```


```python
# Need to define variables as symbolic for sympy to use them. 
r_A, r_B, r_C, r_D, F_AB, F_DC, M= symbols("r_A r_B r_C r_D F_AB F_DC M", real = True)
```


```python
I_1, I_2, I_3 = symbols("I_1 I_2 I_3", real = True)
```


```python
theta_1, theta_2, theta_3 = symbols("theta_1 theta_2 theta_3", real = True)
```

The Free Body Diagrams, and kinematic relationships. 


Defining equations. In SymPy, and equation is an expression that is equal to zero. All terms must be brought to the same side in defining it. 


```python
EA = F_DC *r_D  - I_3 * diff(theta_3(t),t,t)
EA
```


```python
EB = r_B* F_AB - r_C* F_DC - I_2 * diff(theta_2(t),t,t)
EB
```


```python
EC = r_A *(-F_AB) + M - I_1 * diff(theta_1(t),t,t)
EC
```


```python
E1 = diff(theta_3(t),t,t)* r_D - diff(theta_2(t),t,t) *r_C
E1
```


```python
E2 = r_B * diff(theta_2(t),t,t) - diff(theta_1(t),t,t) *r_A
E2
```


```python
solve(EA,diff(theta_3(t),t,t))
```


```python
solve(EB,F_AB)[0]
```

I'm going to do substitutions in stages, eliminating one variable at a time for clarity.


```python
step1 = EC.subs(F_AB, solve(EB,F_AB)[0])
step1
```


```python
step2 = step1.subs(F_DC,solve(EA,F_DC)[0])
step2
```


```python
step3 = step2.subs(diff(theta_1(t),t,t),solve(E2,diff(theta_1(t),t,t))[0])
step3
```


```python
step4 = step3.subs(diff(theta_2(t),t,t),solve(E1,diff(theta_2(t),t,t))[0])
step4
```

Finally, the acceleration of the right most gear as a function of the input moment


```python
solve(step4,diff(theta_3(t),t,t))
```


```python

```

e9295902bdd2a660a10e2891b88515467b372c8f
ipynb
Jupyter Notebook
SymPy_Multiple_Eqn_solution.ipynb
josephcslater/JupyterExamples
4f2af75b9fda80dcab6cac0b9210713eeb703839
BSD-3-Clause
2018-10-08T00:48:12.000Z
2021-02-05T20:20:39.000Z
SymPy_Multiple_Eqn_solution.ipynb
josephcslater/JupyterExamples
4f2af75b9fda80dcab6cac0b9210713eeb703839
BSD-3-Clause
2020-09-04T18:29:42.000Z
2020-09-04T18:29:42.000Z
SymPy_Multiple_Eqn_solution.ipynb
josephcslater/Introduction_to_Python
0d30771ed135432fe27ec830c741eb7c30a1ec3c
Unlicense
2019-01-23T17:13:28.000Z
2020-07-29T18:59:28.000Z
Qwen/Qwen-72B
1. YES
2. YES