0% found this document useful (0 votes)
30 views3 pages

Método de Newton - Raphson

The document describes several numerical methods for solving equations including: 1) Newton-Raphson method for finding roots of functions iteratively; 2) False position method for bracketing roots of functions; 3) Using the roots and polyval functions to find roots of polynomials. 4) Gaussian elimination, LU decomposition, Jacobi, and inverse matrix methods for solving systems of linear and nonlinear equations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views3 pages

Método de Newton - Raphson

The document describes several numerical methods for solving equations including: 1) Newton-Raphson method for finding roots of functions iteratively; 2) False position method for bracketing roots of functions; 3) Using the roots and polyval functions to find roots of polynomials. 4) Gaussian elimination, LU decomposition, Jacobi, and inverse matrix methods for solving systems of linear and nonlinear equations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Método de Newton – Raphson

>> f=’funcion’;

>> ezplot(f,[ ]);grid on

>> x=xo

>> x=x-eval(f)/eval(diff(sym(f),’x’))

Método de Falsa Posición

>> f=’funcion’;

>> ezplot(f,[ ]);grid on

>> xa= ; fa=subs(f,xa);

>> xb= ; fb=subs(f,xb);

>> xp=(xa*fb-xb*fa)/(fb-fa);

>> x=xp; fb=eval(f);

>> if fa*fb<0

Xb=xp;

Else

Xa=xp;

End

>> doublé(xp)

((Repetir hasta que salgan iguales))

Raíces de polinomios

>> p=[ ];

>> x=roots(p)

>> p1=polyval(p,x)

>> polyval(p,[x0,x1,x2…..xn])

Sistema de ecuaciones no lineales

>> u=’funcion’;

>> v=’funcion’;

>> ux=diff(sym(u),’x’);

>> ux=diff(sym(u),’x’); uy=diff(sym(u),’y’);

>> vx=diff(sym(v),’x’); vy=diff(sym(v),’y’);

>> x=1; y=1;


>> x=x-(eval(u)*eval(vy)-eval(v)*eval(uy))/(eval(ux)*eval(vy)-eval(uy)*eval(vx)), y=y-
(eval(v)*eval(ux)-eval(u)*eval(vx))/(eval(ux)*eval(vy)-eval(uy)*eval(vx))

Solve

>> [a,u,v]=solve(‘funcion’,’funcion’,’funcion’);

>> a=double(a)

>> u=double(u)

>> v=double(v)

Metodo de reducción

>> A=[ ]; b=[ ; ; ]; M=[A b]

>> M=[M(2,: );M(1,: );M(3,: )]

>> M(2,: )=M(2,: )-M(1,: )*M(2,1)/M(1,1);

>> M(3,: )=M(3,: )-M(1,: )*M(3,1)/M(1,1)

>> M(3,: )=M(3,: )-M(2,: )*M(3,2)/M(2,2)

>> z=M(3,4)/M(3,3)

>> y=(M(2,4)-M(2,3)*z)/M(2,2)

>> X=(M(1,4)-M(1,3)*z-m(1,2)*y)/M(1,1)

>> x=linsolve(A,b)

%Metodo de Gauss Jourdan

>> x=rref(M)

>> X=inv(A)*b

Metodo de tranformación LU

>>A=[ ]; b=[ ; ;];

>> [L U]=lu(A)

>> d=inv(L)*b

>> d=L\b

>> X=inv(U)*d

>> x=linsolve(A,b)

Método de Jacobi

>> A=[ ]; b=[ ; ; ]; x=[1;1;1];

>> Ti=tril(A,-1)

>> Ts=triu(A,1)
>> D=diag(diag(A))

>> x=inv(D)*(b-(Ti+Ts)*x)

((repetir hasta que los valores salgan iguales))

>> x=inv(A)*b

>> x=linsolve(A,b)

>> M=[A b];

>> x=rref(M)

Todos los métodos

>> A=[ ]; b=[ ; ; ]; x=[1;1;1];

>>Ti=tril(A,-1); Ts=triu(A,1); d=diag(diag(A));

>> x=inv(d+Ti)*(b-Ts*x)

((Repetir hasta que salgan iguales))

>> x=inv(D)*(b-(Ti+Ts)*x)

((Repetir hasta que salgan iguales))

>> det(A)

>> x=inv(A)*b

>> x=linsolve(A,b)

>> M=[A b]; x=rref(M)

Polinomios de Lagrange

>>y=expan(sym(‘(x-x2)*(x-x3)*(x-x4)*y1/((x1-x2)*(x1-x3)*(x1-x4))+(x-x1)*(x-x3)*(x-x4)*y2/((x2-
x1)*(x2-x3)*(x2-x4))+(x-x2)*(x-x1)*(x-x4)*y3/((x3-x2)*(x3-x1)*(x3-x4))+(x-x2)*(x-x3)*(x-x1)*y4/
((x4-x2)*(x4-x3)*(x4-x1))’))

>>y1=subs(y,[ , , ])

>>x=[x1 x2 x3 x4]; y=[y1 y2 y3 y4];

>>y=polyfit(x,y,3)

>>y1=polyval(y,[ , , ])

You might also like