## Solve -y'' + 0.1*y = 1 + sin(4*pi*x) on [0, 1] with y(0) = y(1) = 0.
fun <- function(x) 1 + sin(4*pi*x)
sol <- bvp(fun, 0, 1, 0, 0, 40, c(1, 0, 0.1))
plot(sol$xh, sol$yh, type="l", col="blue")
grid()
Run the code above in your browser using DataLab