I have a function that produces a negative exponential curve.
Currently, as d increases y asymptotes towards 0.
I would like to adjust the equation so that y asymptotes at some other value e.g. 0.1., the only other rule I need to keep to is that y cannot be greater than 1.
d will always be => 0
fun_expo <- function(d, z) {
exp(-d/z)
}
d <- seq(0, 40, by = 0.1)
y <- fun_expo(d, z = 5)
plot(d, y,
type = "l",
xlab = "d",
ylab = "y")
I started off by just adding a constant of 0.1 to my equation e.g.
fun_expo <- function(d, z) {
exp(-d/z) + 0.1
}
But this results in y > 1 if d is lo, which I don't want to be possible.
I am hoping for an equation that would produce something like the following (the red line is what I want).
Any advice would be greatly appreciated.


