Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 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.smAnother example with NaN Primer2-28.smThis 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!" |
|
|
|
Rank: Administration Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member Joined: 11/07/2008(UTC) Posts: 1,616 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.
|
1 user thanked Andrey Ivashov for this useful post.
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
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 |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
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.