Solve ODE with Runge-Kutta method (RK4)
solve_ode(ode_ptr, input, init, par = 0)
Matrix with solution
The external point should be created with the function
targeted::specify_ode
.
specify_ode
example(specify_ode)
#>
#> spcfy_> ode <- paste0(
#> spcfy_+ "dy(0) = p(0)*(y(1)-y(0));",
#> spcfy_+ "dy(1) = y(0)*(p(1)-y(2));",
#> spcfy_+ "dy(2) = y(0)*y(1)-p(2)*y(2);", collapse="\n"
#> spcfy_+ )
#>
#> spcfy_> ## No test:
#> spcfy_> ##D # Reduce test time
#> spcfy_> ##D dy <- specify_ode(ode)
#> spcfy_> ##D tt <- seq(0, 100, length.out=2e4)
#> spcfy_> ##D yy <- solve_ode(dy, input=tt, init=c(1, 1, 1), par=c(10, 28, 8/3))
#> spcfy_> ## End(No test)
#> spcfy_>
#> spcfy_>
#> spcfy_>