# TestTube <- R6Class(
# classname = 'TestTube',
# public = list(
# temp = NULL,
# # K
# chemicals = list(),
# concs = list(),
# solvent = NULL,
# pH = 7.0,
# vol = NULL,
# # m^3
# chemicals.pairings = 0,
# chemicals.moles = 0,
# water.size = k.water.size,
# initialize = function() {
# self$temp = 298.15
# self$vol = 0
# },
# get.system.properties = function() {
# return(
# list(
# chemicals = sapply(chemicals, function(x)
# x$name),
# polymer.num = sapply(chemicals, function(x)
# x$degree.of.polym),
# sigma = sapply(chemicals, function(x)
# x$frac.of.charged),
# size.ratio = sapply(chemicals, function(x)
# x$size / self$water.size, ),
# molar.ratio = charge.ratio2molar.ratio(charge.ratio = c(1, 1, 1, 1, 0)),
# water.size = self$k.water.size,
# vol = self$vol,
# pH = self$pH,
# temp = self$temp
# )
# )
# },
# init.solvent = function(solvent, volume, pH) {
# self$solvent <- solvent$name
# self$pH <- solvent$pH
# self$vol <- solvent$volume
# self$set.chemicals(solvent,)
# },
# set.chemicals = function(chemicals, concs, vols) {
# self$chemicals <- append(self$chemicals, chemicals)
# self$concs <- append(self$concs, concs)
# self$vol <- self$vol + sum(vols)
# },
# get.water = function(vol, temp = 298.15) {
# water.molecule <-
# Molecule$new(
# name = 'water',
# MW = 18,
# diameter = k.water.size,
# charge = 0,
# degree.of.polym = 1,
# frac.of.charge = 0
# )
#
# water <- Matter$new(
# water.molecule,
# vol = vol,
# density = 1e3,
# pH = 7,
# temp = temp
# )
#
# self$solvent <- water
# }
# )
# )
#
# Molecule <- R6Class(
# classname = 'Molecule',
# private = list(),
# public = list(
# name = 'water',
# MW = 18,
# diameter = 3.1e-10,
# charge = 0,
# degree.of.polym = 1,
# frac.of.charge = 0,
# initialize = function(name,
# MW,
# diameter,
# charge,
# degree.of.polym,
# frac.of.charge) {
# self$name = name
# self$diameter = diameter
# self$charge = charge
# self$degree.of.polym = degree.of.polym
# self$frac.of.charge = frac.of.charge
# }
# )
# )
#
# Matter <- R6Class(
# 'material',
# public = list(
# vol = 0,
# temp = 0,
# pH = 0,
# density = 0,
# molecule = NULL,
# initialize = function(molecule, vol, density, pH, temp) {
# self$molecule = molecule
# self$vol = vol
# self$density = density
# self$pH = pH
# self$temp = temp
# }
# )
# )
#
#
# testtube <- TestTube$new()
# testtube$get.water(1e-3)
# testtube$set.chemicals(
# chemicals = list(
# protein = Molecule$new(
# name = 'proteinA',
# MW = 22000,
# diameter = k.water.size,
# charge = 11,
# degree.of.polym = 207,
# frac.of.charge = 11 / 207
# )
# ),
# concs = list(20e-3),
# vols = 1
# )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.