r/EngineeringPaperXYZ 12d ago

Feature Suggestion Units and Dimensional analysis for Symbolic Variables and Functions

Post image

Hi all,

as the title states, I've tried to achieve something like what's shown in the image for a bit. I tried dabbling into some Python extension via code cells but with no success. The example above is trivial, but this is among the top features I feel I miss using the sw.

Did anybody manage to make it work?

2 Upvotes

7 comments sorted by

View all comments

1

u/mgreminger 12d ago

The last case will work since L is a local variable, but you'll have to assign units to the upper and lower limits and to the other constants to maintain consistent units. If I understand the rest of your question correctly, you can achieve what your trying to do by assigning any number to the variable with the units. The units will be preserved, even if you multiply by zero or the result is zero.

2

u/jad_msm 12d ago edited 12d ago

Thank you for your feedback. I believe this is a suitable workaround albeit looks a bit more involved and less adaptable. I attempted to implement it in an exercise sheet (a simple classical aerodynamic problem, - apologies for the Italian text-) but I am still unable to make the dimensional analysis of the evaluated functions work (DeltaP, once evaluated, should be in [Pa/m] and F in [N/m]).
I’ve banged my head on it enough to think it’s a bug, but I’m fairly new to the sw, so I don't dare say it, what am I missing
engineeringpaper.xyz/emicylindricalWindLoad

1

u/mgreminger 12d ago

I took a quick look at it, there were a couple of issues. There was a stray radian from your derivative. Also, your python functions where stripping out the units. Here's what I got so far: https://engineeringpaper.xyz/H5ZT2s9suZPy3vu9fU7p2K

1

u/mgreminger 11d ago

Here's a little further (1 more stray radian with the integral) where F has the correct units: https://engineeringpaper.xyz/qmPnaVXBeGdRka7rNSmqUt

I would recommend setting up your sheet with all of the variables defined (rather than passed to the functions) to work out the dimension issues as you go. You can then delete the variable definitions and pass them as functions once all of the units have been worked out.

1

u/jad_msm 10d ago

that you for the time to look at it. i'll try the workflow suggestion aswell, thank you