Git Product home page Git Product logo

python-gearbox's People

Contributors

efirvida avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-gearbox's Issues

Improper interpolation in S-N curve in the **__ynt** function

In the __ynt function the interpolation is not done well

From the standard, we can see that the SN curve is linear in a Log-Log diagram. The interpolation should take that into account

Instead of doing:

result.append(interp(nl, x, y))

I think it would be more accurate to do:

result.append(10**interp(log10(nl), log10(x), log10(y)))

If this is done the intermediate points of y = [1.4, 1.79 etc ] could be removed.

Crash if brinell harness > 470

Very internesting project. I have noticed a bug

If the brinell hardness is set larger than 470 the code will crash.

For exampe, in demo.py

material = Material(
    name='AISI 2010',
    classification='NV(nitrocar)',
    sh_limit=1500.,
    sf_limit=460.,
    e=206000.,
    poisson=0.3,
    density=7.83e-6,
    brinell=471
)

Will lead to the following stacktrace

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-49-6fb335e20cc5> in <module>
    109 )
    110 
--> 111 p1 = isoPitting(transmission=transmission).calculate()
    112 b1 = isoBending(transmission=transmission).calculate
    113 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\python_gearbox-0.1.2a0.dev0-py3.7.egg\gearbox\standards\iso.py in calculate(self)
    444         zv = self.__zv(pair)
    445         zr = self.__zr(pair)
--> 446         zw_one, zw_two = self.__zw(pair)
    447         zx = 1
    448 

TypeError: cannot unpack non-iterable float object

Reason is simple

    def __zw(self, pair):
        rz_one = pair.gear_one.rz
        rz_two = pair.gear_two.rz
        hb_1 = pair.gear_one.material.brinell
        hb_2 = pair.gear_two.material.brinell
        v40 = self.transmission.v40
        v = pair.v

        rzh = ((rz_one * (10 / self.__r_red(pair)) ** 0.33) * (rz_one / rz_two) ** 0.66) / ((v40 * v / 1500) ** 0.33)

        if rzh > 16:
            rzh = 16
        if rzh < 3:
            rzh = 3

        if hb_1 < 130:
            return 1.2 * (3 / rzh) ** 0.15                                                                              # Here it returns a float
        elif hb_1 > 470:
            return (3 / rzh) ** 0.15

        if hb_2 < 130:
            return 1.2 * (3 / rzh) ** 0.15
        elif hb_2 > 470:
            return (3 / rzh) ** 0.15

        return (1.2 - (hb_1 - 130) / 1700) * (3 / rzh) ** 0.15, (1.2 - (hb_2 - 130) / 1700) * (3 / rzh) ** 0.15         # Here it returns a tuple

Confusing parameters in Transmission

In the transmission class the parameters are quite confusing

transmission = Transmission(
    gears=pair,
    lubricant=lubricant,
    rpm_in=1450.0,
    rpm_out=243.5,            # Why is this not calculated automatically from rpm_in?
    n=40.0,                   # This should be called P according to the ISO standard
    l=10000.0,
    gear_box_type=2,
    ka=1.3,
    sh_min=1,
    sf_min=1
)

I propose to rename n to P, and to remove the rpm_out parameter.

Error running demo.py

I get the following error when I run the demo.py file:

/python-gearbox-master/gearbox/standards/iso.py in __yb(gear)
    909             return 1.6 * log(2.242 * 1 / srh)
    910         else:
--> 911             raise Exception('External gears require: sr/ht > 0.5')
    912 
    913 
Exception: External gears require: sr/ht > 0.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.