Métodos numéricos/Equações não lineares: diferenças entre revisões
[edição verificada] | [revisão pendente] |
Conteúdo apagado Conteúdo adicionado
m Foram revertidas as edições de 105.168.25.204 (disc) para a última revisão de Abacaxi |
m <source> -> <syntaxhighlight> (phab:T237267) |
||
Linha 19:
; Exemplo: Considere-se as seguintes sucessões:
<
<math>x_n=1+\frac{1}{n}</math>,
Linha 120:
=== Código em Octave===
<
function bf=bissec(a,b,Niter,tol)
Linha 155:
disp("")
endfunction
</syntaxhighlight>
Com a função
<
function fv = f(x)
x*ln(x) - 3.2;
endfunction
</syntaxhighlight>
Para correr o programa fazer
; Input
<
bissec(2,3)
</syntaxhighlight>
e gera o
Linha 194:
; Input
<
bissec(2,3)
</syntaxhighlight>
; Output
Linha 233:
Com a mesma f.m definida anteriormente.
<
function sf=secant(x,y,Niter,tol)
Linha 262:
disp("")
endfunction
</syntaxhighlight>
;Input:
<
secant(.2,.3,15,.01)
</syntaxhighlight>
Linha 290:
Com a mesma f.m definida anteriormente.
<
function rff=regulafalsi(x,y,Niter,tol)
Linha 324:
endfunction
</syntaxhighlight>
;Input:
<
regulafalsi(.2,1,100,.001)
</syntaxhighlight>
;Output:
Linha 380:
Com a função g.m definida por:
<
function gv = g(x)
Linha 386:
endfunction
</syntaxhighlight>
<
function sfp=fpoint(x,Niter,tol)
Linha 420:
endfunction
</syntaxhighlight>
;Input:
<
fpoint(.2,100,.01)
</syntaxhighlight>
;Output:
|