Exemplo n.º 1
0
    curves.WriteCurves (directory=direc)

    logFile.Text ("\n***Calculating protonation states at pH=7 %s***\n" % message)
    electrostaticModel.CalculateProbabilities (pH=7.)
    electrostaticModel.SummaryProbabilities ()
    electrostaticModel.SedScript_FromProbabilities (filename=sedFile, overwrite=True)

    logFile.Text ("\n***Calculating substate energies at pH=7 %s***\n" % message)
    substate = MEADSubstate (electrostaticModel, sites)
    substate.CalculateSubstateEnergies ()
    substate.Summary ()
    substate.Summary_ToLatex (filename=substateFile, includeSegment=True)


logFile.Text ("\n***Calculating energies of the first 10 state vectors***\n")
table = logFile.GetTable (columns=[6, 16])
table.Start ()
table.Heading ("State")
table.Heading ("Gmicro")

vector = StateVector (electrostaticModel)
vector.Reset ()
for i in range (10):
    Gmicro = electrostaticModel.CalculateMicrostateEnergy (vector, pH=7.)
    vector.Increment ()
    table.Entry ("%d" % (i + 1))
    table.Entry ("%f" % Gmicro)
table.Stop ()


logFile.Footer ()
Exemplo n.º 2
0
# . Get the fileName.
fileName = os.path.join(os.getenv("PDYNAMO_PMOLECULE"), "data", "xyz",
                        "water.xyz")

# . Loop over the energy models.
results = []
for model in energyModels:
    molecule = XYZFile_ToSystem(fileName)
    molecule.DefineQCModel(model)
    molecule.Summary()
    energy = molecule.Energy()
    charges = molecule.AtomicCharges()
    dipole = molecule.DipoleMoment()
    results.append((model.label, energy, charges, dipole.Norm2()))

# . Output the results.
table = logFile.GetTable(columns=[20, 20, 20, 20, 20, 20])
table.Start()
table.Title("Energy Model Results for Water")
table.Heading("Model")
table.Heading("Energy")
table.Heading("Charges", columnSpan=3)
table.Heading("Dipole")
for (label, energy, charges, dipole) in results:
    table.Entry(label, alignment="l")
    table.Entry("{:.1f}".format(energy))
    for charge in charges:
        table.Entry("{:.3f}".format(charge))
    table.Entry("{:.3f}".format(dipole))
table.Stop()