Newton

Páginas: 2 (324 palabras) Publicado: 9 de octubre de 2012
>> J = inline('[8*x(1), -20+x(2)/2; x(2)^2/2+2, x(1)/2-5]')
J =
Inline function:
J(x) = [8*x(1), -20+x(2)/2; x(2)^2/2+2, x(1)/2-5]
>> J([2,5])
ans =
16 -17.5
14.5 -4
>> f1f2
f1f2 =
Inline function:
f1f2(x) = [4*x(1)^2-20*x(2)+x(2)^2/4+8;(x(1)*x(2)^2)/2+2*x(1)-5*x(2)+8]
>> gam =inline('[-(4*x(1)^2-20*x(2)+x(2)^2/4+8)+x(1)*(8*x(1))+x(2)*(-20+x(2)/2);-((x(1)*x(2)^2)/2+2*x(1)-5*x(2)+8)+x(1)*(x(2)^2/2+2)+x(2)*(x(1)/2-5)]')
gam =
Inline function:
gam(x) =[-(4*x(1)^2-20*x(2)+x(2)^2/4+8)+x(1)*(8*x(1))+x(2)*(-20+x(2)/2);-((x(1)*x(2)^2)/2+2*x(1)-5*x(2)+8)+x(1)*(x(2)^2/2+2)+x(2)*(x(1)/2-5)]
>> gam([2, 5])
ans =
14.25
-3
>> xsup = [-3;5]
xsup =
-3
5
>> x =inv(J(xsup))*gam(xsup)
x =
-1.2053
-0.30415
>> convergio=(abs((xsup-x)./xsup)> convergio=all(abs((xsup-x)./xsup)> xsup´= x
??? xsup´= x
|Error: The input character is not valid in MATLAB statements or expressions.

>> xsup = x
xsup =
-1.2053
-0.30415
>> x=inv(J(xsup))*gam(xsup)
x =
-1.5262
0.83775
>> convergio=all(abs((xsup-x)./xsup)> xsuo = x
xsuo =
-1.5262
0.83775
>> xsup= x
xsup =
-1.52620.83775
>> x= inv(J(xsup))*gam(xsup)
x =
-1.5272
0.87607
>> convergio=all(abs((xsup-x)./xsup)> xsup=x
xsup =
-1.52720.87607
>> x= inv(J(xsup))*gam(xsup)
x =
-1.5237
0.87389
>> convergio=all(abs((xsup-x)./xsup)> f1f2(x)
ans =
5.0518e-005
0.0012386
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • NEWTON
  • newton
  • newton
  • Newton
  • newton
  • Newton
  • newton
  • newton

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS