M. Ayoub Chettouh
M. Ayoub Chettouh
Current closest to working mwe: ````julia using ModelingToolkit, MethodOfLines, DomainSets, OrdinaryDiffEq using PDEBase: add_metadata! using ModelingToolkit: get_metadata using Zygote using ReverseDiff import AbstractDifferentiation as AD using SciMLSensitivity # Method of...
I'm already passing `wrap=Val(false)`, without it it crashes sooner.
```` ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.var"#k#545"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x85c1aa6d, 0xc54674be, 0xc3a0c1ac, 0x6b84bad6, 0xd1e187c5), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t),...
Any hint how this could be implemented?
`remake` in SciMLBase supports applying new `u0`'s: https://github.com/SciML/SciMLBase.jl/blob/03cdaedfd3af1ece7c897f6d28ad2d4236ead4d9/src/remake.jl#L52
Perhaps something like this (seems to work): ````julia function resolve(ps, sol) ps = # Make a vector of pairs here _prob = remake(prob, p=ps, u0=vcat([val[end,:] for val in values(sol.u)]...)) solve(_prob,...
Full MWE (for 2 dependent variables): ````julia using DifferentialEquations, ModelingToolkit, MethodOfLines, DomainSets # Parameters, variables, and derivatives @parameters t x @variables u(..) v(..) @parameters α β Dt = Differential(t) Dxx...
If `Flux(t,x)` is in `@named pdesys = PDESystem(eq, bcs, domains, [t, x], [u(t, x), Flux(t,x)], ps)`, shouldn't MoL treat it as a dependent variable not any different from `u(t,x)`?
The result is a `Tuple{ODESystem, Tuple{Float64,Float64}}` rather than a `ODEProblem`; `solve` crashes. Tried converting but it also crashes with some `SymbolicUtils` error.
This system appears to be incompatible, tried transforming using https://github.com/SciML/MethodOfLines.jl/blob/feac4dc0851a23a8a8213a39605c823cd828f7e7/src/MOL_discretization.jl#L149 without simplification but it didn't work. When I used `structural_simplify` it worked but the same problem occured.