def calculate(self, **state):
T = state['<STR_LIT:T>']<EOL>x = state['<STR_LIT:x>']<EOL>compounds_sio2 = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>compounds_cao = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>compounds_al2o3 = ['<STR_LIT>']<EOL>compounds_caf2 = ['<STR_LIT>']<EOL>compounds_na2o = ['<STR_LIT>', '<STR_LIT>']<EOL>compounds_all = (compounds_sio2 + compounds_cao + compounds_al2o3 +<EOL>compounds_caf2 + compounds_na2o)<EOL>if '<STR_LIT>' in x:<EOL><INDENT>x['<STR_LIT>'] = <NUM_LIT> * x['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in x:<EOL><INDENT>x['<STR_LIT>'] = <NUM_LIT> * x['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in x:<EOL><INDENT>x['<STR_LIT>'] = <NUM_LIT> * x['<STR_LIT>']<EOL><DEDENT>x_total = sum([x.get(c, <NUM_LIT:0.0>) for c in compounds_all])<EOL>x = {c: x.get(c, <NUM_LIT:0.0>)/x_total for c in compounds_all}<EOL>x1 = sum([x.get(c, <NUM_LIT:0.0>) for c in compounds_sio2])<EOL>x2 = sum([x.get(c, <NUM_LIT:0.0>) for c in compounds_cao])<EOL>x3 = sum([x.get(c, <NUM_LIT:0.0>) for c in compounds_al2o3])<EOL>x4 = sum([x.get(c, <NUM_LIT:0.0>) for c in compounds_caf2])<EOL>x5 = sum([x.get(c, <NUM_LIT:0.0>) for c in compounds_na2o])<EOL>A = exp(-<NUM_LIT> + <NUM_LIT>*x2 + <NUM_LIT>*x4 + <NUM_LIT>*x5 - <NUM_LIT>*x3)<EOL>B = <NUM_LIT> - <NUM_LIT>*x2 - <NUM_LIT>*x4 - <NUM_LIT>*x5 + <NUM_LIT>*x3<EOL>result = A*T*exp(B/T)  <EOL>return result / <NUM_LIT><EOL>
Calculate dynamic viscosity at the specified temperature and
composition:

:param T: [K] temperature
:param x: [mole fraction] composition dictionary , e.g. \
{'SiO2': 0.25, 'CaO': 0.25, 'MgO': 0.25, 'FeO': 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.