       Re: using Upset for defining positive real values (Re: Can I get ComplexExpand to really work?)

• To: mathgroup at smc.vnet.net
• Subject: [mg14711] Re: using Upset for defining positive real values (Re: Can I get ComplexExpand to really work?)
• From: Rolf Mertig <rolf at mertig.com>
• Date: Tue, 10 Nov 1998 01:21:03 -0500
• Organization: Mertig Research & Consulting
• References: <720tjl\$1vs@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Maarten.vanderBurgt at icos.be wrote:
>
> Hello,
>
> In functions like Solve and Simplify there is no option like the
> Assumptions option in Integrate.
> In a recent message ([mg14634]) Kevin McCann(?) suggested usign Upset as
> an alternative to the Assumptions option in Integrate. I thought this
> might work as well for Solve, Simplify etc.
>
> In the example below I want A to be positive real number. I use Upset to
> give A the right properties.
> I was hoping Solve[A^2-1 == 0, A] would come up with the only possible
> solution given that A is a positive real: {A -> 1}. Same for
> Simplify[Sqrt[A^2]]: I would expect the result to be simply A (instead
> of Sqrt[A^2]) when A is set to be positive and real.
>
> Upset does not seem to work here.
>
> 1st question: why?
Because Simplify and Solve are obviously not written to recognize Upset
values.

>
> 2nd question: is there a way you can introduce simple assumptions about
> variables in order to rule out some solutions or to reduce the number
> of solutions from functions like Solve, or to get a more simple answer
> from manipulation fuctions like Simplify.
>...
> In:= Solve[a^2-1 == 0, a]
> Out= {{a -> -1},{a -> 1}}
> In := Simplify[Sqrt[a^2]]
> Out= Sqrt[a^2]
>

Some possibilities are:

In:= PosSolve[eqs_, vars_] := Select[Solve[eqs, vars], Last[Last[#]]
> 0&]

In:= PosSolve[a^2-1 == 0, a]

Out= {{a -> 1}}

In:= PowerExpand[Sqrt[a^2]]

Out= a

--

Dr. Rolf Mertig
Mertig Research & Consulting
Mathematica training and programming Development and distribution of
FeynCalc  Amsterdam, The Netherlands
http://www.mertig.com

```

• Prev by Date: Re: Vector Transposition
• Next by Date: Re: ODEs and phase portraits
• Previous by thread: Re: using Upset for defining positive real values (Re: Can I get ComplexExpand to really work?)
• Next by thread: Re: using Upset for defining positive real values (Re: Can I get ComplexExpand to really work?)