Geronimo is a software that solves systems of linear equations.
I used 3 methods to solve systems os linear equations, which are:
Method name | Description |
---|---|
AddDimension | Add system dimension. Corresponds to the number of variables in the equations. |
AddEquation | Add an equation to the system. The construction of a LinearEquation always demands the number of variables in your system (dimension) plus one parameters. Example: x + 2y - 3z = 42 -> This equation has 3 variables, thus it shall be part of a system with 3 equations. The construction should be new LinearEquation(1, 2, -3, 42) . |
AddErrorRate | Add error rate. The smaller, the more accurate the result. |
IsRound | Whether the result should be rounded [in a specified number of decimal places] or not. |
The examples below expects the following result:
x = 1
y = -1
z = 1
LinearSystemResult result = new JacobiMethod()
.AddDimension(3) // Make sure of defining this before set any equation
.AddEquation(new LinearEquation(10, 2, -1, 7))
.AddEquation(new LinearEquation(1, 8, 3, -4))
.AddEquation(new LinearEquation(-2, -1, 10, 9))
.AddErrorRate(0.000000000001)
.IsRound(10)
.SolveIt();
// It'll format the result :-)
Console.WriteLine(result.ToString());
LinearSystemResult result = new GaussSeidelMethod()
.AddDimension(3) // Make sure of defining this before set any equation
.AddEquation(new LinearEquation(10, 2, -1, 7))
.AddEquation(new LinearEquation(1, 8, 3, -4))
.AddEquation(new LinearEquation(-2, -1, 10, 9))
.AddErrorRate(0.000000000001)
.IsRound(10)
.SolveIt();
// It'll format the result :-)
Console.WriteLine(result.ToString());
LinearSystemResult result = new GaussJordanMethod()
.AddDimension(3) // Make sure of defining this before set any equation
.AddEquation(new LinearEquation(10, 2, -1, 7))
.AddEquation(new LinearEquation(1, 8, 3, -4))
.AddEquation(new LinearEquation(-2, -1, 10, 9))
.AddErrorRate(0.000000000001)
.IsRound(10)
.SolveIt();
// It'll format the result :-)
Console.WriteLine(result.ToString());