# homogeneous equilibrium of a gas. from cantera import * # create an object representing the gas phase gas = Solution('gri30.cti') # set the initial state gas.TPX = 300.0, 1.0e05, 'CH4:0.5, O2:1, N2:3.76' # equilibrate the gas holding T and P fixed gas.equilibrate("HP") # print a summary of the results print gas() ''' print "\n\n\n" # Individual properties can also be retrieved... x = gas.X y = gas.Y names = gas.species_names for n in range(gas.n_species): print "%20s %10.4g %10.4g " % (names[n], x[n], y[n]) '''