Skip to content

Commit

Permalink
MRG: Merge pull request #4 from AndreaBlengino/dev
Browse files Browse the repository at this point in the history
v0.4.0
  • Loading branch information
Andrea Blengino authored Nov 18, 2023
2 parents c9a6950 + a03bd47 commit 7411352
Show file tree
Hide file tree
Showing 97 changed files with 5,039 additions and 636 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
python-version: 3.7
- name: Install release tooling
run: |
pip install twine wheel
pip install -r requirements/dev.txt
- name: Build package
run: |
python setup.py sdist bdist_wheel
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install pytest hypothesis coverage pytest-cov pytest-xdist
pip install -r requirements.txt
pip install -r requirements/common.txt
pip install -r requirements/tests.txt
- name: Fetch
uses: actions/checkout@master
- name: Test
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build:
jobs:
post_create_environment:
- pip install .
- pip install -r docs/source/requirements.txt
- pip install -r requirements/docs.txt

sphinx:
configuration: docs/source/conf.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- [Source code](https://github.com/AndreaBlengino/gearpy/tree/master/gearpy)
- [Issue tracker](https://github.com/AndreaBlengino/gearpy/issues)
- [Documentation](https://gearpy.readthedocs.io/en/latest/?badge=latest)
- [Installation](https://gearpy.readthedocs.io/en/latest/installation.html)
- [Installation](https://gearpy.readthedocs.io/en/latest/get_started.html)
- [Usage examples](https://gearpy.readthedocs.io/en/latest/examples/index.html)
- [PyPI](https://pypi.org/project/gearpy/)
- [GNU General Public License v3.0](https://github.com/AndreaBlengino/gearpy/blob/master/LICENSE)
4 changes: 4 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.sidebar-container, .toc-drawer {
box-sizing: border-box;
width: 20em;
}
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@

html_theme = 'furo'
html_static_path = ['_static']
html_css_files = ['custom.css']
add_module_names = False
html_title = 'gearpy'
Binary file removed docs/source/examples/example_1/images/plot_1.png
Binary file not shown.
Binary file removed docs/source/examples/example_1/images/plot_2.png
Binary file not shown.
Binary file removed docs/source/examples/example_1/images/plot_3.png
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/source/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Usage Examples

.. toctree::

example_1/index
simple_transmission_chain/index
structural_analysis/index
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ A *flywheel* and the *gear 1* are connected to the *DC motor* output
shaft and rotate with it. The *gear 2* mates with *gear 1* and is
connected to *gear 3* through a rigid shaft, so *gear 2* and *gear 3*
rotate together. The *gear 3* mates with *gear 4*, to which is connected
to the external load.
to the external load.
The analysis is focused on transmission elements kinematics and torques,
without computing structural strength of the gear teeth.


### Model Set Up
Expand Down Expand Up @@ -115,13 +117,13 @@ transmission.snapshot(target_time = Time(1000, 'sec'))

```text
Mechanical Transmission Status at Time = 1000 sec
angular position (rad) angular speed (rad/s) angular acceleration (rad/s^2) torque (Nm) driving torque (Nm) load torque (Nm)
motor 459683.165617 570.175248 0.019532 0.001199 0.006199 0.005
flywheel 459683.165617 570.175248 0.019532 0.001199 0.006199 0.005
gear 1 459683.165617 570.175248 0.019532 0.001199 0.006199 0.005
gear 2 229841.582808 285.087624 0.009766 0.001158 0.011158 0.01
gear 3 229841.582808 285.087624 0.009766 0.001158 0.011158 0.01
gear 4 76708.893383 95.032447 0.003239 0.000126 0.030126 0.03
angular position (rad) angular speed (rad/s) angular acceleration (rad/s^2) torque (Nm) driving torque (Nm) load torque (Nm) tangential force (N) bending stress (MPa) contact stress (MPa)
motor 459683.165617 570.175248 0.019532 0.001199 0.006199 0.005 NaN NaN NaN
flywheel 459683.165617 570.175248 0.019532 0.001199 0.006199 0.005 NaN NaN NaN
gear 1 459683.165617 570.175248 0.019532 0.001199 0.006199 0.005 NaN NaN NaN
gear 2 229841.582808 285.087624 0.009766 0.001158 0.011158 0.01 NaN NaN NaN
gear 3 229841.582808 285.087624 0.009766 0.001158 0.011158 0.01 NaN NaN NaN
gear 4 76708.893383 95.032447 0.003239 0.000126 0.030126 0.03 NaN NaN NaN
```

The default unit used for torques are not so convenient in this case, so
Expand All @@ -136,18 +138,18 @@ transmission.snapshot(target_time = Time(1000, 'sec'),

```text
Mechanical Transmission Status at Time = 1000 sec
angular position (rad) angular speed (rad/s) angular acceleration (rad/s^2) torque (mNm) driving torque (mNm) load torque (mNm)
motor 459683.165617 570.175248 0.019532 1.198832 6.198832 5.0
flywheel 459683.165617 570.175248 0.019532 1.198832 6.198832 5.0
gear 1 459683.165617 570.175248 0.019532 1.198832 6.198832 5.0
gear 2 229841.582808 285.087624 0.009766 1.157897 11.157897 10.0
gear 3 229841.582808 285.087624 0.009766 1.157897 11.157897 10.0
gear 4 76708.893383 95.032447 0.003239 0.126322 30.126322 30.0
angular position (rad) angular speed (rad/s) angular acceleration (rad/s^2) torque (mNm) driving torque (mNm) load torque (mNm) tangential force (N) bending stress (MPa) contact stress (MPa)
motor 459683.165617 570.175248 0.019532 1.198832 6.198832 5.0 NaN NaN NaN
flywheel 459683.165617 570.175248 0.019532 1.198832 6.198832 5.0 NaN NaN NaN
gear 1 459683.165617 570.175248 0.019532 1.198832 6.198832 5.0 NaN NaN NaN
gear 2 229841.582808 285.087624 0.009766 1.157897 11.157897 10.0 NaN NaN NaN
gear 3 229841.582808 285.087624 0.009766 1.157897 11.157897 10.0 NaN NaN NaN
gear 4 76708.893383 95.032447 0.003239 0.126322 30.126322 30.0 NaN NaN NaN
```

Notice that the load torque applied on the *gear 4* is exactly the
constant external torque we defined beforehand.
After 1000 seconds after the simulation start, the driving torque
About 1000 seconds after the simulation start, the driving torque
applied on *gear 4* is almost equal to the load torque on it, resulting
in a very tiny angular acceleration. As a result, we can conclude that
the system is almost in a stationary condition after 1000 seconds from
Expand All @@ -156,7 +158,7 @@ We can get a more general view of the system by plotting the time
variables of each element with respect to time:

```python
transmission.plot(figsize = (12, 8))
transmission.plot(figsize = (12, 9))
```

![](images/plot_1.png)
Expand All @@ -182,7 +184,7 @@ sorts:
- the elements: the motor on the left and following elements proceeding
to the right,
- the time variables: kinematic variables at the top and torques in
the last row, in the same plot.
the second-last row and force in the last row, in the same plot.

We can see that at 1000 seconds the angular speeds of *motor* and
*gear 4* are almost constant, confirming the insight previously
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions docs/source/examples/simple_transmission_chain/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Simple Transmission Chain
=========================


.. mdinclude:: README.md


.. toctree::
:hidden:

README
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def ext_torque(time, angular_position, angular_speed):
load_torque_unit = 'mNm')


transmission.plot(figsize = (12, 8))
transmission.plot(figsize = (12, 9))

transmission.plot(elements = ['gear 4', motor],
variables = ['torque', 'driving torque', 'angular speed', 'load torque'],
Expand Down
Loading

0 comments on commit 7411352

Please sign in to comment.