Coder Social home page Coder Social logo

tompouce's Introduction


License: MIT made-with-python

An object-oriented implementation of the Classical Lamination Theory in Python.

Example

Consider a C/PEEK drive shaft with a length of 1.25 m, a wall thickness of 2 mm, and a radius of 50 mm. The shaft has a [45/-45]s layup and is subjected to a torque of 500 Nm. We will determine the maximum angular deformation of the shaft.

from tompouce import Material, Laminate, torsion_shaft
from numpy import rad2deg, deg2rad

# Parameters
length = 1.25
radius = 50E-3
torque = 500.0

# Create a Material object using data from a json file
TC1200 = Material('materials/TC1200_UD.json')

# Create a Laminate object
ply_thickness = 0.5E-3
layup = [45.0, -45.0, -45.0, 45.0]
shaft = Laminate(deg2rad(layup), TC1200, ply_thickness)

# Create a Load object
load = torsion_shaft(torque, radius)

# Print the loads and deformations
shaft*load

Which provides a summary of the loads and the resulting deformations:

Deformation                               Load        Thermal Load

{ 0.00E+00}     [ a a a | b b b ]    ( { 0.00E+00}    { 0.00E+00} )
{ 0.00E+00}     [ a a a | b b b ]    ( { 0.00E+00}    { 0.00E+00} )
{ 4.54E-04}     [ a a a | b b b ]    ( { 3.18E+04}    { 0.00E+00} )
{---------}  =  [---------------]    ( {---------} +  {---------} )
{ 0.00E+00}     [ b b b | d d d ]    ( { 0.00E+00}    { 0.00E+00} )
{ 0.00E+00}     [ b b b | d d d ]    ( { 0.00E+00}    { 0.00E+00} )
{ 0.00E+00}     [ b b b | d d d ]    ( { 0.00E+00}    { 0.00E+00} )

The deformation can also be calculated and then used to determine the angular deformation:

# Calculate and print the deformation
_, d = shaft.loaddef(load)
angle = d[2]*length/radius
print(f"The angular deformation of the shaft is {rad2deg(angle):.2f} degrees.")
The angular deformation of the shaft is 0.65 degrees.

Here you can find a small example gallery, which should give you a pretty good idea what tompouce can do and how things work.

Install

You can install tompouce using pip:

pip install git+https://github.com/wjbg/tompouce.git

Alternatively, you can also clone or download this repository as zip file. Tompouce is reasonably well-documented - if I may say so - and the annotated examples should be sufficient to get you started.

Alternatives

There are many alternative implementations of the CLT in Python. One of these is my own wjbg/py.CLT, which follows a functional programming paradigm. For more alternatives, please check out this (non-exhaustive) list:

License

Free as defined in the MIT license.

tompouce's People

Contributors

wjbg avatar

Watchers

 avatar

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.