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
Functions for partial factorials, factorials, binomial coeffs., & rows of Pascale's Triangle.
Polynomial Regression with Interaction Terms
histograms for survey stats and fats
Sierpinski curve
Integracao-Interpolacaa
ExDecaiEulerMin23-02-21
31-08-2020-Exemplo AjusteNaoL
Simple Plot
3dgraphics-and-curvesb
Ch. 4 Boxplot and Histogram Examples - Font size increased