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.
- 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
- Contains the core visualization system with step-by-step solution display
- Implements
SolvingStepclass for tracking solution progress - Features
InteractiveVisualizerfor animated solution presentation - Includes annotation system for detailed mathematical explanations
- Implements ML-based equation solver with PyTorch
- Contains
EquationEncoderfor converting equations to tensor format - Features
EquationClassifierfor determining equation types - Includes
MLMathSolvercombining ML and traditional solving methods - Basic visualization implementation
- Enhanced version of m3.py with improved model loading
- More robust error handling
- Refined visualization features
- Includes better formatting for solution display
- Implements pure algebraic solving methods
- Contains
DirectSolverfor analytical solutions - Features streamlined visualization interface
- Improved graph plotting with solution indicators
- Final version combining ML and direct solving approaches
- Enhanced error handling and user feedback
- Improved visualization system
- Comprehensive equation parsing and solving
torch
torch_geometric
matplotlib
numpy
networkx
- Clone the repository:
git clone https://github.com/[username]/math-equation-solver.git
cd math-equation-solver- Install dependencies:
pip install -r requirements.txtRun the main application:
python main.pyOr use the direct solver version:
python m5.pyFor the ML-enhanced version:
python m6.py- Enter your equation in the text box at the bottom of the window
- Click "Solve" or press Enter
- View the:
- Equation representation
- Graph visualization
- Solution(s)
- Step-by-step solution process (in main.py version)
The solver accepts equations in the following formats:
-
Linear equations:
ax + b = cExample:2x + 3 = 10 -
Quadratic equations:
ax² + bx + c = 0Example:2x^2 + 3x + 1 = 0
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- PyTorch team for the deep learning framework
- Matplotlib team for visualization capabilities
- NetworkX team for graph operations