if( !require('phaseR') ){ install.packages('phaseR') } library(phaseR) my_yprime = function(t, y, parameters) { xt = y[1] yt = y[2] dy = rep(NA, length(y)) dy[1] = -xt dy[2] = 2*yt list(dy) } diff_eq_params = list() #postscript('../../WriteUp/Graphics/Chapter9/chap_9_sect_2_prob_2_plot.eps', onefile=FALSE, horizontal=FALSE) t.end = 2.0 L = 5 flowField(my_yprime, x.lim = c(-L, +L), y.lim = c(-L, +L), parameters = diff_eq_params, points = 21, add = FALSE, xlab='x', ylab='y') trajectory(my_yprime, y0 = c(4, 2), t.end = t.end, parameters = diff_eq_params, col='black', pch=19) trajectory(my_yprime, y0 = c(4, 0), t.end = t.end, parameters = diff_eq_params, col='blue', pch=19) grid() #dev.off()