Re: FindRoot with Logarithmic terms
- To: mathgroup at smc.vnet.net
- Subject: [mg116029] Re: FindRoot with Logarithmic terms
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sat, 29 Jan 2011 05:29:34 -0500 (EST)
expr = 7500*x*(1 - x) + 325*8.314*(x*Log[x] + (1 - x)*Log[(1 - x)]);
expr /. {{x -> 0}, {x -> 1}} // Quiet
{Indeterminate, Indeterminate}
So give it different starting values than 0 and 1
FindRoot[expr == 0, {x, 0.1, 0.2}] // Chop
{x -> 0.468458}
FindRoot[expr == 0, {x, 0.8, 0.9}] // Chop
{x -> 0.531542}
Bob Hanlon
---- skunkwerk <skunkwerk at gmail.com> 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