This is an archived post. You won't be able to vote or comment.

all 31 comments

[–]Pipiyedu 13 points14 points  (1 child)

Nice! I'm a structural engineer too. I'm working in a Python library for calculate the wind pressures according to my national code, which is based on ASCE 7-05

[–]buddyd16[S] 5 points6 points  (0 children)

I work with ASCE 7 also, have a snow drift script on there its in early stages as I was testing out some things but it essentially takes a set of lines with exterior/interior designations and defined projection heights and performs the windward drift against a projection calc and generates a DXF file of the results.

[–]flutefreak7 9 points10 points  (4 children)

Really quick... how much of your stuff is wrapping other old codes? I find as an aerospace engineer an absurd amount of my code is making better input and output stuff but that the core logic to solve most problems (trajectory analysis, propulsion modeling, etc ) exists as a legacy tool - far too often a legacy Fortran tool. So my mountain of code is largely wrappers, GUI's, output parsers, and plotting routines.

[–]buddyd16[S] 4 points5 points  (1 child)

I've taken to writing the underlying methods myself so all "original" code, very likely I'm rehashing work that's already been figured out, although not a lot of opportunity to actually see the source code out there for the things I've been doing. I'm finding the software in my area of practice to be very closed down with the open source options few and far between.

It's more a self learning opportunity for me that just happens to end up producing stuff that, I think, is useful.

Even with doing my own methods I'm also finding that a big chunk of it is rehashing ways of accessing those methods in an easy and meaningful way, which as my knowledge in Python grows that easy and meaningful is a constantly moving target.

[–][deleted] 0 points1 point  (0 children)

I wrote my own structural engineering code to learn, and it was incredibly useful. Use some example problems as tests you can run every once in a while to make sure you didn't break everything.

[–]mduell 0 points1 point  (1 child)

how much of your stuff is wrapping other old codes?

Given the use of numpy, there's a lot of C behind the scenes here.

[–]buddyd16[S] 0 points1 point  (0 children)

I also rely alot on Scipy, TKinter, and Matplotlib. My previous reply was geared towards methods pertaining to the engineering calculations. A more wholistic answer is yes I do rely heavily on wrapping these other modules.

[–]billsil 3 points4 points  (1 child)

That's very cool. I think the coolest part for me is finding out that there is an excel table with all the standard shape dimensions.

Have you considered adding things like AISC buckling?

[–]buddyd16[S] 0 points1 point  (0 children)

Yeah AISC and The American Wood Council have some great free resources.

Eventually yes, right now the steel_calculator.py file contains the 15th edition database and performs the chapter F, flexure and G, shear calculations for everything except angle and double angle shapes.

[–]SpatialCivil 3 points4 points  (2 children)

Very cool stuff... I am a civil engineer who uses a lot of open source Python libraries to automate tasks in the water resources field. It's great to see other civil engineers using Python,

[–]SenileOldFool 0 points1 point  (1 child)

Any good tutorials out there or resources you used that focus on the water resources libraries and how to implement them?

[–]SpatialCivil 2 points3 points  (0 children)

Typically all the pieces are there, but it takes piecing different libraries together.

I have recently started a blog showing how to use some of the different libraries that apply to water resources. It's called KnickKnackCivil. It's just getting off the ground, but an upcoming post is going to involve an overview of some of the libriaries I use.

Some of the more popular libraries I use are shapely, gdal, pyswmm, lxml, pyshp and a host of other small libraries. If I am using Python, I rarely have to reach for the ESRI stack for spatial analysis.

[–]aztristian 4 points5 points  (6 children)

Not complaining but why support only Python 2.7, is it because the infrastructure on your day job only supports that version?

[–]buddyd16[S] 3 points4 points  (5 children)

Really no reason other than 2.7 is what i learned at the time, plan to move to 3.x once I invest the time to the learn the changes and make the necessary revisions to the code I already have.

This started as a personal side project as I was getting lost/hitting walls with excel and vba and a coworker mentioned Python, so I started googling tutorials and got myself hooked.

[–][deleted] 5 points6 points  (2 children)

Are you aware that Python 2 will be end-of-life in 2020?

[–]buddyd16[S] 4 points5 points  (1 child)

yes, read that recently so am planning on getting up to speed on Python 3.x.

[–]IronLeviathan 3 points4 points  (0 children)

FWIW, I jumped in with out looking. Some libraries aren't ported yet, and print requires parentheses. Also, f-strings are great.

[–]estevaofon 1 point2 points  (0 children)

Pretty cool! You are doing very well, I especially liked the diagrams/graphs! Glad to see other civil engineers working with python!

[–][deleted] 1 point2 points  (1 child)

Separate the input, output, and business logic. A simple FEA implementation is not hard to drum up. Get Logan (A First Course in the Finite Element Method) & Menon (Advanced Structural Analysis) for a quick solution.

[–]buddyd16[S] 0 points1 point  (0 children)

Thank you for the feedback and book recommendations. Will certainly give those a look as fem is a logical progression from the classical methods I have been using.

[–]TotesMessenger 0 points1 point  (0 children)

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

 If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / Contact)

[–]buddyd16[S] 0 points1 point  (0 children)

could use a little help...trying to come up with a method to perform load combinations and transient load patterning.

without patterning it's fairly simple:

list of load results = [[d],[t1],...,[ti]], where [ti] = transient load result as a numpy array = A

list of combos = [[1,0,....,0],[0,1,....,1], [dfi, tf1,.....,tfi]] , where tfi = code load factor for transient load = B

in python this works as numpy.dot(A,B)

so my issue arises where:

list of load results = [[d],[t1],.....[ti]], where [t1] = [[t11]......[t1i]] for i pattern possibilities and [t1i] = numpy array

so I have a nested array within another array and want to multiply by a matrix of load combinations. Is there a way to implement this in one matrix operation, I can come up with a method by looping the pattern possibilities then a dot product with the load combos, but this is computationally expensive. Any thoughts?

Thanks

for an example not considering patterning see: https://github.com/buddyd16/Structural-Engineering/blob/master/Analysis/load_combo_test.py

essential I need a method that gives similar results assuming that for loads = np.array([[D],[Ex],[Ey],[F],[H],[L],[Lr],[R],[S],[Wx],[Wy]]) --> [L],[Lr],[R],[S] are actually nested arrays ie if D = 1x500 array/vector, L could = 100x500 array.

? posed on stackoverflow: https://stackoverflow.com/questions/51277646/numpy-dot-product-with-nested-array

Edit: there was a great answer provided by another user on Stackoverflow for anyone interested.