Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make an app for structural calculations? 2

Status
Not open for further replies.

milkshakelake

Structural
Jul 15, 2013
1,116
I'd like to make some mini calculation apps for my own purposes. I keep running into calculations that don't have canned solutions on the market, or the canned programs are too limited or complicated. I have no plans at the moment to release these mini apps to the public; I just want to streamline my workflow. I'm a beginner at programming. How do I get started? And is there a simpler tool for what I want to accomplish?

First goal: Calculation for CMU/concrete shear wall that has graphical output. Things like vertical rebar, horizontal rebar, thickness, end rebar, etc should be annotated.

My plan: Some Googling showed that web apps are the modern way to go. I'm looking at React.js at the moment.

Items needed:
1. Graphics are super important. For example, I need to have graphs and sketches/diagrams with annotations. Zooming/panning of graphics would be useful.
2. Save/load file capability.
3. It would be nice, but not necessary, to print the results. This might be hard for a beginner to program.
4. Also nice, but not necessary, is to have formulas look like formulas.

What doesn't work:
1. Excel VBA. It's great for most cases, but making graphical output is hacky and complicated. And it doesn't have things like zooming/panning, which makes it less useful.
2. Programs where I can attach an image and just update the annotation based on calculations. For example, if I do a concrete beam calculation, I want it to show the rebar and depth, not a generic beam with annotations like (5)#7.
 
Replies continue below

Recommended for you

Celt83 - a couple of questions on MathJax:

- What is CDN?
- Is it possible to link to it from Excel (via Python, or even Javascript, if necessary)?

Doug Jenkins
Interactive Design Services
 
CDN = Content Delivery Network I believe, which works a bit like a torrent where the data for the script is stored on various global severs and fetched by individual users machines on demand vs me downloading the script and serving it from my web server.

I’m not sure if you’d be able to reference Mathjax via excel. It is installable as a node.js package which seems similar to something like a pip install on python.

I'm making a thing: (It's no Kootware and it will probably break but it's alive!)
 
Guys and/or gals, I'm back with another question. I'm looking a few years ahead and there is a remote but possible future where I'd want to sell the software and have some licensing attached to it (similar to Enercalc, Tedds, etc). Does that change anything? For one thing, does that put Python out of the question? Since the calculations in the Python case would be run on a server, not the client computer, but I'd want the client computer to run it.

Sorry if this question offends anybody, as I get the impression that all of you are pro open source.
 
Nothing wrong with wanting to get some compensation for your work.

I have not read into any licensing schemes but it really depends on your distribution model. If you plan on compiling the software and selling an exe you can do that with Python, C#, C++, Java, etc. You are going to have to program a full blown GUI which can have it’s own challenges along with some possible licensing issues, QT for example would require a licensing fee if your distribution is for profit.

You’ll notice a trend among software to being Cloud based which marketing will spin it as being always up to date, accessible, etc. but the real reason is because piracy is much harder and the income stream is a constant. If you can manage the server expenses then something like React, Node, Flask+Python, Django+Python, etc. linked to a database will have you covered.

I'm making a thing: (It's no Kootware and it will probably break but it's alive!)
 
Personally I like the web-based app paradigm if you are doing calculations that aren’t too cpu intensive. Obviously large FEM analysis doesn’t fit into that very well, but quick calcs and design tools probably do. I hate having to maintain licenses for installed software (spColumn, etc).

If you use python similar to Celt83, on the server, it doesn’t change much. He could implement paid user accounts in basically the same way I would in React. However, If you use python in the form of jupyter notebooks or something like that, it’s very hard to keep control of your work once it leaves your hands. You can’t really build a licensing model, and need to rely on trust instead.



-JA
try [link calcs.app]Calcs.app[/url] and let me know what you think
 
Thanks for the continued help! Regarding cloud based software, I'd only make it cloud based for the licensing part of it, not running the actual code. There's a problem with latency that could slow down the software in a way that affects usability (I had problems like that in certain online software that I won't name...okay fine, Forte and Hilti and Quickbooks). But it's something I'll have to test out. I have an HP server with 40 cores, will try that to start out, in about a year when I get good enough [pc2]

I do have a problem with making CPU intensive brute force calculations. I numerically integrate lots of things and/or have the computer try every possible solution (discarding some obviously wrong stuff before it runs). And I'm not good enough yet to do upper and lower bound stuff that "traps" the answer in the middle, or things like Newton's method, or Monte Carlo simulation, or finding a way for the computer to understand if it's converging on a solution except for seeing if dy/dx decreasing. I definitely need to learn more math, statistics, and programming elegance. And then there's the UI stuff. I'll figure it out in time...got a mountain to climb.
 
I use python with django and implementing paid user accounts at this point would be pretty easy from my understanding.

You do not have to go into details on what type of calcs you want to run in the future, but what do you envision being super computer intensive to where you would run into latency issues? I have yet to experience much latency with cloud Hilti.

My end goal is to have a stripped down FEM sort of program on my site for diaphragm analysis and at this point, cloud based still seems possible. Hopefully it stays this way.









S&T -
 
I struggled hard with the numerical methods, wish more undergrad programs introduced this stuff, I found this book by Chapra recently which has good explanations. Link

I have the absolute cheapest hosting package for a feel for latency on a complicated calc try a 6 span beam with one of the spans a cantilever with a partial length dead, live, snow, and wind loads and also switch to LRFD combos in my simple beam program that will have it do full permutations on patterning and a majority of the IBC load combos.

I'm making a thing: (It's no Kootware and it will probably break but it's alive!)
 
You must have caught it at a good time I can either get the server to time out or chug for 45-60 seconds. 6 spans with live, snow and wind and LRFD combos is several million computations once you get into the function evals for the graphs. Thats why at 7 spans I swap to simplified patterning as the computations balloon to several hundred million and usually run out of RAM addressing space.

I'm making a thing: (It's no Kootware and it will probably break but it's alive!)
 
@Celt83 @3DDave Thanks for even more great resources! All of you people are so helpful and I'm very grateful.

@sticksandtriangles For one computationally expensive example, I made an Excel spreadsheet that automatically calculates optimized footings for given loads, dimensions, and restraint conditions. The analysis part is really simple, it doesn't need programming. But design is difficult because it has to run through hundreds of thousands of combinations of depths, dimensions, and rebar sizes. It used to take 10 minutes to run one calculation. After many optimizations and rewrites, it takes 20 seconds, which is still too long. With some better math knowledge like in Celt's reference, I could probably speed it up more. Either way, I had to make it because it has functionality that doesn't exist in the market, which is a frustration I think many engineers have.

@Celt83 It took a few seconds for me. Not bad!
 
@Celt83 Sorry to revive this old thread, but I have one more question. Do you think it's a good idea to develop in Linux? I've been pushing up against some annoying stuff in Windows, like how many Python tutorials use a Linux command line. And so much useful stuff works well in Linux only, like Apache and Docker. The only reason I hesitate and I have to ask is because I'm super comfortable in Windows and learning Linux more would be another layer of stuff to learn. My Linux knowledge is quite basic. But maybe it's worth it to make the leap.
 
I’d say stick to windows if that is what you are familiar with and more importantly if that is where your users will run your app. The tutorials are likely just using a command prompt which exists in windows as well. If you installed Anaconda it has it’s own command prompt you can run.

Apache you can spin up on windows but thats a web server and getting beyond app stuff at that point. I’m not really familiar with Docker but have heard of it.

Personally I’d focus on getting comfortable using Windows command prompt as a good chunk of the knowledge will be transferable. If you really want to give linux a go try it out as a virtual machine using virtual box that way you can nuke the install and not worry about losing anything.

I'm making a thing: (It's no Kootware and it will probably break but it's alive!)
 
Got it, thanks for the advice. Apache would be for serving the flask site to the internet instead of using a cloud server; had a hard time getting it to run in Windows, but I’ll keep trying.
 
In case you weren't aware for testing purposes you can run flask locally and it will create a dev level server that you can access from your machines browser at 127.0.0.1:5000.
Here is the flask quick start guide: Link

If you're at a point where you want it live on the internet, then I would recommend getting something like a raspberry pi put debian on there spin up a LAMP stack, the below guides from my hosting service will work just as well for a home spun server as for a hosted one:
LAMP Stack on Ubuntu
Nginx vs Apache
Nginx Essentials
Serving Flask with Nginx
Flask related tutorials

I'm making a thing: (It's no Kootware and it will probably break but it's alive!)
 
@Celt83 I was looking at some of the same tutorials. I have Flask running and I know it can spin up a localhost. I'm looking for a permanent production level solution (also because I have other stuff running on other IPs and looking to serve them to my employees; the internet is full of useful self-hosted stuff). I've been toying around with a LAMP stack on an Ubuntu VM and that's what got me started of thinking of going all in with Linux. Thanks for validating my approach!

I like to think I'm a passable engineer and businessman, and this programming and tech stuff will take me to the next level like the famed dik. I ended up buying most of the book recommendations on this thread and I'm going through some of the easier ones.
 
Quick update. I dove into Flask too early, and it was incredibly hard to learn without a Python background. I went back to learning the basics of Python. It helps to do a lot of easier exercises before diving into structural analysis. Knowing other languages like Javascript and Visual Basic didn't make me automatically adapt to Python. This is a lot harder than I imagined. But I'm getting there!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor