if( !require('NLRoot') ){ install.packages('NLRoot') } library(NLRoot) #postscript("../../WriteUp/Graphics/Chapter2/chap_2_sect_1_prob_29_plot.eps", onefile=FALSE, horizontal=FALSE) ts = seq( 0, 15, length.out=1000 ) ts = seq( 9.5, 10.5, length.out=1000 ) # much closer to the first crossing y = function(t){ 12 + (8/65) * ( 8*sin(2*t) + cos(2*t) ) - (788/65) * exp(-t/4) } ys = y(ts) plot( ts, ys, type='l', xlab='t', ylab='y(t)' ) abline(h=12, col='blue') grid() #dev.off() BFfzero( function(x){ y(x)-12 }, 10.0, 10.2 )