0% found this document useful (0 votes)
3 views5 pages

Machine Problem 8

The document outlines a MATLAB implementation of the Newton Raphson method for solving systems of nonlinear algebraic equations, specifically using a Jacobian matrix. It includes the equations to be solved, initial guesses, and the iterative process to find the solution while tracking errors. The results of the iterations are printed, showing the convergence of the method.

Uploaded by

Krissan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

Machine Problem 8

The document outlines a MATLAB implementation of the Newton Raphson method for solving systems of nonlinear algebraic equations, specifically using a Jacobian matrix. It includes the equations to be solved, initial guesses, and the iterative process to find the solution while tracking errors. The results of the iterations are printed, showing the convergence of the method.

Uploaded by

Krissan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

MACHINE PROBLEM 8

Name: Laride, Krissan G. Date Submitted: November 25, 2024

Course & Yr: BSEE-4 Date Performed: November 15, 2024

ITERATIVE METHODS ( SYSTEMS OF NON-LINEAR ALGEBRAIC EQUATIONS)

1. Make an M – FILE for NEWTON RAPHSON (Jacobian matrix) METHOD using MATLAB.
%Krissan G. Laride
%NEWTON RAPHSON METHOD
%JACOBIAN MATRIX
% Determine the solution of the simultaneous nonlinear equations
% y = -x^2 + x + 0.5
% y + 5xy = x^2
%changed the variable x to xa, and y to xb
% xb = -xa^2 + xa + 0.5
% xb + 5xa*xb = xa^2
%Use the Newton Raphson method and employ initial guesses of xao = xbo =
%1.5

clc
clear all
syms xa
syms xb

f1 = inline ('xa^2 - xa + xb', 'xa', 'xb');


y1 = 0.5;

f2 = inline ('xa^2 - xb -5*xa*xb','xa', 'xb');


y2 = 0;

Aa =inline (diff(f1(xa,xb),xa), 'xa','xb');


Ab =inline (diff(f1(xa,xb),xb), 'xa','xb');

Ba =inline (diff(f2(xa,xb),xa), 'xa','xb');


Bb =inline (diff(f2(xa,xb),xb), 'xa','xb');

E = 1; % Error of 1 percent
err1 = 100;
xna = 1.5;
xnb = 1.5;
i = 0;

fprintf('\n NEWTON RAPHSON METHOD\n')


fprintf('\n JACOBIAN MATRIX \n\n')

fprintf('\nIteration \t\t\tx \t\t\tError(%%) \t\t\ty


\t\t\tError(%%)\n')

while err1>=E

xa = xna;
xb = xnb;

A = [Aa(xa,xb) Ab(xa,xb) ; Ba(xa,xb) Bb(xa,xb)];


b = [ y1 - f1(xa,xb) ; y2 - f2(xa,xb)];
x = inv(A) * b;
x1 = x(1);
x2 = x(2);

xna = x1 + xna;
xnb = x2 + xnb;

err1 = abs((xna - xa)/xna)*100;


err2 = abs((xnb - xb)/xnb)*100;
i = i + 1;

fprintf('\n%5d \t\t%5f \t\t%5f \t\t%5f \t\t%5f\n', i,


xna, err1, xnb, err1)
end
RESULTS

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy