Edit: I reworded the entire question into an example to make it easier to understand
John wants to buy a house. He has €30,000 saved up for a deposit $(D)$ and he know's he can afford to pay €1,200 a month on mortgage repayments $(P)$ and he knows that he wants a mortgage which is 25 years (300 months) long $(N=300)$
He goes to his bank manager and asks what mortgage rate he can get. Bank manager says 'well it depends on what proportion of the total cost of the house $(C)$ that you buy that your deposit represents. If it's between 1% and 15% of $C$ then I'll give you a rate $(R_1)$ of 5%, however if it's between 15% and 50% of $C$, I'll give you a rate of 4% $(R_2)$'.
Now John needs to work out the price for the most expensive house he can afford to buy $ie. C$.
Forst John tries to work out the effective rate $(i)$ he can get but since the rate he can get $(R)$ depends on the cost of the house he buys, which is unknown, the best he can do is $i=\frac{100R}{n}$ where $n=$ the number of payments in a year $(12)$ since $R_1$ and $R_2$ are given in annual terms.
But now Johns equation for the largest mortgage he can afford \begin{equation} A=\frac{P}{i}[(1-(1+i)^{-N})] \end{equation}
has 2 variables and he can't solve it. How does John solve this equation?
End Edit Original question text. Can probably be ignored if you're new to the question.
Finding the principal given the three terms - rate, monthly payment and term length is easy using
\begin{equation} A=\frac{P}{i}[(1-(1+i)^{-N})] \end{equation} where:
$A=$ Principal,
$P=$ Monthly Payment,
$N=$ total number of payments,
$i=$ effective rate. ie. i=100rate/12
The question is, what happens when the interest rate varies with the deposit? Usually banks will offer a lower interest rate to people who front a large percentage of the principal themselves. So someone who puts up 10% of the principal will have to pay a higher interest rate than someone who puts up 50%.
This messes up the equation though because we don't know the interest rate until we figure out the proportion of the principal that the borrowers deposit represents but we can't figure that out until we calculate the interest rate.
What I've been trying to do is just assume that the supplied dollar deposit amount (say 30,000 dollars) is 10% of the principal. Lookup the rate associated with a 10% deposit (say 3.75% therefore i=0.003125) and use this to calculate a dollar amount for principal (this will be 233,403 dollars given that the monthly payment is 1200 dollars).
So now assuming that this figure for principal is 90% of the total (principal + deposit) and the borrowers deposit makes up 10% I can tell that my initial guess of 10% was wrong because $\frac{A}{.9} != 30,000+A$
Is there a single method or technique I can use to iteratively move towards the right guess for deposit percentage?