Re: FindRoot with Logarithmic terms

*To*: mathgroup at smc.vnet.net*Subject*: [mg116028] Re: FindRoot with Logarithmic terms*From*: Peter Breitfeld <phbrf at t-online.de>*Date*: Sat, 29 Jan 2011 05:29:21 -0500 (EST)*References*: <ihu8is$1pj$1@smc.vnet.net>

skunkwerk wrote: > Hi, > I'm trying to find the roots of a logarithmic equation that I've plotted successfully (I can see both roots are between 0 and 1). > > expr = 7500*x*(1 - x) + 325*8.314*(x*Log[x] + (1 - x)*Log[(1 - x)]) > FindRoot[expr == 0, {x, 0, 1}] > > FindRoot:nlnum: the function value(indeterminate) is not a list of numbers with dimensions {1} at {x} = {0.} > > any ideas? > > thanks > Your expr is indeterminate at x=0 and x=1 due to the Log. So you have the following possibilities: 1. Adjust the search interval of FindRoot: FindRoot[expr == 0, {x, 0.2, 0.5}] ----> {x->0.468458} FindRoot[expr == 0, {x, 0.5, 0.9}] ----> {x->0.531542} 2. Use Reduce: Reduce[expr==0,x,Reals] ----> x=0.468458 || x=0.513542 you will get a message about inexact coefficients though. If you use Reduce[Rationalize[expr]==0,x,Reals] you will get two solutions in the form of Root[]-objects. //Peter -- _________________________________________________________________ Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de