#1
## Photoreceptor sensitivity spectra
##with lambda max at 350nm, 450nm and 550nm:
C<-photor(lambda.max=c(350))
##Grey background
##with 7 percent reflectance from 300 to 700nm:
Rb <- data.frame(300:700, rep(7, length(300:700)))
## Read CIE D65 standard illuminant:
data("D65")
##Reflectance data of R1 and R2
R1.1<-logistic(x=seq(300,700,1), x0=500, L=50, k=0.04)
R1.2<-logistic(x=seq(300,700,1), x0=400, L=50, k=0.04)
w<-R1.1[,1]
R1.1<-R1.1[,2]+10
R1.2<-R1.2[,2]+10
R1<-data.frame(w=w, R1.1=R1.1, R1.2=R1.2)
R2<-logistic(x=seq(300,700,1), x0=550, L=50, k=0.04)
R2[,2]<-R2[,2]+10
plot(R1[,c(1,2)],type="l",
ylim=c(0,60))
lines(R1[,c(1,3)])
lines(R2[,c(1,2)],col="red")
lines(Rb,col="green")
## Run model
RNLachrom(R1=R1, R2=R2, Rb=Rb, I=D65, C=C,
e = 0.16)
Run the code above in your browser using DataLab