Machine Problem 8
Machine Problem 8
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
E = 1; % Error of 1 percent
err1 = 100;
xna = 1.5;
xnb = 1.5;
i = 0;
while err1>=E
xa = xna;
xb = xnb;
xna = x1 + xna;
xnb = x2 + xnb;