in reply to minimizing simple linear equations
That's not exactly a trivial task. If you have something like Mathematica or Maple you could open a pipe to that and let it do the heavy lifting.