View source: R/simplePendulum.R
simplePendulum | R Documentation |
The derivative function of the simple pendulum model, an example of a two-dimensional autonomous ODE system.
simplePendulum(t, y, parameters)
t |
The value of t, the independent
variable, to evaluate the derivative at. Should be a
|
y |
The values of x and
y, the dependent variables, to evaluate
the derivative at. Should be a |
parameters |
The values of the parameters of the system. Should be a
|
simplePendulum
evaluates the derivative of the following ODE at the
point (t, x, y):
Its format is designed to be compatible with ode
from
the deSolve
package.
Returns a list
containing the values of the two
derivatives at
(t, x, y).
Michael J Grayling
ode
# Plot the velocity field, nullclines and several trajectories simplePendulum_flowField <- flowField(simplePendulum, xlim = c(-7, 7), ylim = c(-7, 7), parameters = 5, points = 19, add = FALSE) y0 <- matrix(c(0, 1, 0, 4, -6, 1, 5, 0.5, 0, -3), 5, 2, byrow = TRUE) simplePendulum_nullclines <- nullclines(simplePendulum, xlim = c(-7, 7), ylim = c(-7, 7), parameters = 5, points = 500) simplePendulum_trajectory <- trajectory(simplePendulum, y0 = y0, tlim = c(0, 10), parameters = 5) # Determine the stability of two equilibrium points simplePendulum_stability_1 <- stability(simplePendulum, ystar = c(0, 0), parameters = 5) simplePendulum_stability_2 <- stability(simplePendulum, ystar = c(pi, 0), parameters = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.