MethodOfLines.jl
MethodOfLines.jl copied to clipboard
Can a parameter be used as a domain boundary?
Hi,
While modeling a heat exchanger thanks to this (amazing) package, I tried to use a parameter as a boundary of the domain I am discretizing on.
The reason being that later on I could more easily do parametric study of the length of said heat exchanger by simply swapping the parameter without having to discretize again.
However, when I try to do something like:
domains = [t ∈ Interval(0.0, 1.0),
x ∈ Interval(0.0, L)]
I get the error
ERROR: TypeError: non-boolean (Num) used in boolean context
When trying to perform symbolic_discretize on the PDESystem
Is there any workaround? Is it something doable in the first place?
Thanks
Unfortunately this straight up will not work, until the generated ODEFunction is size invariant. Generated functions are not currently invariant under domain size so there is no way to get this to work outside of re-discretizing every time L changes
Thanks for the answer!
I was thinking that what I might end up doing is a change of variable, even though I would rather not do that if I can avoid it!
I'm afraid that'd be what I recommend, best of luck! Could you consider posting your model when you get it running so I can add a tutorial for this?
Thanks! I will share a simplified version if I end up doing that, absolutely