Units implementation

Units implementation - Сообщения

#21 Опубликовано: 04.03.2010 13:50:20
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

Hi!

Wrote

What 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.
#22 Опубликовано: 04.03.2010 15:11:16
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Congratulations Andrey

BTW, what about units display (fraction , single line)?

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#23 Опубликовано: 05.03.2010 02:14:50
henry crun

henry crun

0 сообщений из 34 понравились пользователям.

Группа: User

Wrote

Andrey,

All my credits to you
You did a great job. I hope it would not be to shameless from me to 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.....
#24 Опубликовано: 05.03.2010 08:59:35
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

Wrote

Which 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 ):
#25 Опубликовано: 07.03.2010 04:14:54
shinyplastic

shinyplastic

0 сообщений из 5 понравились пользователям.

Группа: User

Absolutely fantastic!!

Thanks again for all your hard work!
#26 Опубликовано: 07.03.2010 11:39:28
Waluyo Adi Siswanto

Waluyo Adi Siswanto

1 сообщений из 55 понравились пользователям.

Группа: User

The unit implementation in SMath is indeed very helpful.
As a user I am very happy with this feature and will spread to other colleagues too.
#27 Опубликовано: 07.03.2010 14:14:08
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

I'm glad you like it! Beta version will be available today after midnight (Moscow time).
#28 Опубликовано: 08.03.2010 02:24:13
Gilberto E. Urroz

Gilberto E. Urroz

21 сообщений из 36 понравились пользователям.

Группа: User

Wrote

I'm glad you like it! Beta version will be available today after midnight (Moscow time).



Where can I find it?

G. Urroz
#29 Опубликовано: 08.03.2010 04:06:21
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

Wrote

Where 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).
#30 Опубликовано: 08.03.2010 08:39:30
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Hello Andrey,

is here . I think you manage to make it better than even you have expected

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

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#31 Опубликовано: 08.03.2010 15:15:46
shinyplastic

shinyplastic

0 сообщений из 5 понравились пользователям.

Группа: User

Hi Andrey,

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.
#32 Опубликовано: 08.03.2010 19:28:20
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

Wrote

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.


Not reproduced. Will try to play with regional settings of the system later as well...

Wrote

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?


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.
#33 Опубликовано: 09.03.2010 07:48:24
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Wrote

Wrote

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.


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
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#34 Опубликовано: 09.03.2010 11:10:01
Edwin

Edwin

0 сообщений из 12 понравились пользователям.

Группа: User

I had access to a windows machine today, so I tried the beta for a bit. Impressive functionality for such a short time. The default list of units is also very much appreciated!

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!
#35 Опубликовано: 09.03.2010 12:32:13
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

omorr, thanks. I will try to reproduce and fix it asap.

Wrote

What's going on here?


Ok, it is simple... see picture:



Wrote

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.


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
#36 Опубликовано: 09.03.2010 14:29:04
Gilberto E. Urroz

Gilberto E. Urroz

21 сообщений из 36 понравились пользователям.

Группа: User

About the definition of pound, lb : the current definition of lb in SMath Studio is 1 lb = 0.4536 kg. In the U.S., where the so-called "Imperial," or "English," system of units refuses to leave center stage, the pound, lb, is a unit of force, not of mass. Some unit-conversion software, such as the one included with the HP graphing calculators, use 'lbf', i.e., pound-force, to refer to the pound as force, and then use the 'lb' to refer to the pound as mass, as you do. I would suggest adding the pound-force 'lbf' in SMath Studio, with 1 lbf = 4.44822161526 N.

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
#37 Опубликовано: 09.03.2010 15:36:47
Edwin

Edwin

0 сообщений из 12 понравились пользователям.

Группа: User

Wrote

omorr, thanks. I will try to reproduce and fix it asap.

Wrote

What'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


Wrote

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.


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.
#38 Опубликовано: 09.03.2010 16:08:57
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

gurro, thank you. I will add Units you have mentioned.

Edwin, I see now, sorry. Yeah, you are right, will fix this.

Wrote

Maybe an idea to make a setting for this.


I can do this. Default value will be "turned off", but could be activated.
#39 Опубликовано: 09.03.2010 19:42:42
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Hello Andrey,

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
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#40 Опубликовано: 09.03.2010 21:51:57
maweilian

maweilian

5 сообщений из 103 понравились пользователям.

Группа: User

Andrey,

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!
Will Massie Mechanical Engineer Oregon, USA
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений