       Re: NSolve using crushes mathematica 7

• To: mathgroup at smc.vnet.net
• Subject: [mg112553] Re: NSolve using crushes mathematica 7
• From: "David Park" <djmpark at comcast.net>
• Date: Sun, 19 Sep 2010 05:40:51 -0400 (EDT)

```I think that more information is needed as to how you are using the results.

It is very problematical to place a complicated command such as NSolve
inside another complicated numeric routine and then wonder what went wrong.
Maybe you have to look at the interior calculation first and understand what
is happening with it.

So you might investigate the solutions to:

sols2 = Reduce[
Sin[2*t] - 2*h*(Cos[p]*Cos[t]*Sin[q] - Sin[t]*Cos[q]) == 0, t]

Then perhaps you could use one of those in your calculations.

I'm sure there are others on MathGroup who are more expert in this than I

David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/

From: Piotr Melenev [mailto:aq.velo at gmail.com]

Hello,

I use NSolve function to find the roots of the trigonometric equation
inside following function:

getroots[ p_ , q_ , h_ ] := Module[ {res},
res = NSolve[ Sin[2*t] - 2*h*(Cos[p]*Cos[t]*Sin[q] -
Sin[t]*Cos[q]) == 0, t];
t /. res
]

When I evaluate this function separately - it works properly. But if I
embed it into another Mathematica function, like NIntegrate, Plot etc
(which automatically choses values of the variables) relative to p
variable, Mathematica kernel is crushed with APPCRUSH winerror. At the
same time I can calculate appropriate table of values and use it in
ListPlot or in "hand-made" numerical integration function. But it is
tiresomely and besides that I want to understand what is the cause of
the error...