save_plots = FALSE # Question 7: # ts = seq(0, 5, length.out=100) x1 = (5/2) * exp(-ts) - (1/2) * exp(-3*ts) x2 = (5/2) * exp(-ts) + (1/2) * exp(-3*ts) if( save_plots ){ postscript("../../WriteUp/Graphics/Chapter7/chap_7_sect_1_prob_7.eps", onefile=FALSE, horizontal=FALSE) } plot(x1, x2, type='l') lines(x1[1], x2[1], type='p', pch=19, cex=1.5) grid() if( save_plots ){ dev.off() } # Question 8: # A = matrix( c( 1, 1, 1/2, 2 ), nrow=2, ncol=2, byrow=TRUE ) b = c( 3, 1/2 ) x = solve(A, b) print(x) ts = seq(0, 1, length.out=100) x1 = (11/3) * exp(2*ts) - (2/3) * exp(-ts) x2 = (11/6) * exp(2*ts) - (4/3) * exp(-ts) if( save_plots ){ postscript("../../WriteUp/Graphics/Chapter7/chap_7_sect_1_prob_8.eps", onefile=FALSE, horizontal=FALSE) } plot(x1, x2, type='l') lines(x1[1], x2[1], type='p', pch=19, cex=1.5) grid() if( save_plots ){ dev.off() } # Question 9: # ts = seq(0, 1, length.out=100) x1 = -(3/2) * exp(ts/2) - (1/2) * exp(2*ts) x2 = (3/2) * exp(ts/2) - (1/2) * exp(2*ts) if( save_plots ){ postscript("../../WriteUp/Graphics/Chapter7/chap_7_sect_1_prob_9.eps", onefile=FALSE, horizontal=FALSE) } plot(x1, x2, type='l') lines(x1[1], x2[1], type='p', pch=19, cex=1.5) grid() if( save_plots ){ dev.off() } # Question 10: # ts = seq(0, 5, length.out=100) x1 = 6 * exp(-2*ts) - 7 * exp(-ts) x2 = 9 * exp(-2*ts) - 7 * exp(-ts) if( save_plots ){ postscript("../../WriteUp/Graphics/Chapter7/chap_7_sect_1_prob_10.eps", onefile=FALSE, horizontal=FALSE) } plot(x1, x2, type='l') lines(x1[1], x2[1], type='p', pch=19, cex=1.5) grid() if( save_plots ){ dev.off() } # Question 11: # ts = seq(0, 5, length.out=100) x1 = 3 * cos(2*ts) + 4 * sin(2*ts) x2 = -3 * sin(2*ts) + 4 * cos(2*ts) if( save_plots ){ postscript("../../WriteUp/Graphics/Chapter7/chap_7_sect_1_prob_11.eps", onefile=FALSE, horizontal=FALSE) } plot(x1, x2, type='l') lines(x1[1], x2[1], type='p', pch=19, cex=1.5) grid() if( save_plots ){ dev.off() } # Question 12: # print(polyroot(c(17/4, 1, 1))) ts = seq(0, 5, length.out=100) x1 = -2 * exp(-ts/2) * cos(2*ts) + 2 * exp(-ts/2) * sin(2*ts) x2 = 2 * exp(-ts/2) * cos(2*ts) + 2 * exp(-ts/2) * sin(2*ts) if( save_plots ){ postscript("../../WriteUp/Graphics/Chapter7/chap_7_sect_1_prob_12.eps", onefile=FALSE, horizontal=FALSE) } plot(x1, x2, type='l') lines(x1[1], x2[1], type='p', pch=19, cex=1.5) grid() if( save_plots ){ dev.off() }