Git Product home page Git Product logo

structural-design's People

Contributors

ewdy avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

counterflow

structural-design's Issues

Want to add feature to Beam_2.ipynb to calculate deflection

At present, Beam_2.ipynb calculates the shear and moment for simply supported beam with partially distributed load. It does not yet calculate deflection. I believe that I can easily implement this using Moment-Area Theorems where the change in slope between any two points is equal to the area of the M/EI diagram between these two points. See Structural Analysis by R.C. Hibbeler 4th Edition, pages 280 to 288.

Requirements

I have found that the notebook "beam_1.ipynb" runs without error on my desktop (python 3.7.something) installation of jupyter lab but it returns errors (see quote below) when run on CoCalc (python 3.6.something). I may need to specify requirements for running notebooks and/or add testing of required libraries at the top of notebooks.

# create beam array and load with position, shear, moment and deflection values
beam = np.zeros((4, SAMPLE_SIZE))
beam[0, : ] = np.linspace(0, L.magnitude, SAMPLE_SIZE) # position
for i in range(SAMPLE_SIZE):
    beam[1, i] = shear_x(beam[0, i]*L.units, P, a, L).magnitude # stuff shear values
    beam[2, i] = moment_x(beam[0, i]*L.units, P, a, L).magnitude # stuff moment values
    beam[3, i] = deflection_x(beam[0, i]*L.units, P, a, L, EI).magnitude # stuff deflection values
# beam[0:]
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-8-3cac110d7e7a> in <module>()
      3 beam[0, : ] = np.linspace(0, L.magnitude, SAMPLE_SIZE) # position
      4 for i in range(SAMPLE_SIZE):
----> 5     beam[1, i] = shear_x(beam[0, i]*L.units, P, a, L).magnitude # stuff shear values
      6     beam[2, i] = moment_x(beam[0, i]*L.units, P, a, L).magnitude # stuff moment values
      7     beam[3, i] = deflection_x(beam[0, i]*L.units, P, a, L, EI).magnitude # stuff deflection values
<ipython-input-5-787cab1916c6> in shear_x(x, P, a, L)
     15     """
     16     b = L - a # derive b given a and L
---> 17     if x >= 0 and x <= a:
     18         V_x = (P*b)/L
     19     elif x > a and x <= L:
/usr/local/lib/python3.6/dist-packages/pint/quantity.py in <lambda>(self, other)
   1077     __lt__ = lambda self, other: self.compare(other, op=operator.lt)
   1078     __le__ = lambda self, other: self.compare(other, op=operator.le)
-> 1079     __ge__ = lambda self, other: self.compare(other, op=operator.ge)
   1080     __gt__ = lambda self, other: self.compare(other, op=operator.gt)
   1081 
/usr/local/lib/python3.6/dist-packages/pint/quantity.py in compare(self, other, op)
   1065                 return op(self._convert_magnitude_not_inplace(UnitsContainer()), other)
   1066             else:
-> 1067                 raise ValueError('Cannot compare Quantity and {0}'.format(type(other)))
   1068 
   1069         if self._units == other._units:
ValueError: Cannot compare Quantity and <class 'int'>

Add nice report output to Beam_1.1.ipynb

Notebook Beam_1.1.ipynb does its intended job of deriving shear, moment and deflection when given acceptable user values. What it presently lacks is a nice, printable output. Currently, exporting the notebook to pdf yields all of the hidden code and test data. Add feature to output results to some other format cleanly.

Add support for units to Beam_1.ipynb

At present, Beam_1.ipynb calculates shear, moment and deflection using values sans units supplied by the user. This forces the user to use consistent and appropriate units. Adding support for units would relieve much of this error prone burden from the user. I plan to do this using the PINT module as I have in several other notebooks. See https://pypi.org/project/Pint/

Need test case and expected results for Beam_1.ipynb

Beam_1.ipynb calculates and plots shear, moment and deflection for a concentrated load on a simply supported beam. At present, it lacks a test case with known results for evaluating and verifying code. Need to find a sample case in published literature and add to notebook so others can independently verify results.

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.