Skip to content
Snippets Groups Projects
Commit f1cc4051 authored by Martin Bauer's avatar Martin Bauer
Browse files

Steady state Chapman Enskog

parent 0b6b1589
No related merge requests found
...@@ -25,6 +25,21 @@ def equationsToMatrix(equations, degreesOfFreedom): ...@@ -25,6 +25,21 @@ def equationsToMatrix(equations, degreesOfFreedom):
lambda row, col: equations[row].coeff(degreesOfFreedom[col])) lambda row, col: equations[row].coeff(degreesOfFreedom[col]))
def kroneckerDelta(*args):
"""Kronecker delta for variable number of arguments,
1 if all args are equal, otherwise 0"""
for a in args:
if a != args[0]:
return 0
return 1
def multidimensionalSummation(i, dim):
"""Multidimensional summation"""
prodArgs = [range(dim)] * i
return itertools.product(*prodArgs)
def normalizeProduct(product): def normalizeProduct(product):
""" """
Expects a sympy expression that can be interpreted as a product and Expects a sympy expression that can be interpreted as a product and
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment