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
SolvingStep
class for tracking solution progress - Features
InteractiveVisualizer
for animated solution presentation - Includes annotation system for detailed mathematical explanations
- 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
- 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
DirectSolver
for 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.txt
Run the main application:
python main.py
Or use the direct solver version:
python m5.py
For 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 = c
Example:2x + 3 = 10
-
Quadratic equations:
ax² + bx + c = 0
Example: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