How might I solve for the roots of an equation of the following form numerically in R:
f(r)=r*c+1-B*c-exp(-M(B-r))
Where M, B and c are known constants.
Thanks in advance.
How might I solve for the roots of an equation of the following form numerically in R:
f(r)=r*c+1-B*c-exp(-M(B-r))
Where M, B and c are known constants.
Thanks in advance.
Since R can not do this functionality you might want to use a superset package like Sage. Sage includes R and many other packages and can do what you want using a webbrowser interface. The site is http://www.sagemath.org/
Examples are located at: http://www.sagemath.org/doc/reference/sage/symbolic/relation.html
You can try stuff like the following at: http://www.sagenb.org/
var('r', 'c', 'B', 'M')
f = r*c+1-B*c-exp(-M(B-r))
print solve(f, r)
The results of this is:
r == (B*c + e^(-B + r) - 1)/c