-
Notifications
You must be signed in to change notification settings - Fork 6
/
pkmodel.py
42 lines (31 loc) · 1.2 KB
/
pkmodel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""Implementation of Piotrowski-Kik contact model.
Details and references about the model can be found in README.
In the following code the adopted naming convention is the one of
`PEP 8 <https://www.python.org/dev/peps/pep-0008/#naming-conventions>`_
with the exception that the function and method names are mixedCase.
.. module:: pkmodel
.. moduleauthor:: Rostyslav Skrypnyk
"""
# Standard library imports:
import os
import sys
sys.path.insert(0, os.path.abspath('./lib')) # Add lib to path.
# 3rd party imports:
import numpy as np
# local library specific imports:
import settings as s
import pkmodellib as pkl
import geometry as geom
def main():
rail, wheel = pkl.getProfiles(s.rail_path, s.wheel_path)
new_wheel = pkl.equalPoints(wheel, rail)
interpen = pkl.interpenetration(new_wheel, rail,
s.virtual_penetration)
max_pressures = pkl.maxPressure(new_wheel, interpen,
s.wheel_radius, s.E, s.nu,
s.penetration, s.virtual_penetration)
print max_pressures
# End of function main.
# Make sure main() does not run when the file is being imported:
if __name__ == '__main__':
main()