Units implementation - Сообщения
Some intrinsic math function (sin,cos,ln,log...) can be applied on the unit variables. I think this should not be allowed.
Regards,
Radovan
WroteSome intrinsic math function (sin,cos,ln,log...) can be applied on the unit variables. I think this should not be allowed.
Agree. Will fix.
Updated: fixed.
WroteWith all that talk about base units, wouldn't it be possible to store the unit definitions as files (.sm files?) in a separate directory?
Actually, this was my goal, but then I saw problems of sharing worksheets in that case. F.e.: if user1 will send file to user2, but file is created with program contains custom units, then user2 will not be able to work with such file. Of course, I can imagine couple of solutions, but all of these require some not easy logic, so in future I'll try to implement one of them.
Figure 1: Units simplification dramatically improved!
Figure 2: Error handling improved.
Thanks for testing! New beta will be available soon.
WroteAbout 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.
Unfortunately in the Imperial/English/Customary units used in the US the pound is both a force unit when the mass unit is the slug and a mass unit when the force unit is the poundel. This is a ludicrous situation and the US should sort its self out. This will be to the benefit of the US education system, international scientific co-operation, space flight etc.
One way to encourage this is for mathematical and scientific software to stop supporting these units.
CB
WroteOne way to encourage this is for mathematical and scientific software to stop supporting these units.
I think it would be better to improve and maintain the usefulness of Smath to as many users as possible and not to try to use the program as a lever to force the correction of perceived problems in other arenas.
WroteWroteAbout 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.
Unfortunately in the Imperial/English/Customary units used in the US the pound is both a force unit when the mass unit is the slug and a mass unit when the force unit is the poundel. This is a ludicrous situation and the US should sort its self out. This will be to the benefit of the US education system, international scientific co-operation, space flight etc.
One way to encourage this is for mathematical and scientific software to stop supporting these units.
CB
==================================
I know that the proliferation of unit systems is counterproductive, and we, in the engineering colleges in the US are trying to keep the metric system as a viable alternative, but the bulk of US industries still use the so-called "Imperial" or "English" system. And I love "psi".

WroteI know that the proliferation of unit systems is counterproductive, and we, in the engineering colleges in the US are trying to keep the metric system as a viable alternative, but the bulk of US industries still use the so-called "Imperial" or "English" system. And I love "psi".
We need pounds somewhere. By the way, the books we use in the US don's use "poundel" anymore. I think the "standard" is lb = unit of force, slug = (1 lb )/(1 ft/s^2) = unit of mass. We also use "kips", which stand for "ki(lo)p(ound)s". Talk about a hybrid unit. The US Congress tried to force metric conversion in the 1970's, but the States never ratified it.
Dr. Urroz,
I also agree that the existence of more than one system of units may very well be counterproductive on a global scale. But, as you said, this is the way things are for now. But that is why Smath should remain flexible in this area. I really like the way that Andrey has allowed users to define and use custom units. I work in the marine industry in the U.S. and besides working with pounds and gallons, I often have to use nautical units such as long tons, fathoms, and knots. The proliferation of units is a reality that is not going to go away very soon. I do not expect Andrey to include every possible unit as a built-in part of Smath (although, the most commonly used Imperial units should be), but I hope he continues to make it flexible and customizable in every way possible. That way, it will remain a powerful, practical tool for engineers from all countries.
Regarding to the previous comments, it crossed my mind that the predefined constants, variables, functions, units etc. in SMath should (might) be protected (some of them can not be redefined like int, diff, ...). Actually, ther is Dynamic asistance as a great toll and we instantly can see what is defined or not. In spite of that, I think it might be beneficial not to allow (to protect) redefinition of SMath incorporated constants, variables, functions, units ... unless the user declare them "unprotected". I suppose this could not make the things more complicated, contrary - it might help avoiding some hard to trace errors.
Regards,
Radovan
EDIT: ...(some of them can not be redefined like int, diff, ...)
Actually, I was wrong. It loks a bit "crazy" but we can redefine them

[MATH]int(a;b;c;d)←a+b+c+d[/MATH]
[MATH]int(1;2;3;4)=10[/MATH]
[MATH]diff(x;y)←x^2+y^2[/MATH]
[MATH]diff(2;3)=13[/MATH]
[MATH]diff(2;3)—13[/MATH]
WroteRegarding to the previous comments, it crossed my mind that the predefined constants, variables, functions, units etc. in SMath should (might) be protected (some of them can not be redefined like int, diff, ...). Actually, ther is Dynamic asistance as a great toll and we instantly can see what is defined or not. In spite of that, I think it might be beneficial not to allow (to protect) redefinition of SMath incorporated constants, variables, functions, units ... unless the user declare them "unprotected". I suppose this could not make the things more complicated, contrary - it might help avoiding some hard to trace errors.
Radovan, I agree. That is a very good idea.
WroteAbout the definition of pound, lb : the current definition of lb in SMath Studio is 1 lb = 0.4536 kg. ... 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.
All units you've mentioned added to the built-in list:
WroteIt loks a bit "crazy" but we can redefine them
Why do you think so? This is the main concept of the program - user can redefine everything, even if it will be funny for someone else. If user will create more powerful algorithm of integral solving, then int(..) function can be overridden. Also, I don't believe that user could redefine int(..) function (just f.e.) accidentally, but this allows experienced user to be free with his or her ideas. I see no problem here.
Best regards, Andrey Ivashov.
WroteWroteIt loks a bit "crazy" but we can redefine them
Why do you think so? This is the main concept of the program - user can redefine everything, even if it will be funny for someone else. If user will create more powerful algorithm of integral solving, then int(..) function can be overridden. Also, I don't believe that user could redefine int(..) function (just f.e.) accidentally, but this allows experienced user to be free with his or her ideas. I see no problem here.
I might not make myself understood, sorry. No, I am not against redefining things. Contrary, this is a very welcome feature. I've mentioned that Dynamic Assistance (DA) as a great tool in avoiding accidental changing, constants, variables, functions, units. Just the Dynamic Assistance could be enough in order to check what has been already defined. There is also a mark on every redefined item in DA (a hand over it - very good

About redefining int(..) and diff(..) I was just joking in order to show that could be done

Regards,
Radovan
Regards.
Regards,
Radovan
PS. Andrey, have a good time and take some rest

Firstly, it still defaults to different units than what are used in the calculation. See below:

I really think the result should automatically use the same units that are used in the calculation (when this is possible), and/or the user should be able to select (in the "Options" dialog) the default units that will be used.
Secondly, I realize now that the second placeholder that appears after the unit can be used to override the unit. This is ok, but it would seem more natural to simply select the unit to be overriden and simply press delete and/or then type a new unit in its place. This seems more intuitive. That being said, the way it is now is acceptable to me.
What do others think?
I am a bit puzzled here. Please look at the picture:
This os Ok too.
This one as well
This one can be done only if typing 10*/ and then putting the units in nominator and denominator.
Is there maybe something wrong (a bug) here? Is there anything that could be done about it?
Regards,
Radovan
WroteAndrey you are the best!!! Greate work for now. I mean amazing!!! Also thanks to Radovan for his engage to make program better. ;D
Thank you! Radovan makes a great work - it's true. Just want to say also thanks to every person who participating in the forum!
Just for information: as you, maybe, know I have paused work on the program one week ago. It was important because I had to pass an exam (Microsoft .NET Framework 3.5, ASP.NET Application Development) today. Now it's ok, exam is passed and I'm back to work. Will check all new bug reports that appeared last days.
-
Новые сообщения
-
Нет новых сообщений