Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
# Bisection (numerical method) - Método da Bissecção
# Bisection (numerical method) - Método da Bissecção #….......................................... # Inserir sua função abaixo: g <- function(x){ x^3 - 6*x^2 - 33*x + 76 } #............................................ bis <- function(f,a,b,tol){ if( f(a)*f(b) > 0){ warning("Não existem raízes no intervalo: [",a,",",b,"]") }else{ while( (b-a)/2 > tol){ fa = f(a) fb = f(b) pm = (a+b)/2 fpm = f(pm) if( fpm*fb < 0){ a <- pm }else{ b <- pm pm <- (a+b)/2 } } } cat("Raíz: ", pm) curve(f, pm - 10, pm + 10) abline(h=0,v=0) points(pm,0, pch = 19, col = 'red') } bis(g,-5,1,0.00001) cat("\n ") bis(g,0,3,0.00001) cat("\n") bis(g,5,10,0.00001)
run
|
edit
|
history
|
help
0
Sine approximation
errores resta
tirangulopascalfrac
16-09-2020ExPedro
SimulacaoItaly-17-02-2021
Test
Not able to install packages
Predictive power of a test when False positive rate = False negative rate
Ex15-12-20
Aula 16 agosto 2019