Example axle calculation

Illustrate the creation of an axle calculation report. The formula's are mostly based on Roloff/Matek - Maschinelemente which can be found here (Springer link)[http://link.springer.com/book/10.1007%2F978-3-658-09082-1]


In [ ]:
import matplotlib.pyplot as pl
%matplotlib inline
from IPython.display import display, Latex, Math
from pymech.units.SI import ureg, Q_

import pymech.fmt as fmt
from pymech.materials.Steel import Steel
from pymech.materials.ApplianceFactor import ApplianceFactor, Bumps
from pymech.axle.Properties import Properties
from pymech.axle.Axle import Axle

In [2]:
prop = Properties()
prop.geometry = fmt.Geometry(1000)
prop.geometry.addpoint(fmt.Point(100, known=False))
prop.geometry.addpoint(fmt.Point(500, f=500.))
prop.geometry.addweight(fmt.Point(600), fmt.Point(800), 20.)
prop.geometry.addpoint(fmt.Point(950, known=False))                     

prop.material = Steel()
prop.material.load(filename='pymech/resources/materials/S235JR.mat')
prop.appliancefactor = ApplianceFactor(drivingmachine=Bumps.NO_BUMPS, machine=Bumps.LIGHT_BUMPS)

In [4]:
axle = Axle(properties=prop)
axle.solvegeometry()
axle.plotfmt(figsize=(15,8))



In [5]:
d_prime = axle.d_prime(pretty=True)
d_prime[1]


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-2fcff07666e1> in <module>()
----> 1 d_prime = axle.d_prime(pretty=True)
      2 d_prime[1]

/projects/medusa/pymech/pymech/axle/Axle.py in d_prime(self, pretty)
     86                              Latex.frac(self.M_b(), self.properties.material.sigma_bWN),
     87                              3) + r" \approx " + Latex.toStr(d_prime)]]
---> 88             pr = Latex.display(Latex.array(formArray))
     89             return [d_prime, pr]
     90         else:

/projects/medusa/pymech/pymech/print/Latex.py in array(obj)
    115 def array(obj):
    116     cStr = "c"
--> 117     for n in range(1, len(obj[0]) - 1):
    118         cStr += "c"
    119     retStr = r"\begin{array}{" + cStr + r"}"

TypeError: object of type 'Latex' has no len()

In [1]:
k = 0.5
d_a = axle.d_a(k=k, pretty=True)
d_a[1]


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-7d784996629f> in <module>()
      1 k = 0.5
----> 2 d_a = axle.d_a(k=k, pretty=True)
      3 d_a[1]

NameError: name 'axle' is not defined

In [ ]: