source( 'utils.R') # Problem 1: # t_max = 4*pi t = seq( 0, t_max, length.out=2000 ) y = sin( t ) - cos( t ) + 1 - u_sub_c(t, 3*pi) * ( 1 - cos( t - 3*pi ) ) #postscript("../../WriteUp/Graphics/Chapter6/sect_4_prob_1_plot.eps", onefile=FALSE, horizontal=FALSE) plot( t, y, type='l', main='Problem 1' ) abline(v=3*pi, col='red') grid() #dev.off() # Problem 2: # t_max = 4*pi t = seq( 0, t_max, length.out=2000 ) y = exp(-t) * sin(t) + 0.5 * u_sub_c(t, pi) * ( 1 + exp( -(t-pi) ) * cos(t) + exp( - (t-pi) ) * sin(t) ) #postscript("../../WriteUp/Graphics/Chapter6/sect_4_prob_2_plot.eps", onefile=FALSE, horizontal=FALSE) plot( t, y, type='l', main='problem 2' ) abline(v=c( pi, 2*pi ), col='red') grid() #dev.off() # Problem 3: # t_max = 3*pi t = seq( 0, t_max, length.out=2000 ) y = (1/6) * (1 - u_sub_c(t, 2*pi) ) * (2 * sin(t) - sin( 2 * t) ) #postscript("../../WriteUp/Graphics/Chapter6/sect_4_prob_3_plot.eps", onefile=FALSE, horizontal=FALSE) plot( t, y, type='l', main='problem 3' ) abline(v=c( 2*pi ), col='red') grid() #dev.off() # Problem 4: # t_max = 4*pi t = seq( 0, t_max, length.out=2000 ) y = (1/6) * ( 2 * sin( t ) - sin( 2 * t ) ) - (1/6) * u_sub_c(t, pi) * ( 2 * sin(t) + sin( 2 * t ) ) #postscript("../../WriteUp/Graphics/Chapter6/sect_4_prob_4_plot.eps", onefile=FALSE, horizontal=FALSE) plot( t, y, type='l', main='problem 4' ) abline(v=c( pi ), col='red') grid() #dev.off() # Problem 5: # t_max = 15 t = seq( 0, t_max, length.out=2000 ) y = 0.5 + 0.5 * exp( - 2 * t ) - exp( - t ) - u_sub_c(t, 10) * ( 0.5 + 0.5 * exp( -2*(t-10) ) - exp( -(t-10) ) ) #postscript("../../WriteUp/Graphics/Chapter6/sect_4_prob_5_plot.eps", onefile=FALSE, horizontaleALSE) plot( t, y, type='l', main='problem 5' ) abline(v=c( 10 ), col='red') grid() #dev.off() # Problem 6: # t_max = 6 t = seq( 0, t_max, length.out=2000 ) y = exp( -t ) - exp( - 2 * t ) - u_sub_c(t, 2) * ( 0.5 - exp( -(t-2) ) + 0.5*exp( -2*(t-2) ) ) #postscript("../../WriteUp/Graphics/Chapter6/sect_4_prob_6_plot.eps", onefile=FALSE, horizontal=FALSE) plot( t, y, type='l', main='problem 6' ) abline(v=c( 2 ), col='red') grid() #dev.off() # Problem 7: # t_max = 5*pi t = seq( 0, t_max, length.out=2000 ) y = cos( t ) + u_sub_c( t, 3*pi ) * ( 1 - cos( t - 3*pi ) ) #postscript("../../WriteUp/Graphics/Chapter6/sect_4_prob_7_plot.eps", onefile=FALSE, horizontal=FALSE) plot( t, y, type='l', main='problem 7' ) abline(v=c( 3*pi ), col='red') grid() #dev.off()