Handling of Units

Handling of Units - 2 Questions - Units don't match - Messages

#1 Posted: 12/12/2017 2:52:14 PM
Brian White

Brian White

0 likes in 4 posts.

Group: User

My apologies as I am new to SMath.

Question 1: In the attached picture, I am getting the error message "Units don't match". I am not sure what this message is telling me. If I have an error in my units, why doesn't SM display all of the units?

SMath Error.JPG

Question 2: In the next picture, should SM consolidate the units on its own? When I typed in "beta=", SM then knew the units should be consolidated to S.

SMath Units.JPG

Thank you for any help you can offer!
#2 Posted: 12/12/2017 4:14:01 PM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Wrote

My apologies as I am new to SMath.



Welcome here [userlink]BrianWhite1964[/userlink]

Wrote

Question 1: In the attached picture, I am getting the error message "Units don't match". I am not sure what this message is telling me.


It's a typical error that can happen in sums (and subtractions of course); since here there is only one sum, probably the dimension of beta*N isn't the same of r0 (can't say much more without knowing what are the values behind these variables)

Wrote

If I have an error in my units, why doesn't SM display all of the units?


Not a bad idea but in more complex case the units reported might be still meaningless since the error might be thrown in an intermediate calculation (still something that might helps in general)

Wrote

Question 2: In the next picture, should SM consolidate the units on its own? When I typed in "beta=", SM then knew the units should be consolidated to S.


Probably you are running an older version of SMath Studio, with latest stable I get Siemens as result.
units.png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Posted: 12/12/2017 4:41:52 PM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Forget to mention, if you set the optimization of that region to symbolic, you should be able to see the units in the sum part
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#4 Posted: 12/12/2017 4:48:15 PM
Brian White

Brian White

0 likes in 4 posts.

Group: User

Hi David!
Thank you for your reply! I will try to fill in the gaps.
Quote

It's a typical error that can happen in sums (and subtractions of course); since here there is just on sum, probably the dimension of beta*N isn't the same of r0 (can't say much more without knowing what are the values behind these variables)


Solenoid Force.sm (43 KiB) downloaded 35 time(s).

I have attached the file as it is only half a page of material. Yes, I believe there is an error in my equation. If I recall correctly, error or not, MathCAD would list all of the units, simplifying where possible. It sounds like SM does not have that functionality. Does the error that SM speaks of really mean that it cannot simplify any further than what is in each factor?

Quote

Not a bad idea but in more complex case the units reported might be still meaningless since the error might be thrown in an intermediate calculation (still something that might helps in general)

I believe this is the functionality of MathCAD.

Quote

Probably you are running an older version of SMath Studio, with latest stable I get Siemens as result.

We are running the same version, 98.6484. I downloaded it just a few weeks ago and am running Windows 7 Pro.

Thank you, again!
#5 Posted: 12/12/2017 7:22:05 PM
Brian White

Brian White

0 likes in 4 posts.

Group: User

Wrote

Forget to mention, if you set the optimization of that region to symbolic, you should be able to see the units in the sum part



This is what happens when the region is set to symbolic:
Opto.JPG
Not what I was expecting!
#6 Posted: 12/13/2017 9:06:12 AM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

About beta unit, I see both from your screenshot and from your file that you have overridden the output unit, so SMath is doing exactly what you have asked it to do (intentionally or not, but at some point you have written or pasted in the units' placeholder those units).
You can notice it because there isn't the units placeholder after the evaluation symbol (=); select and delete the result units to restore the default behavior (or to change into other units, f.e. you can force the unit to be always 'S)

GIF.gif


About the units don't match error, using symbolical evaluation (that was the target of my 2nd post, sorry for not being clear about it before)

2017-12-13 12_25_26-SMath Studio 0.98.6484 - [Solenoid%20Force.sm_].png
Units in the parenthesis are the result of some internal factorization, however r.0 is in inches, beta*N is in Siemens (N is dimensionless), no way that you can sum them as they are.

r.0 is obviously correct since the formula requires a length in the denominator to be correct as final dimension, thus the problem is in beta*N; there might be 2 causes:
  • that's an experimental formula; in this case N is supposed to be a number that multiplied by beta in Siemens produces a length (in inches, in millimeters, ...). Hence you have to adjust "eq 25" multiplying beta*N for the right units in order to produce the expected result;
  • there is an error in that formula (not my field here, I guess is not this case but since I have small knowledge about solenoids I cannot exclude it);
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#7 Posted: 12/15/2017 12:08:30 PM
Brian White

Brian White

0 likes in 4 posts.

Group: User

Regarding the first question, I deleted the equation and re-entered it, and....the units came out as S! What I had done originally, I do not know!

Regarding the question on the units error, I have restarted my computer, and now I am getting the same result as you are when selecting optimization/symbolic. I was surprised that the equation gives me an error. I was expecting the program to optimize the numbers and symbols as far as it could go.

I agree with you that there is an error in the equation. I am contacting the author of the paper to see if he can help me understand my results.

Davide, thank you very much for your help and your time! Your knowledge is greatly appreciated!!
  • New Posts New Posts
  • No New Posts No New Posts