Well, you are absolutely right that you would perform a separate calculation for each rate, and for the portion of the principal that that particular rate applies to. So if these are APRs, then you would have, for one payment toward 16,750:
Code:
Interest = (5,000 Ã (0.055 / 12))
+ (5,000 Ã (0.065 / 12))
+ (5,000 Ã (0.075 / 12))
+ (1,750 Ã (0.085 / 12))
or 93.65. If you want to calculate future payment, and so on, you might have to write a function yourself that slogs through all this. The amortization formulae are not designed for something this complex. All of them work with one principal, not a variety of them at differing departure points.