I don't think this is the appropriate thread to answer this question. Not to mention the complexity involved (in the question and the answer). However, here is just a few thoughts:
First, take a look at the original statement. "optimize every 10 days."
Problem one, once you begin to...