#
# MackeyGlass_demo.R
#
# R demonstration script that uses the vector field
# defined in MackeyGlass.R
#
# This file was generated by the program VFGEN, version: 2.5.0
# Generated on 15-Jan-2015 at 14:33
#
library(deSolve)
# Load the vector field definition.
source("MackeyGlass.R")
# --- Parameters ---
parameters = c(
a = 0.2,
b = 0.1,
tau = 17.0
)
# --- Initial conditions ---
state = c(
x = 0.5
)
# --- Time values ---
times = seq(0, 10, by = 0.02)
# --- Call the DDE solver ---
sol = dede(y = state, times = times, func = MackeyGlass, parms = parameters)
# --- Plot the solution ---
par(mfcol = c(1, 1))
t <- sol[, "time"]
plot(t, sol[, "x"], type = "l", col = "blue",
xlab = "t", ylab = "x")