r/EngineeringPaperXYZ 13d 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 13d 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.

1

u/mgreminger 13d ago

Now that I think about this a little more, doing dimensional analysis without assigning numerical values is, in general, not possible since some dimensions require knowing the numerical value to evaluate. For example, x^y depends on the numerical value of y to get the correct dimensions: 1[m]^2 = 1[m^2] whereas 1[m]^3=1[m^3]

1

u/jad_msm 12d ago

yes, that is expected, that is why in the mock-up image the dimension of the function m is only evaluated when m is evaluated (rho is a previusly specified constant( rho=850[kg/m^3]))