-
Notifications
You must be signed in to change notification settings - Fork 4
dimer_cd
baptiste edited this page Nov 24, 2012
·
6 revisions
library(cda)
library(rgl)
library(ggplot2)
# dielectric function
wvl <- seq(400, 900)
gold <- epsAu(wvl)
# define a dimer with dihedral angle
cl <- cluster_dimer(d=100,
dihedral=45*pi/180, alpha1=10*pi/180, alpha2=0,
a=35, b=12)
# visualise
rgl.ellipsoids(cl$r, cl$sizes, cl$angles, col="gold")
rgl.viewpoint( theta = 0, phi = 20, fov = 70, zoom = 1)
dimer <- function(dihedral=45, ...){
cl <- cluster_dimer(dihedral = dihedral * pi/180, ...)
circular_dichroism_spectrum(cl, material = gold)
}
params <- data.frame(dihedral=c(45, 30, 10, 0, -10, -30,-45),
d=100, a=35, b=12,
alpha1=10*pi/180, alpha2=0)
comparison <- mdply(params, dimer)
p <-
ggplot(data=comparison) +
facet_grid(type~variable, scales="free") +
geom_line(aes(wavelength, value,
colour=factor(dihedral))) +
labs(y=expression(sigma[ext]*" /"*nm^2),
x=expression(wavelength*" /"*nm), colour="dihedral angle") +
scale_colour_brewer(type="div", palette=3)
p