MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: RowReduce::luc when using NSolve

  • To: mathgroup at
  • Subject: [mg99171] Re: [mg99135] RowReduce::luc when using NSolve
  • From: Daniel Lichtblau <danl at>
  • Date: Wed, 29 Apr 2009 06:05:26 -0400 (EDT)
  • References: <>

mereandor wrote:
> I try to solve a linear equation with the following input to mathematica:
> NSolve[{BesselJ[0, 20] - BesselJ[0, 20] r[0] == 3 I BesselJ[0, 60 I] t[0], BesselJ[0, 20] + BesselJ[0, 20] r[0] == BesselJ[0, 60 I] t[0]}, {r[0], t[0]}]
> but I get
> RowReduce::luc: Result for RowReduce of badly conditioned matrix \
> {{-0.167025+0. I,-1.61061*10^9-<<21>> I,0.167025+0. I},{<<1>>}} may \
> contain significant numerical errors. >>
> This is only the simplest instance of my problem (2(n+1) equations in equally numbered variables). If I don't write the equations down literally but insert them into NSolve as a Table[] statement I don't even get the warning. Then the equations are solved only partially expressing t[n] as linear combination of r[n].
> I use Mathematica 6.0
> How can I resolve this?
> Thanks in advance for any help!

The input is ill conditioned from the point of view of numeric linear 

Your coefficient matrix is, up to sign,

coeffmat = {{BesselJ[0,20],3*I*BesselJ[0,60*I]},

At machine precision, the second singular value is sufficiently smaller 
than the first as to make condition number effectively infinite.

In[21]:= InputForm[SingularValueList[N[coeffmat]]]
Out[21]//InputForm= {1.863870820026589*^25}

An exact computation (or using smaller tolerance in the machine 
arithmetic) confirms this.

In[22]:= InputForm[N[SingularValueList[coeffmat]]]
{1.863870820026589*^25 - 1.697734891411824*^9*I,
  0.16702466434058325 - 3.0814879110195774*^-33*I}

This shows the condition number to be around 10^26, far too large to 
guarantee any accurate digits at machine precision.

One way around the problem would be to specify higher WorkingPrecision 
for NSolve. How high can be a matter of trial and error. Since we 
already know the condition number ballpark, we'll just use something 
around 3 times that large (this is more than sufficient).

In[24]:= InputForm[NSolve[{BesselJ[0,20] - BesselJ[0,20]*r[0] == 
  BesselJ[0,20] + BesselJ[0,20]*r[0] == BesselJ[0,60*I]*t[0]},
  {r[0], t[0]}, WorkingPrecision->80]]

{{r[0] -> 
99999999999999999999999999595998`79.69897000433602 -
   t[0] -> 
12841969591052271352247`79.69897000433602*^-27 - 

Daniel Lichtblau
Wolfram Research

  • Prev by Date: Re: Nested numerical integration
  • Next by Date: Re: Inverse function warnings
  • Previous by thread: RowReduce::luc when using NSolve
  • Next by thread: Re: RowReduce::luc when using NSolve