This program takes a linear equation system and solves for all unknown variables.
Let's say you need to solve the given linear equation system:
2x + 4y = 10
x + y = 4
After directing to the directory where the program is stored, simply run the program using the command python main.py
.
This brings up the following line:
python main.py
How many unknowns are you looking for?
In our case, we have two unknwons (x & y).
python main.py
How many unknowns are you looking for? 2
Then, you will have to input the factors of you unknowns.
python main.py
How many unknowns are you looking for? 2
a1*x + b1*y = c1
a2*x + b2*y = c3
Enter value for factor a1: 2
Enter value for factor b1: 4
Enter value for solution c1: 10
Enter value for factor a2: 1
Enter value for factor b2: 1
Enter value for solution c2: 4
The solutions are x=3.0; y=1.0.
After entering the last parameter, you will get the solution.
python main.py
How many unknowns are you looking for? 2
a1*x + b1*y = c1
a2*x + b2*y = c3
Enter value for factor a1: 2
Enter value for factor b1: 4
Enter value for solution c1: 10
Enter value for factor a2: 1
Enter value for factor b2: 1
Enter value for solution c2: 4
The solutions are x=3.0; y=1.0.