so there's this thing called fminsearch in matlab, which allows you to just give it an expression, and it will try to minimize, and you give it some initial values, to try to say, hey, try these and then go find me a minimum solution.