# Solve g' = F(x, g) on (0, 1] with g(0) = -1/1000001
G <- function(x, g) {
-1000*g + 3000 - 2000*exp(-x)
}
T <- 1
x0 <- 0
g0 <- -1/1000001
nMVT <- 5000
ghat <- ODE.MVT(G, initvalue = g0, endpoint = T, initpoint = x0, Niter = 2, npoints = nMVT)
plot(ghat, type = "l")
Run the code above in your browser using DataLab