On 2/24/2019 5:25 AM, malika yassa via R-help wrote:
HELLOplease I want to approximate the solution of the equation
f(x)=x*(x-2)+log(x)=0
for that i did this program
f <- function(x){x*(x-2)+log(x)}
x <- c(1 : 2)
f(x)
h <- 1e-7
df.dx <- function(x){(f(x + h) - f(x)) / h}
df.dx(3/2);df.dx(2)
n
This list has a no homework policy.
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Sun, Feb 24, 2019 at 9:22 AM malika yassa via R-help <
r-help@r-project.org>
HELLOplease I want to approximate the solution of the equation
f(x)=x*(x-2)+log(x)=0
for that i did this program
f <- function(x){x*(x-2)+log(x)}
x <- c(1 : 2)
f(x)
h <- 1e-7
df.dx <- function(x){(f(x + h) - f(x)) / h}
df.dx(3/2);df.dx(2)
newton <- function(f, tol = 1e-7, x0 = 3/2, N = 100){
h
3 matches
Mail list logo