NeuralPDE.jl icon indicating copy to clipboard operation
NeuralPDE.jl copied to clipboard

Array Variable interface [WIP]

Open hpieper14 opened this issue 1 year ago • 0 comments

The goal of this PR is to extend the interface to accept PDESystems that are initialized with array variables (#574) The changes so far occur in symbolic_utilities.jl and I expect that there will be changes that need to occur in discretize.jl as well.

To be more precise, currently in symbolic_utilities.jl, there is a function get_vars() that creates Vector{Symbol} for both the independent and dependent variables as well as dictionaries for both sets of variables that whose (key, value) pairs correspond to (variable name, order). These objects are constructed using the name of the symbolic variables via get_name. Most of the other functions in this file take the symbolic arrays or dictionaries generated by get_vars as inputs. For example, if the independent variables are initialized as

@parameters t z1 z2

then the functions in symbolic utilities work with something like indvars = [:t, :z1, :z2].

If we want to initialize our independent or dependent variables as arrays of symbols, this breaks down since get_name does not return unique names for entries of a symbolic array. For example, if our independent variables are initialized as

@parameters t z[1:2]

then get_vars() would return indvars = [:t, :z, :z] which leads to errors in the other functions since the independent variables do not have unique names.

The goal is to not use get_name at all and rework the functions in symbolic_utilities.jl to accept the symbolic variables directly, i.e. get_vars() should return something like `indvars = [t, z[1], z[2]]'.

hpieper14 avatar Aug 05 '22 01:08 hpieper14