units in expressions seem broken

units in expressions seem broken

mieczotronix
Participant Participant
400 Views
2 Replies
Message 1 of 3

units in expressions seem broken

mieczotronix
Participant
Participant

I want to compute a radius, which is proportional to a ratio of two angles, say in degrees, e.g.:
new radius = old radius * angle/(360-angle)
But it seems like the expression engine thinks that the unit of angle/(360-angle) is angle and it does not let me assign the whole expression to the new radius.

This seems like an obvious error. Is there a workaround for this?

0 Likes
Accepted solutions (2)
401 Views
2 Replies
Replies (2)
Message 2 of 3

jhackney1972
Consultant
Consultant
Accepted solution

You have to watch your units.  Notice in the last two expression I multiply and divide by 1 degree to maintain units.  This is the formula you asked for, I am not sure how you are using it.  Change the Old_Radius and/or Angle to an value to re-calculate.

 

Calculation.jpg

John Hackney, Retired
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 3 of 3

mieczotronix
Participant
Participant
Accepted solution

Ok so it turns out my fault was not adding type suffix to constants (i.e. i typed "360" instead of "360 deg").
So, for clarity:
Comp_Angle should be declared as "No Unit" because it's a ratio, so let's name it ratio accordingly:

            ratio = (Angle / (360 deg - Angle)) [No Unit]
then I can multiply mm by it ratio and it works.
            New_Radius = Old_Radius * ratio [mm]
Also I learned I don't have to use cumbersome Alt 0176 (yet another PIN to remember) for entering degrees symbol, one can type "deg" instead.
Thanks for pointing me in the right direction!


0 Likes