if( !require('phaseR') ){ install.packages('phaseR') } library(phaseR) # Part (a): # my_yprime = function(t, y, parameters){ x = y[1] y = y[2] dy = numeric(2) dy[1] = 1 dy[2] = 3*x^2/(3*y^2 - 4) list(dy) } #postscript("../../WriteUp/Graphics/Chapter8/chap_8_sect_3_prob_15_direction_field.eps", onefile=FALSE, horizontal=FALSE) diff_eq_params = c() flowField(my_yprime, x.lim = c(0, 4.0), parameters = diff_eq_params, points = 21, y.lim = c(-3, +3), add = FALSE, xlab = 't' ) t_M = 1.45 trajectory(my_yprime, y0=c(0.0, 0.0), t.end = t_M, parameters = diff_eq_params) t_M = 1.825 trajectory(my_yprime, y0=c(0.0, 1.0), t.end = t_M, parameters = diff_eq_params) abline(h=c(-sqrt(4/3), sqrt(4/3)), col='red') #dev.off()