# Load the COSMO species
database = CosmoRSSpeciesDatabase()
water = database.exportSpecies('water')
methanol = database.exportSpecies('methanol')
acetonitrile = database.exportSpecies('acetonitrile')

# Create a mixture.
mixture = CosmoRSMixture([
    (water, 0.6), (methanol, 0.4)
])

# Get the mixture density.
density = mixture.density()
nlprint(f'The density of the mixture is {density}')

# Get the molar volume.
molar_volume = mixture.molarVolume()
nlprint(f'The molar volume of the mixture is {molar_volume}')

# Get the molar mass.
molar_mass = mixture.molarMass()
nlprint(f'The molar mass of the mixture is {molar_mass}')

# Create another mixture.
another_mixture = CosmoRSMixture([
    (methanol, 0.4), (acetonitrile, 0.6)
])

# Combine them to create a new mixture.
new_mixture = mixture.addMixtures(0.5, another_mixture)
for i, x in enumerate(new_mixture.moleFractions()):
    nlprint(f'The mole fraction of component {i} is {x}')
