RNAlib-2.5.1
Unit Conversion

Functions to convert between various physical units. More...

Detailed Description

Functions to convert between various physical units.

+ Collaboration diagram for Unit Conversion:

Files

file  units.h
 Physical Units and Functions to convert them into each other.
 

Enumerations

enum  vrna_unit_energy_e {
  VRNA_UNIT_J , VRNA_UNIT_KJ , VRNA_UNIT_CAL_IT , VRNA_UNIT_DACAL_IT ,
  VRNA_UNIT_KCAL_IT , VRNA_UNIT_CAL , VRNA_UNIT_DACAL , VRNA_UNIT_KCAL ,
  VRNA_UNIT_G_TNT , VRNA_UNIT_KG_TNT , VRNA_UNIT_T_TNT , VRNA_UNIT_EV ,
  VRNA_UNIT_WH , VRNA_UNIT_KWH
}
 Energy / Work Units. More...
 
enum  vrna_unit_temperature_e {
  VRNA_UNIT_K , VRNA_UNIT_DEG_C , VRNA_UNIT_DEG_F , VRNA_UNIT_DEG_R ,
  VRNA_UNIT_DEG_N , VRNA_UNIT_DEG_DE , VRNA_UNIT_DEG_RE , VRNA_UNIT_DEG_RO
}
 Temperature Units. More...
 

Functions

double vrna_convert_energy (double energy, vrna_unit_energy_e from, vrna_unit_energy_e to)
 Convert between energy / work units. More...
 
double vrna_convert_temperature (double temp, vrna_unit_temperature_e from, vrna_unit_temperature_e to)
 Convert between temperature units. More...
 
int vrna_convert_kcal_to_dcal (double energy)
 Convert floating point energy value into integer representation. More...
 
double vrna_convert_dcal_to_kcal (int energy)
 Convert an integer representation of free energy in deka-cal/mol to kcal/mol. More...
 

Enumeration Type Documentation

◆ vrna_unit_energy_e

#include <ViennaRNA/utils/units.h>

Energy / Work Units.

See also
vrna_convert_energy()
Enumerator
VRNA_UNIT_J 

Joule ( $ 1~J = 1~kg \cdot m^2 s^{-2} $ )

VRNA_UNIT_KJ 

Kilojoule ( $ 1~kJ = 1,000~J $ )

VRNA_UNIT_CAL_IT 

Calorie (International (Steam) Table, $ 1~cal_{IT} = 4.1868~J $ )

VRNA_UNIT_DACAL_IT 

Decacolorie (International (Steam) Table, $ 1~dacal_{IT} = 10~cal_{IT} = 41.868~J $ )

VRNA_UNIT_KCAL_IT 

Kilocalorie (International (Steam) Table, $ 1~kcal_{IT} = 4.1868~kJ $ )

VRNA_UNIT_CAL 

Calorie (Thermochemical, $ 1~cal_{th} = 4.184~J $ )

VRNA_UNIT_DACAL 

Decacalorie (Thermochemical, $ 1~dacal_{th} = 10~cal_{th} = 41.84~J $ )

VRNA_UNIT_KCAL 

Kilocalorie (Thermochemical, $ 1~kcal_{th} = 4.184~kJ $ )

VRNA_UNIT_G_TNT 

g TNT ( $ 1~g~\mathrm{TNT} = 1,000~cal_{th} = 4,184~J $ )

VRNA_UNIT_KG_TNT 

kg TNT ( $ 1~kg~\mathrm{TNT} = 1,000~kcal_{th} = 4,184~kJ $ )

VRNA_UNIT_T_TNT 

ton TNT ( $ 1~t~\mathrm{TNT} = 1,000,000~kcal_{th} = 4,184~MJ $ )

VRNA_UNIT_EV 

Electronvolt ( $ 1~eV = 1.602176565 \times 10^{-19}~J $ )

VRNA_UNIT_WH 

Watt hour ( $ 1~W \cdot h = 1~W \cdot 3,600 s = 3,600~J = 3.6~kJ $ )

VRNA_UNIT_KWH 

Kilowatt hour ( $ 1~kW \cdot h = 1~kW \cdot 3,600~s = 3,600~kJ = 3.6~MJ $ )

◆ vrna_unit_temperature_e

#include <ViennaRNA/utils/units.h>

Temperature Units.

See also
vrna_convert_temperature()
Enumerator
VRNA_UNIT_K 

Kelvin (K)

VRNA_UNIT_DEG_C 

Degree Celcius (°C) ( $ [^{\circ}C] = [K] - 273.15 $ )

VRNA_UNIT_DEG_F 

Degree Fahrenheit (°F) ( $ [^{\circ}F] = [K] \times \frac{9}{5} - 459.67 $ )

VRNA_UNIT_DEG_R 

Degree Rankine (°R) ( $ [^{\circ}R] = [K] \times \frac{9}{5} $ )

VRNA_UNIT_DEG_N 

Degree Newton (°N) ( $ [^{\circ}N] = ([K] - 273.15) \times \frac{33}{100} $ )

VRNA_UNIT_DEG_DE 

Degree Delisle (°De) ( $ [^{\circ}De] = (373.15 - [K]) \times \frac{3}{2} $ )

VRNA_UNIT_DEG_RE 

Degree Réaumur (°Ré) ( $ [^{\circ}R{\acute e}] = ([K] - 273.15) \times \frac{4}{5} $ )

VRNA_UNIT_DEG_RO 

Degree Rømer (°Rø) ( $ [^{\circ}\text{R{\o}}] = ([K] - 273.15) \times \frac{21}{40} + 7.5 $ )

Function Documentation

◆ vrna_convert_energy()

double vrna_convert_energy ( double  energy,
vrna_unit_energy_e  from,
vrna_unit_energy_e  to 
)

#include <ViennaRNA/utils/units.h>

Convert between energy / work units.

See also
vrna_unit_energy_e
Parameters
energyInput energy value
fromInput unit
toOutput unit
Returns
Energy value in Output unit

◆ vrna_convert_temperature()

double vrna_convert_temperature ( double  temp,
vrna_unit_temperature_e  from,
vrna_unit_temperature_e  to 
)

#include <ViennaRNA/utils/units.h>

Convert between temperature units.

See also
vrna_unit_temperature_e
Parameters
tempInput temperature value
fromInput unit
toOutput unit
Returns
Temperature value in Output unit

◆ vrna_convert_kcal_to_dcal()

int vrna_convert_kcal_to_dcal ( double  energy)

#include <ViennaRNA/utils/units.h>

Convert floating point energy value into integer representation.

This function converts a floating point value in kcal/mol into its corresponding deka-cal/mol integer representation as used throughout RNAlib.

See also
vrna_convert_dcal_to_kcal()
Parameters
energyThe energy value in kcal/mol
Returns
The energy value in deka-cal/mol

◆ vrna_convert_dcal_to_kcal()

double vrna_convert_dcal_to_kcal ( int  energy)

#include <ViennaRNA/utils/units.h>

Convert an integer representation of free energy in deka-cal/mol to kcal/mol.

This function converts a free energy value given as integer in deka-cal/mol into the corresponding floating point number in kcal/mol

See also
vrna_convert_kcal_to_dcal()
Parameters
energyThe energy in deka-cal/mol
Returns
The energy in kcal/mol