Starting with:
- \$0 in savings and \$50000 in debt
- the savings earns 2.5% interest and the debt loses 5% interest yearly
- you gain \$2000 of income each month to distribute among either savings or debt (fully committed to either so there is \$0 in cash at the end of the month)
the minimum debt payment each month is \$200
What is the optimal percent contribution of the \$2000 to savings and paying off debt each month assuming the goal is to maximize net worth in 120 months?
What is the solution for arbitrary interest rates/income levels/starting balances/time periods/minimum payments? Would it require a numerical solver?
Does maximizing short term net worth (picking a percentage each month that maximizes your net worth for that particular month) lead to a poor global solution (net worth at the end of N months)?
EDIT: Assume interest for both debt and savings is compounded monthly at the end of the month, and the income is received and immediately paid towards one and/or the other at the 1st of the month.
It is as simple as get the best interest rate you can. Paying down debt earns $5\%$ while savings only pays $2.5\%$. Both are compounded monthly.
The real life thing your model does not capture is the value of liquidity. If you put all the money toward reducing debt and do not have any savings, a bad event may force you to borrow at higher than $5\%$ or not be able to borrow at all. Keeping a reserve fund in savings costs you net worth in the model, but is insurance against disaster.