P.maxwell1 <- function (filename = "maxwell1.png") { if(length(filename)) { png(file=filename, width=512) par(mar=c(1,1, 1, 1) + .1) } plot(100, 2, type="n", axes=FALSE, xlim=c(-10, 200), ylim=c(-.7, log(200)), xlab="", ylab="") segments(-10, -.5, -5, -.5, col="gold", lwd=4) segments(-5, -.5, -5, 3.5, col="gold", lwd=4) segments(-5, 3.5, 201, 3.5, col="gold", lwd=4) lines(1:200, log(1:200), col="steelblue", lwd=4) if(length(filename)) { dev.off() } } P.maxwell2 <- function (filename = "maxwell2.png") { if(length(filename)) { png(file=filename, width=512) par(mar=c(1,1, 1, 1) + .1) } plot(100, 2, type="n", axes=FALSE, xlim=c(-10, 200), ylim=c(-.7, 3.6), xlab="", ylab="") segments(-10, -.5, -5, -.5, col="gold", lwd=4) segments(-5, -.5, -5, 3.5, col="gold", lwd=4) segments(-5, 3.5, 201, 3.5, col="gold", lwd=4) xseq <- 1:200 lines(xseq, log(xseq) * 3.2/log(200), col="steelblue", lwd=4) if(length(filename)) { dev.off() } } P.maxwell3 <- function (filename = "maxwell3.png") { if(length(filename)) { png(file=filename, width=512) par(mar=c(1,1, 1, 1) + .1) } x1 <- seq(1, 34, by=2) x2 <- seq(36, 194, by=2) y1 <- log(x1) y2 <- cos(seq(length=length(x2) + 4, by=.4) + pi) * seq(length=length(x2) + 4)/length(x2) + 3.5 plot(100, 2, type="n", axes=FALSE, xlim=c(-10, 200), ylim=c(-.7, max(y1, y2)), xlab="", ylab="") segments(-10, -.5, -5, -.5, col="gold", lwd=4) segments(-5, -.5, -5, 3.5, col="gold", lwd=4) segments(-5, 3.5, 201, 3.5, col="gold", lwd=4) lines(c(x1, x2), c(y1, y2[-1:-4]), col="steelblue", lwd=4) if(length(filename)) { dev.off() } } P.maxwell4 <- function (filename = "maxwell4.png") { if(length(filename)) { png(file=filename, width=512) par(mar=c(1,1, 1, 1) + .1) } x1 <- seq(1, 24, by=2) x2 <- seq(28, 200, by=2) y1 <- log(x1) y2 <- cos(seq(length=length(x2), by=.4) + pi) * rev(seq(length=length(x2))/length(x2)) + 3.5 y2 <- y2[-1] x2 <- x2[-length(x2)] xsub <- c(x1[c(3, 7)], x2[5]) ysub <- c(y1[c(3, 7)], y2[5]) cc <- solve(cbind(1, xsub, xsub^2), ysub) y <- c(y1, y2) x <- c(x1, x2) xss <- x[3:(length(x1) + 5)] y[3:(length(x1) + 5)] <- cc[1] + cc[2] * xss + cc[3] * xss^2 plot(100, 2, type="n", axes=FALSE, xlim=c(-10, 200), ylim=c(-.7, max(y)), xlab="", ylab="") segments(-10, -.5, -5, -.5, col="gold", lwd=4) segments(-5, -.5, -5, 3.5, col="gold", lwd=4) segments(-5, 3.5, 201, 3.5, col="gold", lwd=4) lines(x, y, col="steelblue", lwd=4) if(length(filename)) { dev.off() } }