1 Pages (3 items)
NaN ? - Messages
#1 Posted: 2/16/2012 3:15:08 AM
Hello,
I've just got the NaN message by using roots():

Here is the file Primer2-27.sm
Another example with NaN Primer2-28.sm
This could be solved by Newton Raphson but the initial guess must be quite close to the solution:
Just curious when this error "NaN" appears - I think I did not see it before. Although the problems do not seem to be problematic - roots() failed. I think it has to be something regarding negative logarithm and/or negative epsilon value, but why "NaN" ? If I put Numerical optimization the message is "- not defined" but it does not say what is actually not defined.
Regards,
Radovan
I've just got the NaN message by using roots():

Here is the file Primer2-27.sm
Another example with NaN Primer2-28.sm
This could be solved by Newton Raphson but the initial guess must be quite close to the solution:

Just curious when this error "NaN" appears - I think I did not see it before. Although the problems do not seem to be problematic - roots() failed. I think it has to be something regarding negative logarithm and/or negative epsilon value, but why "NaN" ? If I put Numerical optimization the message is "- not defined" but it does not say what is actually not defined.
Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#2 Posted: 2/17/2012 8:32:55 PM
Thank you Radovan.
I've fixed the roots(..) function - now it returns "No real roots found" message. The reason was, as you expected, logarithm of the negative number.
Regards.
I've fixed the roots(..) function - now it returns "No real roots found" message. The reason was, as you expected, logarithm of the negative number.
Regards.
1 users liked this post
Radovan Omorjan 2/18/2012 3:03:00 AM
#3 Posted: 2/18/2012 3:55:03 AM
Hello Andrey,
Thank you. I really enjoy putting the [FIXED] prefix on the messages
. I hope you do not mind that.
Btw., I remembered my firs posts to the SMath Forum - here it is back in 2009. As you could see, I put quite a stress on nonlinear algebraic system of equations solver. This is something inevitable and a "must have" feature for any engineering course. The roots() will do the job but unfortunately, as you could see from my other posts, it is not good enough. At the moment, these things make me the most trouble in my classes when using SMath - including the multivariable minimization problem mentioned in my wishlist.
Regards,
Radovan
Thank you. I really enjoy putting the [FIXED] prefix on the messages

Btw., I remembered my firs posts to the SMath Forum - here it is back in 2009. As you could see, I put quite a stress on nonlinear algebraic system of equations solver. This is something inevitable and a "must have" feature for any engineering course. The roots() will do the job but unfortunately, as you could see from my other posts, it is not good enough. At the moment, these things make me the most trouble in my classes when using SMath - including the multivariable minimization problem mentioned in my wishlist.
Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 Pages (3 items)
-
New Posts
-
No New Posts