Skip to content
Snippets Groups Projects
Commit 5af57aea authored by paradoxe-tech's avatar paradoxe-tech
Browse files

converted kcal/mol to J/mol

parent d7f24e04
No related branches found
No related tags found
No related merge requests found
import math
def kd(delta_G:float, temperature:float=298) -> float:
def kcalmol_to_jmol(x:float):
"""
converts an energy from kcal/mol to J/mol
@x (float): energy value to convert (kcal/mol)
@return (float): converted energy value (J/mol)
"""
return x * 4184.0
def kd(delta_G:float, temperature:float=298.0) -> float:
"""
calculates the affinity constant depending on the binding free energy
@param delta_G: the value of the binding free energy
@param temperature: temperature, using Kelvin degrees
@return: affinity constant (alias Kd)
@param delta_G (float): the value of the binding free energy (kcal/mol)
@param temperature (float): temperature (kelvin)
@return (float): affinity constant
"""
return math.exp(delta_G / (8.314 * temperature))
\ No newline at end of file
return math.exp((-1 * kcalmol_to_jmol(delta_G)) / (8.314 * temperature))
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment