Description Usage Arguments Details Value Examples
solve initial value problems for ordinary differential equations
1 2 3 4 5 6 7 | euler(f, x0, y0, h, n)
midptivp(f, x0, y0, h, n)
rungekutta4(f, x0, y0, h, n)
adamsbashforth(f, x0, y0, h, n)
|
f |
function to integrate |
x0 |
the initial value of x |
y0 |
the initial value of y |
h |
selected step size |
n |
the number of steps |
The euler
method implements the Euler method for solving
differential equations. The codemidptivp method solves initial
value problems using the second-order Runge-Kutta method. The
rungekutta4
method is the fourth-order Runge-Kutta method.
a data frame of x
and y
values
1 2 3 4 | f <- function(x, y) { y / (2 * x + 1) }
ivp.euler <- euler(f, 0, 1, 1/100, 100)
ivp.midpt <- midptivp(f, 0, 1, 1/100, 100)
ivp.rk4 <- rungekutta4(f, 0, 1, 1/100, 100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.