def calculate(self, **state):
T = state['<STR_LIT:T>']<EOL>x = state['<STR_LIT:x>']<EOL>x_total = sum([<EOL>x for compound, x in x.items()<EOL>if compound in materials])<EOL>x = {<EOL>compound: x[compound]/x_total<EOL>for compound in x.keys()<EOL>if compound in materials}<EOL>mu = {i: materials[i].mu(T=T) for i in x.keys()}<EOL>result = sum([mu[i] * x[i] * sqrt(M(i)) for i in x.keys()])<EOL>result /= sum([x[i] * sqrt(M(i)) for i in x.keys()])<EOL>return result<EOL>
Calculate dynamic viscosity at the specified temperature and
composition:

:param T: [K] temperature
:param x: [mole fraction] composition dictionary , e.g.
  {'CO': 0.25, 'CO2': 0.25, 'N2': 0.25, 'O2': 0.25}

:returns: [Pa.s] dynamic viscosity

The **state parameter contains the keyword argument(s) specified above
that are used to describe the state of the material.