Rank: Newbie
Groups: Registered
Joined: 23/05/2012(UTC) Posts: 5
|
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!
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,648 Location: Italy Was thanked: 1331 time(s) in 876 post(s)
|
Hi It's a common issue use eval in the U.sq definition to fix it 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 |
1 user thanked Davide Carpi for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 23/05/2012(UTC) Posts: 5
|
Thank you very much, that fixed it indeed.
I am just curious, what is the reason for this issue?
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello, Originally Posted by: monoceros84 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!" |
1 user thanked omorr for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 23/05/2012(UTC) Posts: 5
|
Originally Posted by: omorr 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 Thanks again!
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 23/05/2012(UTC) Posts: 5
|
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...
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 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!" |
|
|
|
Rank: Newbie
Groups: Registered
Joined: 23/05/2012(UTC) Posts: 5
|
Ok, thanks for the hint! Now I have my script running
|
|
|
|
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.