|
Amarao (f)
|
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)
|
First, you have to know how to solve it manually. Once you know that, then constructing an algorithm is easy. 
|
|
|
|
|
|
luckyCO
|
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)
|
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 
|
|
|
|
|
|
opensource (m)
|
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)
|
okunade, the solution you presented is for solving a single quadratic equation. Not applicable here.
|
|
|
|
|
|
Ghenghis (m)
|
Isn't that Gauss-Seidel /Jacobi's method ?
|
|
|
|
|
|
ishmael (m)
|
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)
|
i think Gauss-seidel and Jacobi methods are numerical methods of solving linear equations.
|
|
|
|
|
|
Ghenghis (m)
|
@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 
|
|
|
|
|
|
Amarao (f)
|
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)
|
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)
|
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.
|
|
|
|
|
|