Re: Re: using Upset for defining positive real values (Re: Can I get ComplexExpand to really work?)
- To: mathgroup at smc.vnet.net
- Subject: [mg14810] Re: [mg14756] Re: using Upset for defining positive real values (Re: Can I get ComplexExpand to really work?)
- From: Jurgen Tischer <jtischer at col2.telecom.com.co>
- Date: Wed, 18 Nov 1998 01:29:12 -0500
- Organization: Universidad del Valle
- References: <199811140807.DAA03408@smc.vnet.net.>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Maarten, I'm afraid you are asking for the philosopher's stone. Or maybe just the wrong question. If it would be of any help, one answer at least for very easy problems could be to use interval arithmetic (which could be and has been extenuated to standard functions). Something like In[1]:= positiveSolve[eq_,vars_,param_]:= Module[{sol,sol1,pos}, sol=Solve[eq,vars]; sol1=sol/.param; pos=Position[sol1, a_/;(IntervalMemberQ[Interval[{0,\[Infinity]}], IntervalUnion[ Sequence@@Cases[a,Interval[_],\[Infinity]]]]),{ 1},Heads->False]; Extract[sol,pos]] Here is an example how it works: In[2]:= positiveSolve[x^2 == b, x, b -> Interval[{0, Infinity}]] Out[2]= {{x -> Sqrt[b]}} and here one how it doesn't In[2]:= positiveSolve[{x^2 + y^2 == a, y == b^2}, {x, y}, {a -> Interval[{0, Infinity}], b -> Interval[{0, Infinity}]}] Out[2]= {} I could find positive solutions using other conditions (intervals), like In[3]:= positiveSolve[{x^2 + y^2 == a, y == b^2}, {x, y}, {a -> Interval[{1, Infinity}], b -> Interval[{-1, 1}]}] Out[3]= {{x -> Sqrt[a - b^4], y -> b^2}} but of course this is not at all satisfying, the real condition for positive solutions (and real a, b) being b^2 < a. So it amounts to an analysis of conditions on the parameters, with possibly extra information about the parameters for physical reasons. So I'm back to the philosopher's stone. And maybe even worse: I think it should not be too difficult to find examples in physics where non standard values of the parameters led to surprising solutions. Jurgen Maarten.vanderBurgt at icos.be wrote: > > Rolf, > > Thanks for the tips. > > PowerExpand comibed with Simplify works fine > > Instead of your PosSolve function, which ony works in the particular > case of PosSolve[a^2 -1==0, a], I am in fact looking for a more general > solution of the following problem: > Solve[{f(a,b,c,d, x,y,z)==0}, {x,y,z}], where {f( )==0} is a well > defined set of equations for some physical problem, and retain e.g. > only positive solutions for x, y,z while a,b are positive reals and > c,d are negative. If your set of solutions is quite complicated it is > often difficult to see which one(s) actually make(s) sense in the > particular problem Is there a way to do this, with some 'Solve-like' > function, without having to calculate numerical values for the > solutions with some typical parameter values for a,b,c,d? > > thanks > > Maarten van der Burgt > > rolf at mertig.com on 09-11-98 02:49:58 AM > > cc: > > Subject: [mg14810] [mg14756] Re: using Upset for defining positive real values (Re: Can I > get > ComplexExpand to really work?) > > 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[3]:= Solve[a^2-1 == 0, a] > > Out[4]= {{a -> -1},{a -> 1}} > > In[5] := Simplify[Sqrt[a^2]] > > Out[5]= Sqrt[a^2] > > > Some possibilities are: > > In[1]:= PosSolve[eqs_, vars_] := Select[Solve[eqs, vars], Last[Last[#]] > > 0&] > In[2]:= PosSolve[a^2-1 == 0, a] > Out[2]= {{a -> 1}} > In[3]:= PowerExpand[Sqrt[a^2]] > Out[3]= a > > -- > Dr. Rolf Mertig > Mertig Research & Consulting > Mathematica training and programming Development and distribution of > FeynCalc Amsterdam, The Netherlands > http://www.mertig.com
- References:
- Re: using Upset for defining positive real values (Re: Can I get ComplexExpand to really work?)
- From: Maarten.vanderBurgt@icos.be
- Re: using Upset for defining positive real values (Re: Can I get ComplexExpand to really work?)