Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #3200

Re: Only real solutions for a=a^0.7*b

From "niels.gierse@gmail.com" <niels.gierse@googlemail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Only real solutions for a=a^0.7*b
Date 2011-06-20 23:37 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <itolkh$ere$1@smc.vnet.net> (permalink)
References <itm0nq$13i$1@smc.vnet.net>

Show all headers | View raw


On 20 Jun., 01:28, Dana DeLouis <dana....@gmail.com> wrote:
> Hi.  Given an example like this:
>
> equ=3 x^3+4 x-7.0;
> Solve[equ==0,x]
> {
> {x->-0.5-1.44338 I},
> {x->-0.5+1.44338 I},
> {x->1.}
>
> }
>
> Sometimes this works:
>
> Solve[equ==0,x,Reals]
> {{x->1.}}
>
> However, your example returned a ConditionalExpression
>
> eq =  a==a^0.7*b ;
> Solve[eq,a,Reals]
> <...>
>
> Probably not the best way, but here's one idea:
>
> NoComplex[v_]:=Length[Position[v,_Complex,\[Infinity],Heads->True]]==
=0
>
> eq =  a==a^0.7*b ;
> Solve[eq,a] //NoComplex
>
> {{a->0.},{a->1. b^(10/3)}}
>
> Another example:
>
> equ = 3 x^3 + 4 x - 7.0;
> Solve[equ == 0, x]
>
> {{x -> -0.5 - 1.44338 I}, {x -> -0.5 + 1.44338 I}, {x -> 1.}}
>
> Solve[equ == 0, x] // NoComplex
>
> {{x -> 1.}}
>
> = = = = = = = = = =
> HTH  : >)
> Dana DeLouis
> $Version
> 8.0 for Mac OS X x86 (64-bit) (November 6, 2010)
>
> On Jun 18, 7:54 pm, "niels.gie...@gmail.com" <niels.gie...@googlemail.com=
> wrote:
>
>
>
>
>
>
>
> > Hi all!
>
> > Is there a way to make Mathematica only report the real solution for
>
> > eq = a == a^0.7*b
>
> > Solve[eq, a]
>
> > reports:
> > {{a -> 0.}, {a -> (-0.5 - 0.866025 I) b^(
> >     10/3)}, {a -> (-0.5 + 0.866025 I) b^(10/3)}, {a -> 1. b^(10/3)}=
}
>
> > The solution I am after is the last one. Is there a way to have solve
> > only report that one? As the exponent is changing from case to case
> > selecting one like [[5]] does not help. Playing around with Refine[],
> > Assuming[] etc. to impose a>0 did not help.
>
> > Does someone have a hint for me how to do this? I am using Mathematica
> > 7.0.0 (Windows, 64 bit)
>
> > Cheers,
>
> > Niels

Thanks for your reply. It both worked _and_ helped me getting some
insight into functional programming.

In the meantime I made the discovery that one can fool Mathematica
into doing what I want. If I manually reshape the equation to be

eq2=1.0==b/a^0.3

then Solve[eq2,a] reports:
Solve::ifun: Inverse functions are being used by Solve, so some
solutions may not be found; use Reduce for complete solution
information. >>
{{a -> 1./(1/b)^3.333333333333333}}

So kind of what I was hoping for. Looks that there could be some
finetuning in the Solve[] function done to allow for domain selection.

Again, thanks for your help.

Cheers

Niels

Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: Only real solutions for a=a^0.7*b Dana DeLouis <dana.del@gmail.com> - 2011-06-19 23:28 +0000
  Re: Only real solutions for a=a^0.7*b "niels.gierse@gmail.com" <niels.gierse@googlemail.com> - 2011-06-20 23:37 +0000

csiph-web