An open API service indexing awesome lists of open source software.

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

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