| Did you know ... | Search Documentation: |
| Pack starlog -- PARAMETRIC_SYSTEM_SOLUTION.md |
Solve the system parametrically:
2x₁ + 0x₂ + 3x₃ = 2 3x₁ + 0x₂ + 0x₃ = 1 0x₁ + 0x₂ + 2.25x₃ = 1
Expected infinite solutions: (x₁, x₂, x₃) = (1/3, t, 4/9) where t is a free parameter.
This system has infinite solutions because variable x₂ has a zero coefficient in all three equations, making it a free parameter.
From the equations:
→ x₁ = 1/3` → x₃ = 1/2.25 = 4/9`The solution was implemented by:
demo_parametric_system.pl: A demonstration file that shows how to solve this specific parametric system and verifies the solution.gaussian_elimination.pl: Improved the detect_solution_type/3 predicate to correctly identify infinite solutions when variables lack pivots (leading coefficients):
test_parametric_system to tests/test_gaussian_elimination.pl to verify the solution.GAUSSIAN_ELIMINATION.mdGAUSSIAN_QUICK_REF.md:- use_module(gaussian_elimination). ?- solve_system([[2, 0, 3, 2], [3, 0, 0, 1], [0, 0, 2.25, 1]], Solution, Type). Type = infinite, Solution = [0.3333333333333333, _FreeVar, 0.4444444444444445].
The solution shows:
x₂ = _FreeVar (unbound variable representing free parameter t)
Running demo_parametric_system.pl:
swipl -s demo_parametric_system.pl
Output confirms:
infinite(1/3, t, 4/9)The main improvement was fixing the solution type detection algorithm:
Before: Counted non-zero rows vs number of variables