The fix is theoretically easy, just change nameof(ModelingToolkit.value(argument)) to ModelingToolkit.getname(argument). The only problem with that, is that if I run
# if I run this
@parameters t[1:2]
ModelingToolkit.getname(t[1])
# or this
@parameters y[1:2]
y = Symbolics.scalarize(y)
ModelingToolkit.getname.(y)
The output is always just :y which basically defeats the purpose of setting parameters with arrays. I wonder if this is a ModelingToolkit problem @ChrisRackauckas
For now I worked around this by doing t = Symbolics.variables(:t, 1:2) # 2-element Vector{Num}: t₁ t₂, but I don't know if ModelingToolkit will get mad at me for using Symbolics.variables for parameters. So far the code compiles and converges though.
I tried defining an array parameter and apply it to NeuralPDE.discretize:
This fails with
LoadError: MethodError: no method matching nameof(::Term{Real, Base.ImmutableDict{DataType, Any}})
due to this line here:https://github.com/SciML/NeuralPDE.jl/blob/ab09aecff69c1f2915e4673b4b1a4b0994eeacdc/src/pinns_pde_solve.jl#L608
The fix is theoretically easy, just change
nameof(ModelingToolkit.value(argument))
toModelingToolkit.getname(argument)
. The only problem with that, is that if I runThe output is always just
:y
which basically defeats the purpose of setting parameters with arrays. I wonder if this is a ModelingToolkit problem @ChrisRackauckasFor now I worked around this by doing
t = Symbolics.variables(:t, 1:2) # 2-element Vector{Num}: t₁ t₂
, but I don't know if ModelingToolkit will get mad at me for using Symbolics.variables for parameters. So far the code compiles and converges though.