Skip to content

Instantly share code, notes, and snippets.

View superMDguy's full-sized avatar

Matthew Dangerfield superMDguy

View GitHub Profile
@superMDguy
superMDguy / solve3x3.py
Last active February 6, 2017 19:12
Solving 3x3 systems of equations using Gaussian Elimination
'''Using Gaussian Elimination Method to solve 3x3 systems of equations.
We'll use numpy arrays to store and manipulate the equations. For a video demonstrating the process,
I found https://youtu.be/Dj84vEb4Zko to be helpful.
'''
import numpy as np
A = np.zeros((3, 3)) #This will store the coefficients of the variables as a 3x3 numpy array
x = np.zeros((3, 1)) #This stores the values of the variables as a 3x1 numpy array
b = np.zeros((3, 1)) #This will store what the equations are equal to as a 3x1 numpy array