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:
 
<sourcesyntaxhighlight lang="matlab">Este exemplo precisa de ser melhorado!</sourcesyntaxhighlight>
 
<math>x_n=1+\frac{1}{n}</math>,
Linha 120:
=== Código em Octave===
 
<sourcesyntaxhighlight lang="matlab">
function bf=bissec(a,b,Niter,tol)
 
Linha 155:
disp("")
endfunction
</syntaxhighlight>
</source>
 
Com a função
 
<sourcesyntaxhighlight lang="matlab">
function fv = f(x)
x*ln(x) - 3.2;
endfunction
</syntaxhighlight>
</source>
 
 
Para correr o programa fazer
; Input
<sourcesyntaxhighlight lang="matlab">
bissec(2,3)
</syntaxhighlight>
</source>
 
e gera o
Linha 194:
 
; Input
<sourcesyntaxhighlight lang="matlab">
bissec(2,3)
</syntaxhighlight>
</source>
 
; Output
Linha 233:
Com a mesma f.m definida anteriormente.
 
<sourcesyntaxhighlight lang="matlab">
function sf=secant(x,y,Niter,tol)
 
Linha 262:
disp("")
endfunction
</syntaxhighlight>
</source>
 
;Input:
 
<sourcesyntaxhighlight lang="matlab">
secant(.2,.3,15,.01)
</syntaxhighlight>
</source>
 
 
Linha 290:
Com a mesma f.m definida anteriormente.
 
<sourcesyntaxhighlight lang="matlab">
function rff=regulafalsi(x,y,Niter,tol)
 
Linha 324:
 
endfunction
</syntaxhighlight>
</source>
 
;Input:
 
<sourcesyntaxhighlight lang="matlab">
regulafalsi(.2,1,100,.001)
</syntaxhighlight>
</source>
 
;Output:
Linha 380:
Com a função g.m definida por:
 
<sourcesyntaxhighlight lang="matlab">
function gv = g(x)
 
Linha 386:
 
endfunction
</syntaxhighlight>
</source>
 
<sourcesyntaxhighlight lang="matlab">
function sfp=fpoint(x,Niter,tol)
 
Linha 420:
 
endfunction
</syntaxhighlight>
</source>
 
;Input:
 
<sourcesyntaxhighlight lang="matlab">
fpoint(.2,100,.01)
</syntaxhighlight>
</source>
 
;Output: