Algorithm For Solving Systems Of Linear Equations

A Member? Please Login  
type your username and password to login
Date: October 08, 2008, 05:19 AM
247354 members and 146326 Topics
Latest Member: issueraexteds
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Algorithm For Solving Systems Of Linear Equations
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Algorithm For Solving Systems Of Linear Equations  (Read 488 views)
Amarao (f)
Algorithm For Solving Systems Of Linear Equations
« on: August 01, 2007, 04:26 PM »

Hello,
Please can anyone assist me in writing an algorithm for solving non-homogenous systems of linear equations of 3 unknowns .

I'll be very grateful because it's part of my project work.

Thanks
Amara
Seun (m)
Re: Algorithm For Solving Systems Of Linear Equations
« #1 on: August 01, 2007, 07:31 PM »

First, you have to know how to solve it manually.  Once you know that, then constructing an algorithm is easy. Wink
luckyCO
Re: Algorithm For Solving Systems Of Linear Equations
« #2 on: August 02, 2007, 10:04 AM »

Please give example of what u are looking I will give you the code in Qbasic. I have a code that solves nth simultenous equation which is capable of finding the values of x,y,z. With this code you don't need to solve simultenous equation. I have it already in Qbasic but if you need it in any other Language like VB,VB.Net,C# then you have to pay for my business time I will develope it and give you within 1 week.

Take care
okunade (m)
Re: Algorithm For Solving Systems Of Linear Equations
« #3 on: August 06, 2007, 03:19 PM »

The algorithm is as follows.


prompt for the coefficient (a for X**2, b for X , and, c for constant).
Find the discriminant D.

D = b**2 - 4.*a*c

IF D == 0 THEN
X has repeated root.
root = - b / 2.*a

ELSE IF D > 0. THEN
X has two distinct roots
root_1 = (- b + SQRT (b**2 - 4*a*c)) / 2.*a
root_2 = (- b -  SQRT (b**2 - 4*a*c)) / 2.*a

ELSE
X has complex root.
root_1 = -b / 2*a + SQRT (D) i / 2*a
root_2 = -b / 2*a  - SQRT (D) i / 2*a

Cheesy Smiley
opensource (m)
Re: Algorithm For Solving Systems Of Linear Equations
« #4 on: August 06, 2007, 11:19 PM »

easy with

C

but truth it you need post the fomular for solving it and viola it can be written in any language even javascript
Seun (m)
Re: Algorithm For Solving Systems Of Linear Equations
« #5 on: August 06, 2007, 11:28 PM »

okunade, the solution you presented is for solving a single quadratic equation.  Not applicable here.
Ghenghis (m)
Re: Algorithm For Solving Systems Of Linear Equations
« #6 on: August 07, 2007, 09:59 AM »

Isn't that Gauss-Seidel /Jacobi's method ?
ishmael (m)
Re: Algorithm For Solving Systems Of Linear Equations
« #7 on: August 08, 2007, 05:16 PM »

Quote from: Ghenghis on August 07, 2007, 09:59 AM
Isn't that Gauss-Seidel /Jacobi's method ?

You went too far. It's the Guassian elimination method (either through backsolving or elementary row operations).

An example of a  non-homogeneous system of linear equation with 3 unknowns is:

2x + 3y - 5z = 2
4x - y + 2z =  6
x  + z -  4z = 4
ishmael (m)
Re: Algorithm For Solving Systems Of Linear Equations
« #8 on: August 14, 2007, 04:39 PM »

i think Gauss-seidel and Jacobi methods are numerical methods of solving linear equations.
Ghenghis (m)
Re: Algorithm For Solving Systems Of Linear Equations
« #9 on: August 15, 2007, 08:44 AM »

@ishmael
Yes you're right, (they are numerical methods of solving linear equations)and i think they're the methods, best suited for the problem.

I developed some C programs when i was in school to solve the exact same thing ,  Its been ages since i've seen the programs ,

The methods are very programmable, as opposed to the plain Gaussian methods ,

I'D recommend the book ,numerical recipes in C, a copy and paste solution should be there
http://www.nr.com/oldverswitcher.html  Grin
Amarao (f)
Re: Algorithm For Solving Systems Of Linear Equations
« #10 on: September 06, 2007, 12:32 PM »

Good day,

I'm sorry I've been away for a while. I saw the replies you gave me as regards my request. Thank you so much I think

I can solve the problem now.

Much thanks,

Amara
AhmedGuru (m)
Re: Algorithm For Solving Systems Of Linear Equations
« #11 on: September 14, 2007, 09:28 AM »

you can either use numerical solution or matix method to solve the probelm. But whichever method you choose, you can solve the problem by examinig how to solve the problem with pen and paper first. Then you can formulate the algorithm. Or better still, you can check numerical methods texts. Most Numerical method text feature algoriths.
ishmael (m)
Re: Algorithm For Solving Systems Of Linear Equations
« #12 on: September 17, 2007, 07:10 PM »

Quote from: AhmedGuru on September 14, 2007, 09:28 AM
you can either use numerical solution or matix method to solve the probelm. But whichever method you choose, you can solve the problem by examinig how to solve the problem with pen and paper first. Then you can formulate the algorithm. Or better still, you can check numerical methods texts. Most Numerical method text feature algoriths.


You are correct. You need to know how to solve a problem using pen and paper first before you can write out a good algorithm as well as a good program.
 Good Books On Php, Mysql,asp.net,jsl Needed For Purchase  Cost Of Software Enterpreneurship Programme?  Great Work guys  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 
Google
 
Web www.nairaland.com
Sections: TV/Movies (2) Music/Radio (2) Celebrities Job Talk Jobs/Vacancies (2) Career Talk Romance Books Politics Sports Fashion Travel
Health Schooling Religion General(2) Business Webmaster Programming Computers Phones Cars & Trucks

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.