Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline callmeishmael  
#1 Posted : 29 April 2010 16:25:18(UTC)
callmeishmael


Rank: Member

Groups: Registered
Joined: 29/04/2010(UTC)
Posts: 15
Man
Location: Italy

Was thanked: 4 time(s) in 2 post(s)
A feature that would attract a lot of engineers would be the possibility to define a variable with a tolerance, and then get the results with tolerances as well.
It's easier to undertand with an example:

a:=2mm(-0.5 +0.2)

so "a" ranges from 1.5mm to 2.2mm; 2mm is the nominal value

b:=3mm(-0.5 -0.2)
"b" ranges from 2.5mm t0 2.8mm
(in other words a range can be also set only with negative values)


Now, what I would like to have in SMath is that if I multiply the two var I can get automatically the two results:

a*b=6mm2 (-2.25 +0.16)

where:
6 = (a_nominal*b_nominal)
and:
-2.25 =(a_min*b_min)-(a_nominal*b_nominal)
0.16 =(a_max*b_max)-(a_nominal*b_nominal)

For a simple formula like this is pretty obvious to find the results, but when the equations are more complicated it is not that easy to know in advance which combination will lead to the max and min result, so SMath would have to "try all the combinations" and choose max min values.
Of course each ranged variable would expandthe results space, so for example if we have 5 ranged variabiles in our calculation, 2^5+1 results have to be stored internally. (The +1 is the nominal result which shall also handled)
Obviously this is a calculation overhead but with nowadays hardware and with a bit of user judgment in the use of ranged variables this can be done.
Together with units, this would be a killer feature against most of other CAS. Not even Mathcad can do this!
Lots of students and engineers will love it.
I would also be nice to format the results the way in mechanical drawings the tolerances are shown, with the two values in smaller font set like subscript and superscript besides the nominal value.
From the programming standpoint SMath would have to handle the formatting, expand the variable as a vector, evaluate each combination and get max min result and display it properly.
Do you think this can be done?

Edited by user 29 April 2010 16:58:18(UTC)  | Reason: Typing errors..

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline omorr  
#2 Posted : 29 April 2010 18:24:59(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello,

I agree this would a very interesting feature. On the other hand, SMath would have to deal with Interval Arithmetic - including units. I do not have a clue how complicated would that be to incorporate into SMath. At the moment, the best you can get concerning some values presented in interval notation might be the Equation system operator combined with plus/minus, minus/plus operator. Here is an example:

Variables a,b,c are actually vectors with two elements. If you, say, multiply a and b you will get the equ.system variable with four elements (see the picture, please).

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline callmeishmael  
#3 Posted : 29 April 2010 18:37:08(UTC)
callmeishmael


Rank: Member

Groups: Registered
Joined: 29/04/2010(UTC)
Posts: 15
Man
Location: Italy

Was thanked: 4 time(s) in 2 post(s)
Actually I was not aware of the plus/minus operator, it is a wonderful feature Biggrin
What would be missing now is just the capabilty to return only two values instead of 4, and to carry the additional calculation with nominal values only.
(And possibily to specify non symmetric ranges like the plus/minus operator)

Edited by user 29 April 2010 19:00:43(UTC)  | Reason: Not specified

Offline callmeishmael  
#4 Posted : 29 April 2010 19:30:25(UTC)
callmeishmael


Rank: Member

Groups: Registered
Joined: 29/04/2010(UTC)
Posts: 15
Man
Location: Italy

Was thanked: 4 time(s) in 2 post(s)
I don't know if this is a bug, but if I use the plus/minus operator the max and min function do not return the largest and smallest element in the vector, but the full vector instead:

Open in SMath Cloud

Any hint?
Offline omorr  
#5 Posted : 29 April 2010 21:30:24(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello,

It might be a bit peculiar to explain and figure out, but I will give it a try. The Equation system is not regarded as a vector in vector/matrix operation. Although you can access the Equ.Sys elements the same way as to a regular vector, SMath makes the difference between Equ.Sys and vector (column matrix) variables. Take a look at the picture please:


You have to transfer the Equ.Sys elements into a regular vector first (for loop). I might be wrong because my observation are based on trial and error. The SMath authors could give you more precise and accurate explanation.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline callmeishmael  
#6 Posted : 29 April 2010 22:12:38(UTC)
callmeishmael


Rank: Member

Groups: Registered
Joined: 29/04/2010(UTC)
Posts: 15
Man
Location: Italy

Was thanked: 4 time(s) in 2 post(s)
Radovan,

thank you for your explanation. Probably it the simplest solution would be to modify the max min function to let them handle also the Equ.Sys object.

In any case, good to have a workaround, now.

Regards


Andrea
Offline LordMike  
#7 Posted : 30 April 2010 00:56:31(UTC)
LordMike


Rank: Advanced Member

Groups: Registered
Joined: 24/10/2009(UTC)
Posts: 52
Man
Location: Denmark

Just an addition.. It could be quite useful with Ohm in electronics too.. Good
Offline LordMike  
#8 Posted : 30 April 2010 01:05:26(UTC)
LordMike


Rank: Advanced Member

Groups: Registered
Joined: 24/10/2009(UTC)
Posts: 52
Man
Location: Denmark

For example in this (SMath actually suggested 1/s (WOW), but I changed it to Hertz.).


It is easy to show that the percentage +- tolerance is hard to read out of the equation, but that the effect is obvious. A difference in 5 Mhz (13 - 17) with a 10% tolerance resistor?.. :P

Offline cos_phi  
#9 Posted : 30 April 2010 21:54:56(UTC)
cos_phi


Rank: Advanced Member

Groups: Registered
Joined: 20/04/2010(UTC)
Posts: 33

LordMike wrote:
For example in this (SMath actually suggested 1/s (WOW), but I changed it to Hertz.).


It is easy to show that the percentage +- tolerance is hard to read out of the equation, but that the effect is obvious. A difference in 5 Mhz (13 - 17) with a 10% tolerance resistor?.. :P




This is what I got:



Changing perc(10,10ohm) gives the same result. (Maybe you have different settings?)



Regards,
Vlad.
Offline Andrey Ivashov  
#10 Posted : 30 April 2010 22:12:49(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Seems, I see a little space between 2 and 4,7 - this means that it is multiplication operator who became invisible because of Units (known bug).

Regards.
Offline cos_phi  
#11 Posted : 01 May 2010 01:12:59(UTC)
cos_phi


Rank: Advanced Member

Groups: Registered
Joined: 20/04/2010(UTC)
Posts: 33

smath wrote:
Seems, I see a little space between 2 and 4,7 - this means that it is multiplication operator who became invisible because of Units (known bug).

Regards.



I thought I saw that, but I said it must be because of font rendering, it seems wider in his screenshot. Ah, well...


Regards,
Vlad.
Offline LordMike  
#12 Posted : 01 May 2010 14:48:07(UTC)
LordMike


Rank: Advanced Member

Groups: Registered
Joined: 24/10/2009(UTC)
Posts: 52
Man
Location: Denmark

Heh,

My point was (Not shocked by the difference), that it could be effective knowing that there *is* such a difference.
Calculating with tolerance would be awesome :P
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.