0% found this document useful (0 votes)
37 views

Simultaneous Non-Linear Equation

This document uses Gauss-Jordan elimination to solve a system of simultaneous equations. It extracts coefficients from the equation matrices, deconvolves them, and performs Gauss-Jordan elimination on the results. It then calculates the solution sets for x and y and displays them.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Simultaneous Non-Linear Equation

This document uses Gauss-Jordan elimination to solve a system of simultaneous equations. It extracts coefficients from the equation matrices, deconvolves them, and performs Gauss-Jordan elimination on the results. It then calculates the solution sets for x and y and displays them.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

%%

clc;
clear all;
close all;
A = [4 3 -4 -3;2 -1 -2 1];
b = [19; 7];
[x A] = gauss_jordan(A,b);
a1 = A(1,:);
h = 1;
for n = 2:2:length(a1)-1
a2(h) = A(2,n);
h = h + 1;
end
a2(1,length(a2)+1) = 0;
a3 = deconv(a1,a2);
a3(1,length(a3)) = A(1,length(A(1,:)))/A(2,length(A(2,:)));
a2(1,length(a2)) = A(2,length(A(2,:)));
% A_ = [[a2(1,1:length(a2)-1);a3(1,1:length(a3)-1)]];
[x A] = gauss_jordan([a2(1,1:length(a2)-1);a3(1,1:length(a3)-
1)],[a2(1,length(a2));a3(1,length(a3))]);
X_ = sqrt(x(1,:));
y_ = x(2);
for n = 1:length(X_)
x(n) = X_(n);
x(n+1) = -X_(n);
y(n,1) = y_(n,1);
y(n+1,1) = y_(n,1);
end
disp(['Solution set:']);
disp(['x = ' num2str(x')])
disp(['y = ' num2str(y')])
%%

Used Function:

Gauss jordan Elimination


Created to solve simultaneous equations;
This is of the form: [X, A] = GAUSSS_JORDAN(a,b)
b is a column matrix
here, it returns a column matrix of
solution(if exist. Otherwise, “error message”) for the system and
the Reduced row echelon form of the augmented matrix is returned as 'A'.

You might also like