if( !require('phaseR') ){ install.packages('phaseR') } library(phaseR) my_yprime = function(t, y, parameters){ x = y[1] y = y[2] dy = numeric(2) dy[1] = 1 dy[2] = 5*sin(2*x) - y list( dy ) } #postscript("../../WriteUp/Graphics/Chapter2/chap_2_sect_1_prob_11_plot.eps", onefile=FALSE, horizontal=FALSE) diff_eq_params = c() flowField(my_yprime, x.lim = c(0, 5), y.lim = c(-2, 6), parameters = diff_eq_params, points = 21, add = FALSE) trajectory(my_yprime, y0 = c(0.0, -0.25), t.end = 5, parameters = diff_eq_params) trajectory(my_yprime, y0 = c(0.0, 1.0), t.end = 5, parameters = diff_eq_params) trajectory(my_yprime, y0 = c(0.0, 5.0), t.end = 5, parameters = diff_eq_params) #dev.off()