Application: Optical Pyrometry

This commit is contained in:
Noah L. Schrick 2023-01-31 23:05:12 -06:00
parent 0fb812562c
commit 0a45ed3d6f

View File

@ -125,3 +125,34 @@ ggplot(data.frame(x=seq(-1,4,.1)), aes(x)) +
ggtitle("Zero Function") +
xlab("x") + ylab("Zero Function") +
theme(text = element_text(size=20), plot.title = element_text(hjust = 0.5))
## Part 3: Optical Pyrometry
fun.3a.fx <- function(x) {5*exp(-x)+x-5}
fun.3a <- function(x) {5-5*exp(-x)}
fun.3a.string <- "5*exp(-x)+x-5"
fun.3a.estimate <- findZeroRelax(fun.3a,4)
# Plot
ggplot(data.frame(x=seq(-1,6,.1)), aes(x)) +
stat_function(fun=fun.3a.fx, aes(col=fun.3a.string)) +
geom_hline(aes(yintercept=0, col = "y=0"), show.legend=TRUE)+
geom_vline(aes(xintercept=fun.3a.estimate[1],
col = "relaxation estimate"), show.legend=TRUE)+
ggtitle("Zero Function") +
xlab("x") + ylab("Zero Function") +
theme(text = element_text(size=20), plot.title = element_text(hjust = 0.5))
# Solve 3b
peak.wavelength <- (1239.84)/((8.61733e-5)*(fun.3a.estimate[1])*(5778))
# Green
# 3c
# define I_Planck function
I_Planck <- function(wavelength, temp){
intensity = ((8*pi*1.23984e3)/(wavelength^5))/(exp(1.23984e3/(wavelength*temp*8.61733e-5))-1)
return(intensity)
}
lam.vec <- seq(100,2000,len=70)
plot(lam.vec, I_Planck(lam.vec,5778), type = "l", lty = 1,
xlab="wavelength (nm)", ylab="Energy Density", main="Wavelength peaks for different T (K)")
grid(NULL,NULL)