Financial, Multiple Compound Interest Problem

DKATyler

I am currently attempting to solve the following problem for a calculator I am constructing in Java.
Company 1 pays A% Interest every T days
Company 2 pays B% Interest (>A%) every T days

Company 1 has an initial investment of $X dollars Company 2 requires an inital fee of$Y dollars to invest in their company ($Y does not pay any interest! It's a fee.) At what point T in terms of A, B, X and Y should I stop investing in Company 1 and begin investing in Company 2 to obtain the maximum return at T=infinity? Investments are non-refundable. Example:$1,000 invested in A at 3% interest
B pays 8% interest
B requires a $1,000 fee to invest. By brute force calculation, the optimum T value is approx 16 for this example. ($1604.71 invested in Company 1). This results in the first interest earning investment in B at T=39. (Only slightly later then T=0 with \$1000 in company where the first interest earning payment would be made at T=36).

fresh_42

Mentor
2018 Award
This is a linear optimization and the simplex algorithm should do. However, if $T$ tends to infinity, there will never occur a ROI.

"Financial, Multiple Compound Interest Problem"

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving