Computes coefficient at point (x,y,z) using support vectors for mopac molecular fields
cmf_coef_xyz_sv_ex_mopac(mdb, a, ai, alpha, x, y, z, field, atomlists)
mdb | |
---|---|
a | |
ai | |
ai | |
x | |
y | |
z | |
field | |
atomlists |
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. ## The function is currently defined as cmf_coef_xyz_sv_ex_mopac <- function(mdb, a, ai, alpha, x, y, z, field, atomlists) { coef <- 0.0 nsv <- length(ai) for (isv in 1:nsv) { imol <- ai[isv] mol <- mdb[[imol]] natoms <- length(mol$atoms) for (iatom in atomlists[[imol]]) { atom <- mol$atoms[[iatom]] dist2 <- (x - atom$x)^2 + (y - atom$y)^2 + (z - atom$z)^2 if (field == "mop_q") { coef <- coef + a[isv] * atom$mop_q * exp(- alpha * dist2 / 2.0) } else if (field == "mop_dn") { coef <- coef + a[isv] * atom$mop_dn * exp(- alpha * dist2 / 2.0) } else if (field == "mop_de") { coef <- coef + a[isv] * atom$mop_de * exp(- alpha * dist2 / 2.0) } else if (field == "mop_pis") { coef <- coef + a[isv] * atom$mop_pis * exp(- alpha * dist2 / 2.0) } else if (field == "mop_homo") { coef <- coef + a[isv] * atom$mop_homo * exp(- alpha * dist2 / 2.0) } else if (field == "mop_lumo") { coef <- coef + a[isv] * atom$mop_lumo * exp(- alpha * dist2 / 2.0) } } } coef }