1 страниц (8 вхождений)
Problems with units - Numeric sum of functions not possible - Сообщения
#1 Опубликовано: 23.05.2012 07:49:33
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!
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!
#2 Опубликовано: 23.05.2012 07:58:24
Hi 
It's a common issue
use eval in the [MATH]U.sq[/MATH] definition to fix it

regards,
w3b5urf3r

It's a common issue
use eval in the [MATH]U.sq[/MATH] definition to fix it

regards,
w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 пользователям понравился этот пост
Radovan Omorjan 23.05.2012 10:48:00
#3 Опубликовано: 24.05.2012 02:07:35
Thank you very much, that fixed it indeed.
I am just curious, what is the reason for this issue?
I am just curious, what is the reason for this issue?
#4 Опубликовано: 24.05.2012 02:43:00
Hello,
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
WroteI 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 пользователям понравился этот пост
Davide Carpi 24.05.2012 03:25:00
#5 Опубликовано: 24.05.2012 04:32:49
WroteHello,
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!
#6 Опубликовано: 24.05.2012 05:49:18
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...

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...

#7 Опубликовано: 24.05.2012 06:33:48
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()
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()
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#8 Опубликовано: 24.05.2012 09:31:03
Ok, thanks for the hint! Now I have my script running 

1 страниц (8 вхождений)
-
Новые сообщения
-
Нет новых сообщений