Skip to main content
1-Visitor
July 13, 2017
Question

Gaussian Elimination for a system of equations

  • July 13, 2017
  • 3 replies
  • 12064 views

Hello guys,

I'm new into Mathcad Prime and this community, so please bear with me.

I'm trying to make a template to solve systems of linear equations with the Gaussion Elimination method.

I would like to know, if anyone in this community has a template to solve any kind equation systems with Gaussian Elimination?

I have attached a file with a system of equations, that I would like to solve with such template.

Thank you!

PS: I use Mathcad Prime 3.1

Udklip.JPG

3 replies

25-Diamond I
July 13, 2017

I have attached a file

No, you didn't. All we see is the picture. At the time being you are not allowed to attach Mathcad or Prime files directly - you have to put them in an archive first (zip, rar, ..)

 

So you are not interested in the simple solution of such system, right? There would be a lot of different ways you could achieve that in Mathcad. You want Mathcad to show you step by step how to do it manually using the Gauß algorithm, right?

Mathcad is not made for showing you the calculation steps but rather will give you the final result only. I gues with some programming it would be possible to achieve what you are looking for, but then - why? There are websites which will do exctly that, no need to reinvent the wheel, I guess. E.g. a German one is http://www.arndt-bruenner.de/mathe/scripts/gleichungssysteme.htm A possible outout of that site is in the attached file.

 

Gilgamesh1-VisitorAuthor
1-Visitor
July 13, 2017

Thank you for your answer. Let me clarify my request with the following simple example: In the attached picture, I have set up a template to solve a system of linear equations with Cramers Rule. I can fill the matrice, and the results pops up, but the important thing is, that it shows the steps necessary to calculate the the solution.

 

I had something similar in mind for solving systems of linear equations with Gaussion Elimination, but I couldn't establish a general rule to solve them that way.

I hope that clarifies it.Udklip22.JPG

25-Diamond I
July 13, 2017

I already guessed that you would like a sheet which shows you the single steps of the Guaß solution as on the web page I linked you to.

It would require some programming to generate the various matrices until you arrive at the upper triangular matrix.

You would have to decide which variant of Gauß you'd like to use (with or without pivoting, Gauß-Jordan, ..) and also find a way to deal with systems which don't have a unique solution (either no solution at all or an infinite number of solutions depending on one ore more parameters).

So this would be quite some work and I doubt that anybody here would be willing to this for you. But if you want to give it a try and experience problems you sure will find a helpful hand here.

 

Your Cramer sheet (better: the pic you posted) does in no way show the calculation steps necessary. We son't see the determinant filled with numbers, we dont see the values of the determiants. All we see is the method how to calculate the results using determinants. Furthermore your sheet will work only with 3 equations in 3 variables and will throw an error if the solution is not uniqe (determinant of coefficients = 0) without distinguishing between the two different cases whoch can lead to that error.

Gauß is not a method that rigid as Cramer - the single steps would depend on the concrete values used. Especially when you implement pivoting. Thats why programming will be required.

 

BTW - whats the reason for your wish to have that kind of sheet. What will the purpose of it be?

 

25-Diamond I
July 13, 2017

In case you don't know how to solve linear (and also non-linear) systems in Prime, here are four ways to solve your system:

GLS.png

Prime file (format 3.0, you should be able to open in with P31) is attached.

1-Visitor
December 20, 2024

¡Hola! He leído tu inconveniente, creo que puedo ayudarte con tu duda. He programado en MatchCad el algoritmo del método de solución de Gauss y el de Gauss-Jordan. Si bien es cierto no podrás ver el paso a paso, podrás entender qué operaciones se realizan en los bucles y a qué partes de la matriz afecta. Si tienes dudas al respecto, puedes escribirme.

25-Diamond I
December 20, 2024

So you are hoping and praying  that no diagonal element in the coefficient  matrix is zero? 😉

1-Visitor
December 21, 2024

Tienes toda la razón. Gracias por hacerme ver el error. Aquí está el código modificado para evitar ese error. Si encuentran otro tipo de inconsistencia, hágalo saber para poder mejorar.