This implements all matrix forming operations into the program, as well as forming the initial conditions.