MathGroup Archive 1994

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

Search the Archive

Inequalities into Standard Form

  • To: mathgroup at
  • Subject: Inequalities into Standard Form
  • From: Ronald D. Notestine <ronald at>
  • Date: Wed, 22 Jun 94 22:35:58 +0900

Some time ago, I wrote asking how to put
linear inequalities into standar form:
with all variable terms on the lhs, and
the constant term on the rhs. I wrote that
I could make such a function myself, but
hoped for something built-in or ready-made.
  Eventually, I asked WRI tech support, and
am glad I did. Edmund Greaves, of WRI, 
immediately started in on the problem, and
has sent me a far neater, and watertight,
function than anything I would have made.
  Here is the function supplied by Ed Greaves
of Wolfram Research:
  (I have to hand type everything, so any 
mistakes are mine.)

convertIneq[ x_[lhs_,rhs_] ] :=
    temp = Expand[ lhs - rhs ]; (*all terms to rhs*)
    const = If[Head$ at {(J[temp] === Plus,
		Select[temp, NumberQ],
    result = x[temp-const, -const];
	(* If a negative rhs is okay, done *)
	(* If need rhs non-negative... *)
      result = Map[ Minus, result];
      result = result /. {Less -> Greater,

I hope this is of help to any one with similar problems.

  • Prev by Date: Re: No Dots?
  • Next by Date: Re: eval differential expressions
  • Previous by thread: Re: Defining a predicate
  • Next by thread: Re: Inequalities into Standard Form