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


Groups > comp.soft-sys.math.mathematica > #3188 > unrolled thread

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

Started byDana DeLouis <dana.del@gmail.com>
First post2011-06-19 23:28 +0000
Last post2011-06-20 23:37 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  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

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

FromDana DeLouis <dana.del@gmail.com>
Date2011-06-19 23:28 +0000
SubjectRe: Only real solutions for a=a^0.7*b
Message-ID<itm0nq$13i$1@smc.vnet.net>
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


[toc] | [next] | [standalone]


#3200

From"niels.gierse@gmail.com" <niels.gierse@googlemail.com>
Date2011-06-20 23:37 +0000
Message-ID<itolkh$ere$1@smc.vnet.net>
In reply to#3188
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web