SciML / DataDrivenDiffEq.jl

Data driven modeling and automated discovery of dynamical systems for the SciML Scientific Machine Learning organization
https://docs.sciml.ai/DataDrivenDiffEq/stable/
MIT License
402 stars 56 forks source link

No Method Matching Koopman #370

Open ghost opened 1 year ago

ghost commented 1 year ago

https://datadriven.sciml.ai/dev/examples/4_nonlinear_continuous_system/

Here, when I copy / paste the example and try to run:

@parameters t
@variables u[1:2](t)
Ψ = Basis([u; u[1]^2], u, independent_variable = t)
res = solve(prob, Ψ, DMDPINV(), digits = 1)
system = result(res)

system = result(res) gives the error: Model ##Koopman#637 with 2 ERROR: MethodError: no method matching Koopman(::Vector{Equation}, ::Vector{Term{Real, Base.ImmutableDict{DataType, Any}}}, ::Vector{Any}, ::Vector{Sym{Real, Base.ImmutableDict{DataType, Any}}}, ::Vector{Any}, ::Num, ::DataDrivenDiffEq.var"#f#2", ::DataDrivenDiffEq.var"#f#2", ::Symbol, ::Vector{Basis}, ::Bool, ::Eigen{Float64, Float64, Matrix{Float64}, Vector{Float64}}, ::Matrix{Float64}, ::Matrix{Float64}, ::Matrix{Float64}; checks=false) Closest candidates are: Koopman(::Vector{Equation}, ::Vector, ::Vector, ::Vector, ::Vector, ::Num, ::Function, ::Function, ::Symbol, ::Vector{Basis}, ::Bool, ::O, ::M, ::G, ::T) where {O, M, G, T} at C:\Users\44745.julia\packages\DataDrivenDiffEq\16LV4\src\koopman\type.jl:34 got unsupported keyword argument "checks" Koopman(::AbstractVector{Equation}, ::AbstractVector; K, C, Q, P, lift, parameters, iv, controls, observed, name, is_discrete, digits, simplify, linear_independent, eval_expression, kwargs...) at C:\Users\44745.julia\packages\DataDrivenDiffEq\16LV4\src\koopman\type.jl:66 Koopman(::AbstractVector{Num}, ::AbstractVector; K, C, Q, P, lift, parameters, iv, controls, observed, name, is_discrete, digits, simplify, linear_independent, eval_expression, kwargs...) at C:\Users\44745.julia\packages\DataDrivenDiffEq\16LV4\src\koopman\type.jl:107 Stacktrace:

It also takes a really long time to run

prob = ContinuousDataDrivenProblem(solution)
AlCap23 commented 1 year ago

What's the output of your ] st ?

I think I fixed this.

ghost commented 1 year ago

It's: Status C:\Users\44745\.julia\environments\v1.7\Project.toml [2445eb08] DataDrivenDiffEq v0.8.5 [2b5f629d] DiffEqBase v6.94.3 [aae7a2af] DiffEqFlux v1.51.2 [0c46a032] DifferentialEquations v7.2.0 [5789e2e9] FileIO v1.14.0 [587475ba] Flux v0.13.4 [033835bb] JLD2 v0.4.22 [b2108857] Lux v0.4.9 [961ee093] ModelingToolkit v8.17.0 [429524aa] Optim v1.7.0 [7f7a1694] Optimization v3.8.0 [253f991c] OptimizationFlux v0.1.0 [36348300] OptimizationOptimJL v0.1.2 [42dfb2eb] OptimizationOptimisers v0.1.0 [500b13db] OptimizationPolyalgorithms v0.1.0 [1dea7af3] OrdinaryDiffEq v6.19.0 [91a5bcdd] Plots v1.31.3 [438e738f] PyCall v1.93.1 [1ed8b502] SciMLSensitivity v7.1.2 [8bb1440f] DelimitedFiles [37e2e46d] LinearAlgebra [9a3f8284] Random [10745b16] Statistics Thanks

AlCap23 commented 1 year ago

Thanks! On it later today

AlCap23 commented 1 year ago

This is a little bit more messy than expected. Most likely, I'll update the Koopman stuff in #371 accordingly, such that this will not happen anymore.