Hello,
Does anyone know how to parameterize the coefficients of PDEs?
For example, I need to parameterize the vicosity or density of the fluid for Navier-Stokes equation?
How to make changes to the NS node defined below or create the corresponding flow network?
You can parameterize a PDE using a SymPy Symbol. While maybe not obvious, the 1D wave equation example can show how to go about this (here t is the parameterized variable). You can take these ideas and extend them to coefficients of other PDEs.
Note inside the Wave equation we have:
def __init__(self, c=1.0):
# coordinates
x = Symbol("x")
# time
t = Symbol("t")
# make input variables
input_variables = {"x": x, "t": t}
.....
# set equations
self.equations = {}
self.equations["wave_equation"] = u.diff(t, 2) - (c**2 * u.diff(x)).diff(x)
in the problem t is never predicted by the model but rather injected using the parameterization in the constraints. E.g.