MathGroup Archive 1999

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

Search the Archive

Re: How to find solutions for conditioned equations?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg19919] Re: How to find solutions for conditioned equations?
  • From: d8442803 at student.nsysu.edu.tw (Wen-Feng Hsiao)
  • Date: Tue, 21 Sep 1999 02:22:51 -0400
  • Organization: MIS
  • References: <7s1q0f$9oe@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I would like to thank Bob for illustrating me an succinct way to solve 
conditioned equations: 

"
A[x_ /; -1 < x <= 1] := (x + 1)/2;
A[x_ /; 1 < x <= 3] := (3 - x)/2;
A[x_] = 0;

Plot[A[x], {x, -1.2, 3.2}];

Needs["Algebra`InequalitySolve`"];

soln[a_ /; 0 <= a <= 1] := Module[{x}, x /. 
        {ToRules[InequalitySolve[(x + 1)/2 == a || (3 - x)/2 == a, x]]}];

Table[soln[a], {a, 0, 1, .2}]

{{-1, 3}, {-0.6, 2.6}, {-0.2, 2.2}, {0.2, 1.8}, {0.6, 1.4}, {1.}}

Bob Hanlon
"

Now my question is whether I can use A[x]==a directly in the solving 
equation? Say, for example,

soln[a_]=InequalitySolve[A[x]== a, x]]}];  // substituted by A[x]==a

Thanks!

> Suppose I have an equation
> 
> A(x)= (x+1)/2, for -1<x<=1
>     = (3-x)/2, for 1<x<=3
>     = 0      , otherwise
> 
> Now if I want to find solutions for A(x)==a, how can I otain the 
> solutions simultaneously (i.e., represented as (2a-1, 3-2a))? 


  • Prev by Date: Re: How to find solutions for conditioned equations?
  • Next by Date: Re: Plot, Table.
  • Previous by thread: Re: How to find solutions for conditioned equations?
  • Next by thread: Re: Re: How to find solutions for conditioned equations?