Units implementation - Сообщения
WroteWhat about the temperature relative scales (Celsius, Fahrenheit)?
Last days I've worked on it and will continue... for now (if we are talking about nonlinear units) any temperature can be converted to Kelvin, but not vice versa.
V. Ochkov recommended me to realize some of his Mathcad worksheets in new version of SMath Studio with Units for tests and here is the first "real" document:
So, it works! See http://twt.mpei.ac.ru/rbtpp/pKw/ to check how it looks like in Mathcad.
Best regards.

BTW, what about units display (fraction , single line)?
Regards,
Radovan
WroteAndrey,
All my credits to you![]()
![]()
![]()
You did a great job. I hope it would not be to shameless from meto mention just one more thing. What about the temperature relative scales (Celsius, Fahrenheit)?
Regards,
Radovan
Which also raises the issue of inserting the degree symbol.....
WroteWhich also raises the issue of inserting the degree symbol.....
It is not a problem, because Dynamic Assistance feature was implemented. Using Ctrl+[space] you can display a list of available units, variables and functions (Ctrl+[space] will also insert selected item when list is shown).
Please, see the animation below (actions is so slow, because I've used on-screen keyboard... using the real keyboard allows to do all these actions in 2-3 seconds

Thanks again for all your hard work!
As a user I am very happy with this feature and will spread to other colleagues too.
WroteI'm glad you like it! Beta version will be available today after midnight (Moscow time).
Where can I find it?
G. Urroz
WroteWhere can I find it?
Working on it right now... some problems appeared, but will finish today. Beta version will be available through the Download forum.
Updated (9:26):
Here is it: Beta: SMath Studio 0.87.3719 (08 March 2010).



Please could you check about comma and point as decimal separators for Temperature units (Celsius and Fahrenheit). The error "273,15 - not defined" and similar ones are issued when .(period) is used as Decimal symbol.
Regards,
Radovan
Really like it, and amazing easy to use with the dynamic help. I just loaded my old sheets, and added units to the variables, and all my formulas updated

The blue for units is excellent, but I have noticed for exponents (e.g. m^3) the "3" is neither blue nor italic and I think this would help clarity?
Again many many thanks.
WrotePlease could you check about comma and point as decimal separators for Temperature units (Celsius and Fahrenheit). The error "273,15 - not defined" and similar ones are issued when .(period) is used as Decimal symbol.
Not reproduced. Will try to play with regional settings of the system later as well...
WroteThe blue for units is excellent, but I have noticed for exponents (e.g. m^3) the "3" is neither blue nor italic and I think this would help clarity?
Not sure that this should be done. I mean, that if it will be the rule for exponents, then this should be implemented also for units like 1/s. In that case if 1/s is Unit, then what is 123456/s - Unit or not? It is more simple to use regular font for numbers and italic - for units.
WroteWrotePlease could you check about comma and point as decimal separators for Temperature units (Celsius and Fahrenheit). The error "273,15 - not defined" and similar ones are issued when .(period) is used as Decimal symbol.
Not reproduced. Will try to play with regional settings of the system later as well...
It seems that when choosing the appropriate regional settings everything is fine. But when changing the decimal separator via Tools=>Options=>Interface while working on a worksheet, the error appear. Here is the first picture:
Now, changing the decimal separator from comma to point will issue errors. Then replacing the comma with period will fix the things, except on some units - see the picture:
or
The same will happen when the Regional settings are "point", "comma" as decimal and function arguments separators and they were changed via Tools=>Options=>Interface while working on the worksheet
I think It is not such a problematic issue as long as we stick with the same Regional settings. Saving the file and reopening with another setting will fix the things.
Regards,
Radovan
I did however run into a problem on my first try.
Basically what I did was:
m:=10 kg
g:=9.81 m/s^2
and then the multiplication result is given as:
m*g=98.1 m kg/s^2
This result is obviously Newton, so I put an N unit in the result and then it says:
m*g=98.1 m kg/(s^2 N) N
Not entirely what I had in mind.
But if I now redefine (as units):
N:=kg m/s^2
and do the same line again, it does give me:
m*g=98.1 N
What's going on here?
Would it be easy to change the default interpretation for direct typing. For instance, if you type a:=10mm now, it won't use the mm unit even though there is no variable mm defined. It would make things much quicker if it would pick the unit by default if no variable has been defined with that name.
Anyway, good job!
WroteWhat's going on here?
Ok, it is simple... see picture:
WroteWould it be easy to change the default interpretation for direct typing. For instance, if you type a:=10mm now, it won't use the mm unit even though there is no variable mm defined. It would make things much quicker if it would pick the unit by default if no variable has been defined with that name.
Great idea! But what to do, if user wants to start symbolic calculations without units, f.e.: f(a):=a^m; f(2)->2^m etc.? I think someone will kill me, if program will always automatically convert variables to possible units

Including the pound-force, as I suggest, will allow us, hydraulic engineers in the U.S., to use the commonly-used unit of pounds per square inch (psi = 1 lbf/in^2) for pressure, which currently I cannot properly define. If you decide to include 'psi' in your collection of units, use 1 psi = 6894.75729317 Pa. I also use the psf = pound-per-square-foot, 1 psf = (1/144) psi = 47.8802589803 Pa.
By the way, the unit of mass in the English System ( E.S. ) is the 'slug', 1 slug = ( 1 lbf )/(1 ft/s^2). The "slug" should be included in the units of mass in SMath Studio also. 1 slug = 14.5939029372 kg.
Also, the BTU, or Btu, (British Thermal Unit) should be included in the units of energy, since is still commonly found in HVAC applications. 1 BTU (or Btu) = 1055.05585262 J.
Thanks to Andrey, again, for implementing units in SMath Studio. That'll make my life much easier!
Gilberto Urroz
Wroteomorr, thanks. I will try to reproduce and fix it asap.
WroteWhat's going on here?
Ok, it is simple... see picture:
I'm not quite sure what you tried to say here, but it did remind me to check some definitions. Apparently you defined some units (as Newton for instance) as base units while they aren't. In case of Newton this means that SMath is currently unable to process something like 100N/10m/s^2 = ... kg because it doesn't know the definition of N until you define it yourself.
Wrote
WroteWould it be easy to change the default interpretation for direct typing. For instance, if you type a:=10mm now, it won't use the mm unit even though there is no variable mm defined. It would make things much quicker if it would pick the unit by default if no variable has been defined with that name.
Great idea! But what to do, if user wants to start symbolic calculations without units, f.e.: f(a):=a^m; f(2)->2^m etc.? I think someone will kill me, if program will always automatically convert variables to possible units
I'm guessing you will start seeing two opinions here. Those from people doing engineering calculations which will rarely have undefined variables, and those doing more fundamental math. Maybe an idea to make a setting for this.
Edwin, I see now, sorry. Yeah, you are right, will fix this.
WroteMaybe an idea to make a setting for this.
I can do this. Default value will be "turned off", but could be activated.
As far as I am concerned, this way is quite acceptble in this short period of time you manage to support units. On the other hand, Edwin is right. It would be useful if SMath would be aware of base units (m,kg,s,mole) and derived ones(N,J,Pa,...). I suppose this would not be an easy task.
Moreover, I like the idea to have an option (might be on and off) to use undefined variables as intrinsic units (if exist) instead of symbolic variable.
Regards,
Radovan
I really like your implementation of units into Smath!
There was just a couple of things I noticed that could be improved.
First, See screenshot below:

The calculation is done all in pounds force but the result defaults to Newtons. Is it possible to retain the units used in the calculation without reverting to the default? (assuming, of course, that consistent units are used in the calculation.) It would also be nice if the user could set the default unit to be used for each unit type, or that the user could select the system of units to be used as the default system of units (i.e. MKS, CGS, Imperial, etc.)
Second, See screenshots below:

When I try to change the unit of my answer from Newtons to LT (long tons, the unit of weight used for marine vessels in the US), I click on the unit I want to change and start to type in the new unit... (continued below)

...the cursor inexplicably jumps into the middle of my variable name. This is frustrating behavior. It took me several attempts before I was able to change the unit from Newtons to LT.
Overall I am very impressed. Great work!
-
Новые сообщения
-
Нет новых сообщений