Re: Re: odd mathematica blindspot
- To: mathgroup at smc.vnet.net
- Subject: [mg56547] Re: [mg56472] Re: [mg56468] odd mathematica blindspot
- From: Edward Peschko <esp5 at pge.com>
- Date: Thu, 28 Apr 2005 02:40:50 -0400 (EDT)
- References: <200504260533.BAA14442@smc.vnet.net> <200504270152.VAA01634@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On Tue, Apr 26, 2005 at 09:52:28PM -0400, yehuda ben-shimol wrote: > Hi, > First Mathematica solves it with no problem. I wonder which version > you are using. I tested it on ver. 5.1 on Win XP. > Second, the (rather simple) problem is > Solve[a^x==b,x] will return > {{x->Log[b]/Log[a]}} > so if you assign > sol = Solve[a^x==b,x]; > you can check it for many values of a and b which in your case will lead to > sol={{x->-Log[2]/Log[(999999999999/10000000000000)]}} > to extract this value you need to use replacement rules > x/. sol[[1]] will give you the number > x/.sol will give you the number as a list of a single element. .... because the problem is so simple, that's why its a blindspot in mathematica IMO. Anyways, I tried it again - Mathematica 5.1 for Linux Copyright 1988-2004 Wolfram Research, Inc. -- Terminal graphics initialized -- In[1]:= Off[Solve::ifun]; In[2]:= sol[a_, b_] := Solve[a^x == b, x] In[3]:= sol[(9999999999/10000000000), .5] Out[3]= {] In[4]:= sol[5,15]; {{ x -> Log[15]/Log[5] }} The really odd thing is that it doesn't come up with a *symbolic* solution, it just says that none exists. Perhaps it is evaluating (9.../10....) as one, and hence triggering Solve to make the problem insoluble. Perhaps there's an issue of precision? However, FindRoot works perfectly fine on the same expression, so its a bit strange. btw - the notation for extraction of elements is rather.. odd. Is it basically an array of array of arrays? I would expect: yy = {{ x -> 1, y -> 1}, { x -> 2, y -> 2 }} to be accessed via: yy[[0]]{x} and the keys of the solution to be accessed by: keys(yy[[0]]) or somesuch. Is there a good tutorial somewhere on the use of datastructures in mathematica? sort of a pocketguide on getting around? Ed
- Follow-Ups:
- Re: Re: Re: odd mathematica blindspot
- From: yehuda ben-shimol <bsyehuda@gmail.com>
- Re: Re: Re: odd mathematica blindspot
- References:
- odd mathematica blindspot
- From: Edward Peschko <esp5@pge.com>
- Re: odd mathematica blindspot
- From: yehuda ben-shimol <bsyehuda@gmail.com>
- odd mathematica blindspot