by Ganesh Sankaran
This Flask API provides an endpoint to solve systems of linear equations with two variables using the Z3 SMT solver.
An example of such a system is
{3x + 2y = 6, x - 4y = 5}
, whose unique solution is (x, y) = (17/7, -9/14)
.
In general, these systems are of the form
{a_1_1 * x + a_1_2 * y = b_1, a_2_1 * x + a_2_2 * y = b_2}
and can be
- inconsistent systems (no solution)
- independent systems (unique solution)
- dependent systems (infinitely many solutions)
This API identifies the type of system and provides a solution if the system is independent.
GET /api/v1/solve
Request Parameters
a_1_1
: a floating point numbera_1_2
: a floating point numbera_2_1
: a floating point numbera_2_2
: a floating point numberb_1
: a floating point numberb_2
: a floating point number
Response Parameters
x
:null
or a string representing the x-valuey
:null
or a string representing the y-valuenotes
: a string identifying the type of system