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 monoceros84  
#1 Posted : 23 May 2012 14:49:33(UTC)
monoceros84

Rank: Newbie

Groups: Registered
Joined: 23/05/2012(UTC)
Posts: 5
Germany

Hello,

I am fairly new to SMath (coming from Mathcad) so I am not quite sure if it's a bug or if I use it wrongly. Anyway, defining a function that gives back a unit and using this function in a sum (or difference) yields an error "Units don't fit". However, I can use this function in a multiplication or division or I can optimize it symbolically...



SMath version: 0.94 (Build 4523)
Windows 7

Any suggestions?
Thank you!

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

Offline Davide Carpi  
#2 Posted : 23 May 2012 14:58:24(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,648
Man
Italy
Location: Italy

Was thanked: 1331 time(s) in 876 post(s)
Hi Good

It's a common issue

use eval in the U.sq definition to fix it

U.sd debug


regards,

w3b5urf3r

Edited by user 23 May 2012 15:10:56(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 23/05/2012(UTC)
Offline monoceros84  
#3 Posted : 24 May 2012 09:07:35(UTC)
monoceros84

Rank: Newbie

Groups: Registered
Joined: 23/05/2012(UTC)
Posts: 5
Germany

Thank you very much, that fixed it indeed.

I am just curious, what is the reason for this issue?
Offline omorr  
#4 Posted : 24 May 2012 09:43:00(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,
Originally Posted by: monoceros84 Go to Quoted Post
I am just curious, what is the reason for this issue?


I might not give you the complete answer but these might be the reasons.
SMath has its own symbolic engine for manipulating math expressions. This is the main math engine inside SMath core. It did not have units and they were introduced latter during its development. Moreover, it appeared that some calculations were problematic with strictly numerical input and output. Therefore eval() was introduced to make it possible. Afterwards, numerical optimization was introduced as well due to some internal problems of symbolic engine with numerical issues. To make long story short, all things goes through SMath symbolic engine first and all other things (eval(), units, optimization) can be regarded as a "patch" to the main SMath symbolic engine. This engine is still in development.

Therefore, if there are some problems with default symbolic engine and you have to use strictly numerical values, or units, - try eval() or some optimization option other then Symbolic (Numerical or None). If these do not work, please report it to this Forum.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 1 user thanked omorr for this useful post.
on 24/05/2012(UTC)
Offline monoceros84  
#5 Posted : 24 May 2012 11:32:49(UTC)
monoceros84

Rank: Newbie

Groups: Registered
Joined: 23/05/2012(UTC)
Posts: 5
Germany

Originally Posted by: omorr Go to Quoted Post
Hello,
Therefore, if there are some problems with default symbolic engine and you have to use strictly numerical values, or units, - try eval() or some optimization option other then Symbolic (Numerical or None). If these do not work, please report it to this Forum.


Very good, that was the reason why I have asked. Just to get an idea how to fix issues by myself.

Even though there are still some bugs SMath is by far the most advanced AND usable math software with units beside Mathcad. I really like it and was looking for an alternative a long time. Thus, I am happy there is a workaround and I don't have to transfer all my calculations into another software Good

Thanks again!
Offline monoceros84  
#6 Posted : 24 May 2012 12:49:18(UTC)
monoceros84

Rank: Newbie

Groups: Registered
Joined: 23/05/2012(UTC)
Posts: 5
Germany

Ok, another, maybe an equal problem - appearing in the same sheet.

Have a look at the attachment. It tells me, that the variable that I like to find out by roots is not defined. But the Wiki tells I must not define it...

Offline omorr  
#7 Posted : 24 May 2012 13:33:48(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,

roots() as many other function will not work with units. It is quite logical. It is not correct to get sin(X) or exp(X) when X have units. Therefore, you have to get rid of units in your functions if you want to use roots(). Besides, roots() will not work with eval() in general as well - try to avoid it.

Regards,
Radovan

P.S. If you are interested see this post solve() and roots()

Edited by user 24 May 2012 13:44:27(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline monoceros84  
#8 Posted : 24 May 2012 16:31:03(UTC)
monoceros84

Rank: Newbie

Groups: Registered
Joined: 23/05/2012(UTC)
Posts: 5
Germany

Ok, thanks for the hint! Now I have my script running Good
Users browsing this topic
Guest
Similar Topics
Problems with units of measurement (Bugs & Problems)
by torpion 29/04/2019 16:14:15(UTC)
Problems with units: m, m² and m³ (Questions)
by pnc 08/01/2014 11:46:41(UTC)
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.