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


Groups > comp.soft-sys.math.mathematica > #15857

Re: FindRoot with Logarithmic terms

From Peter Breitfeld <phbrf@t-online.de>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: FindRoot with Logarithmic terms
Date 2011-01-29 10:44 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ii0r1h$ji2$1@smc.vnet.net> (permalink)
References <ihu8is$1pj$1@smc.vnet.net>

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

FindRoot with Logarithmic terms skunkwerk <skunkwerk@gmail.com> - 2011-01-28 11:16 +0000
  Re: FindRoot with Logarithmic terms psycho_dad <s.nesseris@gmail.com> - 2011-01-29 10:43 +0000
  Re: FindRoot with Logarithmic terms Peter Breitfeld <phbrf@t-online.de> - 2011-01-29 10:44 +0000

csiph-web