Skip to content

ragini-kalvade/MathSolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mathematical Equation Solver

A Python-based interactive tool for solving and visualizing linear and quadratic equations using both traditional algebraic methods and machine learning approaches. The project combines direct mathematical solving with neural network predictions, providing an educational visualization interface for understanding equation solutions.

Features

  • Solves linear equations (ax + b = c)
  • Solves quadratic equations (ax² + bx + c = 0)
  • Interactive visualization of equations and their solutions
  • Real-time graphing of equations
  • Step-by-step solution visualization
  • Support for both direct algebraic solving and ML-based predictions

Project Structure

main.py

  • Contains the core visualization system with step-by-step solution display
  • Implements SolvingStep class for tracking solution progress
  • Features InteractiveVisualizer for animated solution presentation
  • Includes annotation system for detailed mathematical explanations

m3.py

  • Implements ML-based equation solver with PyTorch
  • Contains EquationEncoder for converting equations to tensor format
  • Features EquationClassifier for determining equation types
  • Includes MLMathSolver combining ML and traditional solving methods
  • Basic visualization implementation

m4.py

  • Enhanced version of m3.py with improved model loading
  • More robust error handling
  • Refined visualization features
  • Includes better formatting for solution display

m5.py

  • Implements pure algebraic solving methods
  • Contains DirectSolver for analytical solutions
  • Features streamlined visualization interface
  • Improved graph plotting with solution indicators

m6.py

  • Final version combining ML and direct solving approaches
  • Enhanced error handling and user feedback
  • Improved visualization system
  • Comprehensive equation parsing and solving

Requirements

torch
torch_geometric
matplotlib
numpy
networkx

Installation

  1. Clone the repository:
git clone https://github.com/[username]/math-equation-solver.git
cd math-equation-solver
  1. Install dependencies:
pip install -r requirements.txt

Usage

Run the main application:

python main.py

Or use the direct solver version:

python m5.py

For the ML-enhanced version:

python m6.py

Interactive Interface

  1. Enter your equation in the text box at the bottom of the window
  2. Click "Solve" or press Enter
  3. View the:
    • Equation representation
    • Graph visualization
    • Solution(s)
    • Step-by-step solution process (in main.py version)

Input Format

The solver accepts equations in the following formats:

  • Linear equations: ax + b = c Example: 2x + 3 = 10

  • Quadratic equations: ax² + bx + c = 0 Example: 2x^2 + 3x + 1 = 0

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • PyTorch team for the deep learning framework
  • Matplotlib team for visualization capabilities
  • NetworkX team for graph operations

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages