Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,239 members, 7,818,814 topics. Date: Monday, 06 May 2024 at 05:30 AM

Algorithm For Solving Systems Of Linear Equations - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Algorithm For Solving Systems Of Linear Equations (6771 Views)

Algorithm For Pascal Program / Solution Of Linear Programming Problems Using Simplex Method / Pls Help! A Program That Would Solve A System Of Linear Equations (2) (3) (4)

(1) (Reply) (Go Down)

Algorithm For Solving Systems Of Linear Equations by Amarao(f): 4:26pm On Aug 01, 2007
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
Re: Algorithm For Solving Systems Of Linear Equations by Seun(m): 7:31pm On Aug 01, 2007
First, you have to know how to solve it manually. Once you know that, then constructing an algorithm is easy. wink
Re: Algorithm For Solving Systems Of Linear Equations by luckyCO(m): 10:04am On Aug 02, 2007
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 dont 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
Re: Algorithm For Solving Systems Of Linear Equations by okunade(m): 3:19pm On Aug 06, 2007
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
Re: Algorithm For Solving Systems Of Linear Equations by opensource(m): 11:19pm On Aug 06, 2007
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
Re: Algorithm For Solving Systems Of Linear Equations by Seun(m): 11:28pm On Aug 06, 2007
okunade, the solution you presented is for solving a single quadratic equation. Not applicable here.
Re: Algorithm For Solving Systems Of Linear Equations by Ghenghis(m): 9:59am On Aug 07, 2007
Isn't that Gauss-Seidel /Jacobi's method ?
Re: Algorithm For Solving Systems Of Linear Equations by ishmael(m): 5:16pm On Aug 08, 2007
Ghenghis:

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
Re: Algorithm For Solving Systems Of Linear Equations by ishmael(m): 4:39pm On Aug 14, 2007
i think Gauss-seidel and Jacobi methods are numerical methods of solving linear equations.
Re: Algorithm For Solving Systems Of Linear Equations by Ghenghis(m): 8:44am On Aug 15, 2007
@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
Re: Algorithm For Solving Systems Of Linear Equations by Amarao(f): 12:32pm On Sep 06, 2007
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
Re: Algorithm For Solving Systems Of Linear Equations by AhmedGuru(m): 9:28am On Sep 14, 2007
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.
Re: Algorithm For Solving Systems Of Linear Equations by ishmael(m): 7:10pm On Sep 17, 2007
AhmedGuru:

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.
Re: Algorithm For Solving Systems Of Linear Equations by kanishk: 7:09am On Sep 30, 2011
Yes you surely need to know solving system of equations on pen and paper before writing your code .

If you need some assistance on doing it you can check the link below

http://math.tutorvista.com/algebra/solving-systems-of-equations.html
Re: Algorithm For Solving Systems Of Linear Equations by jhonydeap: 8:34am On Nov 02, 2011
in system-of-equations algorithm can be used to  solve system  of linear equation that are  be solved by linearly and flow of  equation  in same  path and root lies  between  positive and nagitive.
http://math.tutorvista.com/algebra/system-of-equations.html
Re: Algorithm For Solving Systems Of Linear Equations by geeknick: 5:54am On Nov 16, 2011
I'm fairly sure I have worked this out correctly but before I commit it to certain knowledge, I want someone to cite that I got the answer right to solve this linear equation

2x/3 - 4x/5 = 7/9

I got X= 5 5/6

Sorry if this is a bit trivial but I just couldn't find another way to find the answer to the equation I was set at uni.

Thank you

(1) (Reply)

What PHP Cms/framework Do You Use And Why? / Game Programming Tutorials ( Angry Birds, Pvz Etc ) / How To Design School Result Sheet Automated System With Microsoft Excel

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 23
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.