I'm pretty new in coding and I'm trying to learn it for application in finance.
I should to find the r variable in this equation that I'm sharing. Can someone help me?
Basically I have one cashflow that I invest now with a negative sign in front of it, and a sequence of positive cashflow that I'll receive in n years in future. I have to discount to the present each cashflow with r as a variable, and the total sum between this negative cashflow in year 0 and the others in year 1, 2, 3 etc discounted at the year 0 has to bring 0. Plus, the last positive cashflow, I assume that grows forever at a certain growth rate.
I use this code (second image) to tell the computer to find me the r variable, but I don't know hot to write the last cashflow growing forever.
Can someone help me?
You will probably obtain the most expressive calculation using
sympy
ssolve()
.