MathGroup Archive 2005

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

Search the Archive

Re: What is causing this error message?


Bookreader wrote:
> 	NSolve[{x^3y + xy - 10 = 0, xy^2 - xy + 6 = 0}, {x, y}]
> 
> 	Set::write: Tag Plus in -10 + x y + x^3  y is Protected. More?
> 
> 	Please tell me how to correct this.
> 
> 	Thanks.
> 
You used the Set operator (single =, which is an assignment) rather than 
the Equal (double ==, which is a logical operator) so here Mathematica 
tries to assign the value zero to each of the equations, hence the error 
message. What you want is

In[1]:=
NSolve[{x^3*y + x*y - 10 == 0, x*y^2 - x*y + 6 == 0}, {x, y}]

Out[1]=
{{x -> 1.38167 + 1.02952*I,
    y -> -0.109449 - 1.70695*I},
   {x -> 1.38167 - 1.02952*I,
    y -> -0.109449 + 1.70695*I},
   {x -> -0.510413 + 1.72079*I,
    y -> 2.02035 + 1.05397*I},
   {x -> -0.510413 - 1.72079*I,
    y -> 2.02035 - 1.05397*I}, {x -> -1.74251,
    y -> -1.4218}}

Best regards,
/J.M.


  • Prev by Date: Re: List searching
  • Next by Date: Re: reducing the time of constructing a List
  • Previous by thread: Re: What is causing this error message?
  • Next by thread: Re: What is causing this error message?