https://github.com/ganeshsankaran/system-solver-api
A Flask API for solving systems of linear equations with two variables
https://github.com/ganeshsankaran/system-solver-api
api flask python smt z3
Last synced: 7 months ago
JSON representation
A Flask API for solving systems of linear equations with two variables
- Host: GitHub
- URL: https://github.com/ganeshsankaran/system-solver-api
- Owner: ganeshsankaran
- Created: 2019-12-21T17:50:11.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-21T23:03:57.000Z (almost 6 years ago)
- Last Synced: 2025-01-18T18:51:50.789Z (9 months ago)
- Topics: api, flask, python, smt, z3
- Language: Python
- Homepage: https://system-solver-api.herokuapp.com
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# System Solver API
by Ganesh Sankaran
Overview
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.
API Endpoints
GET /api/v1/solve
Request Parameters
-
a_1_1
: a floating point number -
a_1_2
: a floating point number -
a_2_1
: a floating point number -
a_2_2
: a floating point number -
b_1
: a floating point number -
b_2
: a floating point number
Response Parameters
-
x
:null
or a string representing the x-value -
y
:null
or a string representing the y-value -
notes
: a string identifying the type of system