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 omorr  
#1 Posted : 16 February 2012 10:15:08(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'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

Edited by user 18 February 2012 10:56:12(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"

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

Offline Andrey Ivashov  
#2 Posted : 18 February 2012 03:32:55(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)
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.
thanks 1 user thanked Andrey Ivashov for this useful post.
on 18/02/2012(UTC)
Offline omorr  
#3 Posted : 18 February 2012 10:55:03(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 Andrey,

Thank you. I really enjoy putting the [FIXED] prefix on the messages Good . 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
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
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.