Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.A41.4.44.0208301444590.226828-100000@homer03.u.washington.edu>
Date: 2002-08-30T21:45:22Z
From: Thomas Lumley
Subject: solving equations
In-Reply-To: <002f01c2506c$2c9a6080$39cffea9@batata>

On Fri, 30 Aug 2002, Antonio Olinto wrote:

> Dear R-users,
>
> I'm trying to solve the following equation:
>
> F=25*(F+0.2)/22.2/(EXP(F+0.2)-1)
>
> In Excel I found F=0.696176718 but I'd like to know how to use R to solve
> it. I tried, without success, to use "solve".
>

Use uniroot()

R> uniroot(function(F) F-25*(F+0.2)/22.2/(exp(F+0.2)-1), c(0,10))
$root
[1] 0.695973

$f.root
[1] -9.561183e-06

$iter
[1] 4

$estim.prec
[1] 6.103516e-05


	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._