> exp_log_to_power(e) := block( [logconcoeffp : lambda([s],true)],
> subst("^" = lambda([a,b], if a = %e and ?mlogp(b) then first(b) else funmake("^",
> [a,b])), logcontract(e)));
Wow. This makes my head spin trying to unpack all of the stuff going on
in that function. But pretty cool. Thanks for that.
It's starting to look like if I get serious about manipulating logs that
I'll probably have to make some kind of package of helper functions to
make using these functions less cumbersome and the end output more
readable.
I was looking at the tellsimp and tellsimp_after functions. They look
like they could be useful here. But are they only triggered after
simplify() or do other functions like radcan and ratsimp also trigger
tellsimp?
--Bill
On 05/15/2013 07:24 PM, Barton Willis wrote:
> The function radcan does more than exp(log(x)) --> x. Some of these things might not be desired.
> An alternative
>
> exp_log_to_power(e) := block( [logconcoeffp : lambda([s],true)],
> subst("^" = lambda([a,b], if a = %e and ?mlogp(b) then first(b) else funmake("^",[a,b])), logcontract(e)));
>
> (%i23) exp_log_to_power(x = %e^(log(10)*y));
> (%o23) x=10^y
>
> But logcontract might do things that aren't desired either--if so adjust logconcoeffp.
> The call to ?mlogp is a poor practice. So it goes.
>
> --Barton
>
> ________________________________________
> From: Bill Wood [william.wood3 at comcast.net]
> Sent: Wednesday, May 15, 2013 20:33
> To: Bill Eaton
> Cc: Barton Willis; maxima at math.utexas.edu
> Subject: Re: [Maxima] teaching Maxima logarithms
>
> On Wed, 2013-05-15 at 18:04 -0700, Bill Eaton wrote:
> . . .
>> That definitely works, but my desire is to strip off any vestiges of e or
>> log(10) in the output. What I would really like to see is:
>> (%o8) [x=10^y)]
>> or more generally
>> (%o8) [x={base n}^y]
> For What It's Worth, which is probably not so much, we can get close:
>
> (%i1) display2d:false$
>
> (%i2) eq : y = log10(x);
>
> (%o2) y = log10(x)
> (%i3) log10_to_log(ex) := subst(lambda([x],log(x)/log(10)),'log10,ex)$
>
> (%i4) log10_to_log(eq);
>
> (%o4) y = log(x)/log(10)
> (%i5) solve(%,x);
>
> (%o5) [x = %e^(log(10)*y)]
> (%i6) x = radcan(part(%o5,1,2));
>
> (%o6) x = 2^y*5^y
>
> RADCAN overshot just a little, but at least there's no log10 or %e. I
> have no idea whether this generalizes, or how.
>
> --
> Bill Wood
>
>
>