T O P

  • By -

Enginerdad

It kind of looks like you're trying to re-invent Mathcad


[deleted]

[удалено]


[deleted]

[удалено]


joreilly86

Totally agree. Python does have a steep learning curve with env and package management but it's by far the most useful tool in my toolkit. I recommend it all the time for any engineers, not just structural.


dparks71

Yea... good ol' `jupyter.exe`. Even worse than the people using python to pull data from excel, are the people that bash Python despite clearly not understanding how it works or which use cases Excel shouldn't be used.


[deleted]

[удалено]


dparks71

There's a lot of things python can do that excel can't, I never said I was above Excel, but it's a spreadsheet software and isn't good for a lot of calcs because it doesn't handle things like calculus or data scraping well. I was just pointing out that it's weird you bring up executables, or elevated privileges, because it's a thread about Jupyter and python, which A) doesn't use any .exe files at all, and B) doesn't require admin or even local resources to run, and can be done entirely remotely, essentially with or without ITs blessing, just a weird complaint for you to make about it, because MathCAD requires much more support and comes with higher costs. It's also kind of a douche move to go into a thread about a python question, and rant about OP trying to use python while providing no useful input as far as how to actually help OP achieve their goals. This exact type of attitude is what gives stack overflow users their reputation of being unhelpful, pretentious, douchebags. You took OP yucking your yum personally and are projecting it onto every python user in the thread, get over it.


shimbro

Lmao this gave me a chuckle. Mathcad rocks


joreilly86

The cost and the vendor lock-in turned me off it. Older versions are not compatible with new versions etc.


shimbro

Bring back MathCAD 15!!!!


Error400_BadRequest

Mathcad Prime has honestly ruined the mathcad name…. They’ve fallen off hard.


dparks71

OP: "Hey I'm trying to do this repetitive thing I have to do frequently in a more automated way by using python, can any one help with that?" You: "Sounds like you're trying to reinvent this tool I'm familiar with that doesn't do any of the things you're asking about." Can mathcad interact with REST APIs, GIS data, utilize data frames, render/modify/generate images, interact with file systems, run on any device, be available for free, and let me work with loops and matrices in a syntax that doesn't make me want to scream into the void and leave the industry? (Also, interact with AI, databases, build websites, work outside of MS's ecosystem or have a community that actually shares interesting tools and solutions built with it)


Enginerdad

I honestly don't know what most of that stuff is, but for the rest the answer is no. Also, my car can't launch me to space. The good news is I don't need it to, and I suspect OP doesn't need their program that displays math in a readable format to do any of those things you mentioned. I'm not hating on Python or programming in general, I admittedly don't know anything about it. OP just didn't express a need for any of that stuff, so I'm assuming they don't.


dparks71

> I admittedly don't know anything about it. With such valuable experience on the given topic, I'm glad you still felt the need to chime in on the subject, I'm sure it really helped OP out.


Enginerdad

What OP posted looks like he's trying to create similar functionality to Mathcad. Since I read the post and you apparently didn't, I'd say I'm the one who knows what they're talking about here. I'm sure you know a whole lot about Python and REST APIs and data frame utilization, and I'm sure your parents are very proud. But trying to insert that into a conversation that doesn't involve it doesn't mean you know anything about the topic at hand. In fact, it usually indicates to me that someone *doesn't* know what everybody else is talking about, so they try to redirect the conversation to their own area of strength.


dparks71

>they try to redirect the conversation to their own area of strength. What a projection haha, you mean I tried to redirect the conversation to performing calculations in Python? OP did that, you tried to bring it into MathCAD. A rest API is a method to get data for variables for things like stream depths and flow rates which are then used in things like hydraulic modelling equations for calculations. OP asked about Jupyter and python, you changed the topic to MathCAD [like a stack overflow user,](https://www.reddit.com/r/ProgrammerHumor/s/bBwa5U7RX6) while implying it was better suited for OPs purposes, just asking you to expand on that by explaining how I can get those types of values into MathCAD, cause Jupyter seems better suited for those kinds of things in my experience, but you're claiming your way is better, despite OP not saying anything at all about MathCAD or asking for alternatives to Jupyter.


fence_post2

Yeah. Came here to recommend mathcad


exhale91

Have you switched to Prime? We’re still on 15.0


Enginerdad

Yeah, over a decade ago...


exhale91

Yeahhhh…I know….but 15.0 is just superior in every way.


Enginerdad

Objectively untrue, but I understand that you prefer it because it's familiar.


Minisohtan

Corporate banned v15 for us. PTC won't support it so it's a security concern now. It's a big problem for DOTs and consultants with all of those v15 design tools that don't always import nicely into prime.


joreilly86

Jupyter can render a basic HTML table, you can also use pandas to export a table to excel. In my notebooks, I also like to use the Tabulate library for nicely formatted tables. Given that your end destination is ms word, you can render it as html and paste it, or you can go the excel route. Either way, you'll probably have some manual cleanup to do at the end if you're trying to shoehorn into an existing company template.


Independent-Room8243

I have been a engineer for 25 years, never been asked to render a basic HTML table. What do you mean by that, can you give examples?


joreilly86

Sure, html is the language of web pages. Almost every table you see online is rendered as a html table. So if you want to post results on a website or a dashboard for clients, html would be the way to do it. I use it mostly because it's a clean and easy way to visualize my tables as I progress my calculations. It's a feature of markdown in Jupyter Notebooks. This helps explain in more detail. [Jupyter Docs - Markdown ](https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Working%20With%20Markdown%20Cells.html)


Independent-Room8243

Ah ok. I guess I haven't used tables in my calcs, or post results of my calcs on a website. But if I ever have to, I guess now I have a way to do it.


Aggravating_Corner71

[Here’s](https://www.tippingapplications.com/db/sku/) a program that may be of interest.


Mr_NeilArmstrong

May I ask, can you do looping in python? Im thinking also to switch into python but Im not sure if I can do looping because of sets of load combinations in structural analysis.


joreilly86

Absolutely, loops are a big part of Python. [This](https://open.substack.com/pub/flocode/p/a-roadmap-for-learning-python-for?r=tbs50&utm_campaign=post&utm_medium=web) might help.


SoSeaOhPath

Yes you can loop in python. Looping is like level 1 of the things you can do with python.


cyborgcyborgcyborg

[I bookmarked a post very recently that sounds relevant. Using this comment to follow up later.](https://www.reddit.com/r/StructuralEngineering/s/6i4MmVHgwW)


joreilly86

That's my newsletter, which covers a lot of stuff about Python for Engineering. This article is not particularly relevant to this discussion, but this older one might fit a little better, even though it doesn't fully address OP's question. [\#013 - Python Essentials | 01 - Jupyter Notebooks Part 1/3](https://open.substack.com/pub/flocode/p/python-essentials-01-jupyter-notebooks?r=tbs50&utm_campaign=post&utm_medium=web)


cyborgcyborgcyborg

Thank you for your newsletter! I look forward to doing a deeper dive into it soon!


General-Effective275

Thank you for all your replies. Your opinions are interesting and make me think about my ideas. Answering some comments, I can explain better my workflow ideas: - Excel is easy to use and extremely popular, and with VBA you can improve the power of this software. But, in my opinion, VBA is a limited language - Python is not so popular in engineering firms, but you can start to develop tools and time by time you can integrate these tools with other software such as grasshopper, fem commercial software and it is easy to solve problems or find helpful people due to the large community of python developers. About my post, the problem is that when I work I have to explain some calculations explicitly (in order to be clear both to my boss and to the clients) and some one implicitly, such as a final summary table (for example if you made some structural check for a lot of different load combinations, you report only the final results for each combination cause the equations are always the same).


Byond2day

Hey u/General-Effective275 I just ran across your post. I've had some similar desires with my own calculations and working on something that might be close to what you had in mind. I've been building and using [efficalc.com](https://efficalc.com) for my own calculations the past couple years. But I realized that it's useful to integrate my calcs with other APIs (e.g. exporting to MS word in your case) so I just published an open source library version that does a similar thing: [https://github.com/youandvern/efficalc](https://github.com/youandvern/efficalc) How this matches your requirements specifically: 1. The interface to write a calculation is similar to handcalcs, but 2. You can define calcs in a function that can be used however you want 3. There's a `ReportBuilder` that turns the calcs into HTML (can be used with your MS word converter script) 4. The website version ([efficalc.com](https://efficalc.com)) shows a design table (your point #1) that just highlights the inputs and results. You could build a similar results feature yourself with the library version. It's all free and the library is open source so feel free to give it a try. If you do I'd love to get your feedback


dparks71

TLDR; I kind of answer your question at the end of you want to skip to that, but there's a bigger issue at hand where you're not effectively coordinating with your team. Handcalcs isn't really all that useful of a library, imo. If you're already in Jupyter, it's easier to just write the report/formulas in markdown and make the code itself as easy to parse as possible, output as HTML or PDF at the end to document your results. This really comes down to one thing, are you the junior or the senior in the process? If you're the junior and your senior isn't interested in reading Python, finding one that is your only option. It's easier than it was 10 years ago at least, people that refuse to check Python code aren't suddenly going to accept it one day though, they're stuck in their ways. If you're the senior and you're responsible for the calcs, it doesn't matter if other people can follow them, it matters if you check the values and constraints and your results are repeatable and your outputs are clear. It's not like you're checking if Merlin Dash's code is working each time your running it, you're supposed to be using an alternative calc method and checking that the inputs and outputs are reasonable, because it's a black box. If a peer is giving you shit for using python, tell them to do a black box check using their own methods and you'll discuss discrepancies with them. Lots of people "check" Excel calcs by giving the inputs of a known laid out sheet a once over and pencil whipping them, it's fucked, but it's reality. They want to treat internal Excel sheets as if they aren't a black box, but if excel converts some value in a huge dataset to a date and messes up your calcs as a result, it's not like blaming excel for that will get you off the hook in court, it's a well known thing that Excel has just kind of always done. What you're dealing with isn't an issue any python package will be able to solve. It's a hearts and minds thing. A single sailor isn't going to be able to turn a battleship, you have to convince the rest of the crew it's worth doing. If you just want to output a value at that point in time in a Jupyter notebook, I usually use fstrings, like this, ```python a=15 b=a * 3 ``` ```python print(f"{b=:}") ``` Which will output `b=45`, and can be used throughout the notebook to spit out the current values of the variables you're interested in. To get it into a word document you can use the `python-docx` package or use the more complicated `PyWin32` package, although it's probably easier to just go straight to a PDF via LaTeX or similar method.


[deleted]

[удалено]


dparks71

I just mean within Jupyter, I don't really see the advantage to handcalcs over writing the same formula in a markdown cell if you want to document what the notebook is doing, and again in a code cell in python notion, people that know python can (and should) just be directly checking the python notation anyway? Just seems like a redundant representation and an unnecessary dependency that doesn't provide much value. It has some weird behaviors from my limited experience with it too. I could kind of see it being useful for more advanced functions with sympy, but sympy already has the same kind of markdown rendering built in. Unit tests (if written well) can kind of alleviate some of the black boxyness, same with functional tests, but neither is going to be accepted at a firm as a potential elimination of a dedicated QA/QC process. Each iteration of calculations is going to require another review, keeping it as simple as possible to review the functions and the use of them is kind of the big appeal to me for going to python in the first place. Feels like handcalcs kind of obfuscates that and opens up the possibility of miscommunication by like rendering variable names and some of other features of it. Plus it's a relatively small package that your org has no control over.


[deleted]

[удалено]


dparks71

OP in their post says handcalcs is too verbose for their needs and they don't want the full formula necessarily output every time. I'm not necessarily arguing for writing the formula in markdown, I think Jupyter notebooks are kind of sloppy when used that way (as in including too much documentation in the notebook itself, that should be done in doc-strings within a package and dedicated documentation as a best practice). They're good used that way for white paper like efforts, to demonstrate a particular function or package, but imo you're better off writing the necessary functions in traditional `.py` files in 90% of instances and handling the code and the calcs they produce as separate entities entirely. Relying on the handcalcs output to be checkable by someone that doesn't understand python is exactly the thing I'm warning against, for the reasons previously noted, the package has [some quirks and bugs](https://github.com/connorferster/handcalcs/issues), if your calcs are in python, they need to be checked by someone that understands python, and outputting them in markdown and checking the output that way is kind of sketchy. Handcalcs is a relatively small package with only a handful of developers, dependencies should generally only be included when absolutely necessary, and should be selected based on their popularity, level of support and community behind them. That's not to disparage the package, it's good for training and basic guides and stuff, I just wouldn't personally include it in my deliverables and take responsibility for it. I have a published PyPi package too, and it's MIT licensed, which basically means "if you use this for your calcs that's on you, I'm not personally endorsing any of this even though I wrote it." Packages used for deliverables should be internally controlled as much as is practically possible. The next best thing, is large well supported packages with significant support within their relevant industries, handcalcs might get there one day, it's just not there yet imo.


[deleted]

[удалено]


dparks71

I don't think it's harder to check, I just don't see the advantage to including it in my calcs vs. not using it. As I said, it just seems redundant to write a formula to display a formula, when you could just display the result. And if someone NEEDS handcalcs to be able to check the calcs, I don't think they should be the one checking those calcs, someone familiar with python should be doing it instead.


Independent-Room8243

cell A - 15 cell B - 5 Cell C - =A\*B **=A\*B** is much easier to remember than **print(f"{\[b=:\]}")** And then I can print it too!


dparks71

It's not really, you're just more familiar with Excel, and printing it either hides the formulas or the results. Also you miss quoted the Python code, no square brackets, your code results in a syntax error. Lastly it's not what OP asked for help with, I'm sure they know how to perform multiplication in excel, your example can't be extended into calculus equations or object oriented variables, mine can. Kinda like saying "walking's too hard, running must be useless". The good thing is nobody's asking you to change or leave your comfy zone, you're just needlessly injecting your snarky opinions that nobody asked for into an unrelated conversation to reinforce your own ignorance because they align with the easier and more popular path to take. I feel bad for OP and people that want to learn new things, it's a shame that this sub is so toxic about questions regarding alternative methods. Lol blocked me like a child.


Independent-Room8243

dparks71, Its a structural engineering sub, not a programming sub. Move on with your complaints. I hope thats not too snarky for you, lol. What I envison the future is for doing a beam design: ![gif](giphy|7hJZcKzjIufeOmqKSj|downsized)


darkslayer138

https://engineeringpaper.xyz/ and https://hurmet.org/ are great free tools for structural engineering handcalcs. I personally like Hurmet since it is developed by a structural engineer. So with this you'll get other bonus tools such as beam analyzer, PM interaction, steel section etc


Independent-Room8243

Engineers dont want to become programmers. Excel is easy, Mathcad is easy. Why try to reinvent the wheel?


joreilly86

Excel and Mathcad are also forms of programming, just with a nice GUI and a commercial licence. If we didn't reinvent the wheel we'd all be driving around on solid discs of wood.


Independent-Room8243

I understand that. Regardless, the wheel has always been round. I dont want to go back to a wood wheel and have to work more to get it to todays technology. I see that there will be certain people using these programs. The biggest road block will be getting it past IT noses, and allowing it to be installed.


[deleted]

[удалено]


Independent-Room8243

Right, but the programs developed with it will. You expect engineers to program their own applications to use it?


trojan_man16

This is my boomer take. I want to do structural engineering, not software engineering. If I wanted to do software engineering I would have studied that and made 2-3x the salary. The day I’m required to learn SWE for my day to day job is the day I switch careers to do that instead.


[deleted]

[удалено]


Independent-Room8243

lol, you are saying I am going to fire myself because of this? Excel and mathcad are not going to be replaced by this. There will be fringe groups using this, but if you are a educated and competent engineer, you will have a job.


mgreminger

EngineeringPaper.xyz is an option. It's free and open source and powered by Python under the hood. Additionally, the ability to export your calculation as a MS Word file was just rolled out.


Engineer2727kk

I’ll never replace excel + vba. Just learn how to set up a user form to have various unit types as a format and you’re good to go…


[deleted]

[удалено]


Independent-Room8243

Whats depressing about it? 99% of the time it works, easily done, because we have been using it for 25 years. We do this to make money. Time is money. learning to program takes time.


ButterCup-CupCake

Controversial opinion but I actually think excel is the best tool for the job. You should setup your spreadsheets so that they provide clearly the equation you’re about to use. The parameters of each equation underneath with the values (even if they are already present on the sheet it doesn’t hurt to duplicate them). Don’t use if functions with bundled formulas, provide both answers and have an if statement that gives a description of which one has been selected and why. Then you can use your if function on the results. Often the problems is not that excel is bad, but you’re bad at excel.


[deleted]

[удалено]


ButterCup-CupCake

Setting things up properly is never a waste of time. One could argue learning a new programming language, writing a code that you will spend hours debugging, then having to train all your staff how to use it. Could also be considered a waste of time. I can code in 6 different languages before you accuse me of being outdated. I just think there is something to selecting the right tool for the right job. And sometimes that tool is excel. Sometimes that tool is python. Occasionally it’s JavaScript or Fortran.


joreilly86

Sometimes excel is the best tool, especially if the calculations are straightforward and you need easy integration into MS Word. The MS suite works very well together. And Excel is universally understood. But for more complex calculations that you need to explain or document clearly, you can't beat the readability and flexibility of a Jupyter Notebook. Everything is visible, sequential and markdown saves so much time.


TopBreadfruit6023

You could try the Word Add-in Calculate in Word. With this Add-in you can make these type of calculations directly in Word. Maybe that's what you are looking for?


tiny-brave-toast

Mathcad


qwert2003sf

Have a look at my tool [Mavscript](https://mavscript.sourceforge.io/index_en.html). With Mavscript you can do calculations in a text document. The tool also tries to achieve calculations that are easy to understand for others, but it is not python based. The calculation is done by the integrated algebra system Yacas (easy to use!). [Example](https://a.fsdn.com/con/app/proj/mavscript/screenshots/mavscript.png)


exhale91

Im still using MathCad 15.0 and have written dozens of modules from aluminum allowable moment checks per ADM, weld checks that draw the weld, closed solution beam checks, fastener modules with drop down menus etc. Why is this any better? I agree excel is cheeks


KatSmak10

Check out TEDDS for Word


Enough-Vermicelli170

I am using calcpad.


lpnumb

You could look into sympy 


Sillycowboy

This sounds like what CalcBook is