I've found the picture below, which demonstrates at which RUB/USD exchange rate mortgage in rubles is less expensive, then mortgage in dollars (i.e. when refinancing of dollar mortgage to ruble mortgage should be done).
The vertical axe demonstrates RUB/USD exchange rates from 28 rubles for 1 dollar to 57 (at the moment when the mortgage has been taken). The horizontal axe shows dollar mortgage interest rate from 6% to 11%. The assumption made here is that ruble mortgage interest rate is 13% and the mortgage term is 15 years.
What is the formula used there? I would like to re-calculate it for different (1) exchange rate, (2) term.