Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Mathematics
General TopicsResearchOperations ResearchStatisticsMathematical LogicNumerical AnalysisUndergraduate MathAlgebra HelpRecreational Math
Math Software
MapleMathematicaMATLABScilabSASSPSS

Math Forum / Math Software / Maple / October 2008



Tip: Looking for answers? Try searching our database.

Solving linear systems -- carefully!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rouben - 26 Oct 2008 02:44 GMT
The solution of the equation a*x=0, where a and x are scalars,
depends on the value of the coefficient a.  If a is nonzero,
then x=0 is the only solution.  If a is zero, then any x is a
solution.

The Maple command

solve(a*x=0, x);

produces the x=0 answer.  Is there a way to tell Maple to
produce a flag/warning/whatever, to let the user know that
solutions may have been lost?

A more interesting situation occurs when solving the
following systems 3 equations in the 2 unknowns x and y:

sys := [
   x + a*y = 0,
   a*x + b^2*y = 0,
   a^2*x + a*b^2*y = 0
];

solve(sys, [x,y]);

this produces the solution [x=0, y=0] which is correct if
b^2-a^2 is nonzero.

If b^2-a^2 is zero, there is an infinite family of solutions
which is being ignored by Maple.  Again, is there a way to ask
Maple to let the user know that solutions may have been lost?

As a related question: Are there other CAS that can produce
the complete families of solutions in these examples?  I am
thinking of Macsyma, which I used to use back in the '80s,
and which I haven't used since.  Macsyma used to stop in the
middle of a calculation and ask the user if b^2-a^2 was nonzero
before it attempted to divide by it.

Signature

Rouben Rostamian

A N Niel - 26 Oct 2008 11:43 GMT
> As a related question: Are there other CAS that can produce
> the complete families of solutions in these examples?  I am
> thinking of Macsyma, which I used to use back in the '80s,
> and which I haven't used since.  Macsyma used to stop in the
> middle of a calculation and ask the user if b^2-a^2 was nonzero
> before it attempted to divide by it.

There was a system called Milo (which I haven't used for many years)
that would split into cases in situations like this.  So you tell it
solve a*x=0 for x, and it gives you two side-by-side boxes,
one with case a <> 0 , the other with case a = 0.
Robert Israel - 26 Oct 2008 20:57 GMT
> The solution of the equation a*x=0, where a and x are scalars,
> depends on the value of the coefficient a.  If a is nonzero,
[quoted text clipped - 8 lines]
> produce a flag/warning/whatever, to let the user know that
> solutions may have been lost?

If you tell Maple to solve for x, it's in effect working in a ring of rational
functions of a, and in that sense x=0 is the only solution.  If you want the
solution a=0, you must solve for both x and a:

solve(a*x=0, {x,a});

  {a = 0, x = x}, {a = a, x = 0}

> A more interesting situation occurs when solving the
> following systems 3 equations in the 2 unknowns x and y:
[quoted text clipped - 13 lines]
> which is being ignored by Maple.  Again, is there a way to ask
> Maple to let the user know that solutions may have been lost?

solve(sys, [x,y,a,b]);

  [[x = 0, y = 0, a = a, b = b], [x = -b*y, y = y, a = b, b = b],
   [x = b*y, y = y, a = -b, b = b]]
Signature

Robert Israel              israel@math.MyUniversitysInitials.ca
Department of Mathematics        http://www.math.ubc.ca/~israel
University of British Columbia            Vancouver, BC, Canada

Axel Vogt - 26 Oct 2008 21:04 GMT
>> The solution of the equation a*x=0, where a and x are scalars,
>> depends on the value of the coefficient a.  If a is nonzero,
[quoted text clipped - 16 lines]
>
>    {a = 0, x = x}, {a = a, x = 0}
...

working in a ring of rational *functions* ...  is there a hint on that
in the help?
Jon McLoone - 28 Oct 2008 10:17 GMT
<snip>
> A more interesting situation occurs when solving the
> following systems 3 equations in the 2 unknowns x and y:
[quoted text clipped - 4 lines]
>     a^2*x + a*b^2*y = 0
> ];
<snip>

> If b^2-a^2 is zero, there is an infinite family of solutions
> which is being ignored by Maple.  Again, is there a way to ask
> Maple to let the user know that solutions may have been lost?
>
> As a related question: Are there other CAS that can produce
> the complete families of solutions in these examples?

Mathematica gives:

In[1]:= Reduce[{x + a*y == 0, a*x + b^2*y == 0,
 a^2*x + a*b^2*y == 0}, {x, y}]

Out[1]= (b == 0 && a == 0 && x == 0) || ((a == -b || a == b) &&
  a != 0 &&
     y == -(x/a)) || (a == 0 && x == 0 && y == 0 && b != 0) ||
  (a^2 - b^2 != 0 && x == 0 && a != 0 && y == 0)
Rouben Rostamian - 28 Oct 2008 23:07 GMT
In article <NeednXp-yZYOVp7UnZ2dnUVZ_gidnZ2d@comcast.com>, I asked:

>sys := [
>    x + a*y = 0,
[quoted text clipped - 10 lines]
>middle of a calculation and ask the user if b^2-a^2 was nonzero
>before it attempted to divide by it.

Robert Israel and Jon McLoone responded with commands in
Maple and Mathematica for obtaining the full set of solutions.
Thanks!  A N Niel pointed to a CAS called Milo which would
also handle the required computations.  In searching for Milo,
it appears that it is no longer available.  It also appears
that it was a Mac-specific software, although I may be wrong
on that.

Thanks again for all your comments.

Signature

Rouben Rostamian

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.