0

I want to plot two e-functions (in a single graph) using R:

a) f(t)=20(1-e^(-0,1t))

b) f(t)=0,4t(t+7)e^(-0,1t)

I tried the curve() function but I don't know how to use it with e-functions.

Could you help me please? Thanks!

Imran Ali
  • 2,223
  • 2
  • 28
  • 41
afiw
  • 3
  • 1
  • 3

1 Answers1

2

If you look at the help file of ?curve, you can find many clues, e.g.

chippy <- function(x) sin(cos(x)*exp(-x/2))
curve(chippy, -8, 7, n = 2001)

which would, in your case, translate to

f1 <- function(t) 20 * (1-exp(-0.1 * t))
curve(f1, from = -10, to = 20)

I'll let you figure out how to do the second one.

Roman Luštrik
  • 69,533
  • 24
  • 154
  • 197