-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error using Koopman package #110
Comments
Your u0s_dis = [cor_dist_1,cor_dist_2,cor_dist_3]
gd = GenericDistribution(u0s_dis...)
h(x,u,p) = [x; @views u[4:6]], p |
Thank you for the reply. That means, we are including the rest of the states (3 non-uncertain states) with the previously defined 3 uncertain states in by using u[4:6] in h(x,u,p) = [x; @views u[4:6]], p. Thereby, making the final solution in the as the 6-state variables. Did I understand that correctly? Regards |
Yes. You are welcome.
|
I see. Again, thank you so much for your help. It's working now. |
InexactError: Int64(33.964214570007954) Some of the types have been truncated in the stacktrace for improved reading. To emit complete information Stacktrace: Now it is giving me this issue. It was working before. |
Are you able to solve your |
Hey,
I am using the SciMLExpectations package, while my MonteCarlo() function is working perfectly but my Koopman() is giving me this issue
MethodError: no method matching logpdf(::Int64, ::Float64)
Some of the types have been truncated in the stacktrace for improved reading. To emit complete information
in the stack trace, evaluate
TruncatedStacktraces.VERBOSE[] = true
and re-run the code.Closest candidates are:
logpdf(::UnivariateMixture, ::Real) at C:\Users\lakshay.julia\packages\Distributions\YQQXX\src\mixtures\mixturemodel.jl:363
logpdf(::DiscreteNonParametric, ::Real) at C:\Users\lakshay.julia\packages\Distributions\YQQXX\src\univariate\discrete\discretenonparametric.jl:110
logpdf(::Chi, ::Real) at C:\Users\lakshay.julia\packages\Distributions\YQQXX\src\univariate\continuous\chi.jl:92
...
Stacktrace:
[1] (::SciMLExpectations.var"#2#5")(::Tuple{Int64, Float64})
@ SciMLExpectations .\none:0
[2] MappingRF
@ .\reduce.jl:95 [inlined]
[3] foldl_impl(op::Base.MappingRF{SciMLExpectations.var"#2#5", Base.BottomRF{typeof(Base.add_sum)}}, init::Base.InitialValue, itr::Base.Iterators.Zip{Tuple{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}, StaticArraysCore.MVector{6, Float64}}})
@ Base .\reduce.jl:62
[4] foldl_impl
@ .\reduce.jl:48 [inlined]
[5] mapfoldl_impl
@ .\reduce.jl:44 [inlined]
[6] #mapfoldl#259
@ .\reduce.jl:170 [inlined]
[7] mapfoldl
@ .\reduce.jl:170 [inlined]
[8] #mapreduce#263
@ .\reduce.jl:302 [inlined]
[9] mapreduce
@ .\reduce.jl:302 [inlined]
[10] #sum#266
@ .\reduce.jl:528 [inlined]
[11] sum
@ .\reduce.jl:528 [inlined]
[12] #sum#267
@ .\reduce.jl:557 [inlined]
[13] sum
@ .\reduce.jl:557 [inlined]
[14] pdf_func
@ C:\Users\lakshay.julia\packages\SciMLExpectations\DWytJ\src\distribution_utils.jl:17 [inlined]
[15] pdf
@ C:\Users\lakshay.julia\packages\SciMLExpectations\DWytJ\src\distribution_utils.jl:25 [inlined]
[16] (::SciMLExpectations.var"#14#15"{GenericDistribution{SciMLExpectations.var"#pdf_func#4"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, SciMLExpectations.var"#rand_func#6"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}}, typeof(h), typeof(loss), SystemMap{ODEProblem{true,Vector{Float64},Tuple{Float64, Float64},…}, Tuple{Tsit5{Static.False,…}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}})(x::StaticArraysCore.MVector{6, Float64}, p::ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}})
@ SciMLExpectations C:\Users\lakshay.julia\packages\SciMLExpectations\DWytJ\src\expectation.jl:48
[17] substitute_f_vector(t::StaticArraysCore.SVector{6, Float64}, p::ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}}, f::SciMLExpectations.var"#14#15"{GenericDistribution{SciMLExpectations.var"#pdf_func#4"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, SciMLExpectations.var"#rand_func#6"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}}, typeof(h), typeof(loss), SystemMap{ODEProblem{true,Vector{Float64},Tuple{Float64, Float64},…}, Tuple{Tsit5{Static.False,…}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, lb::StaticArraysCore.SVector{6, Float64}, ub::StaticArraysCore.SVector{6, Float64})
@ Integrals C:\Users\lakshay.julia\packages\Integrals\9qNWp\src\infinity_handling.jl:50
[18] #24
@ C:\Users\lakshay.julia\packages\Integrals\9qNWp\src\infinity_handling.jl:64 [inlined]
[19] #41
@ C:\Users\lakshay.julia\packages\Integrals\9qNWp\src\Integrals.jl:149 [inlined]
[20] (::HCubature.GenzMalik{6, Float64})(f::Integrals.var"#41#43"{IntegralProblem{false, ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}}, Integrals.var"#24#26"{SciMLExpectations.var"#14#15"{GenericDistribution{SciMLExpectations.var"#pdf_func#4"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, SciMLExpectations.var"#rand_func#6"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}}, typeof(h), typeof(loss), SystemMap{ODEProblem{true,Vector{Float64},Tuple{Float64, Float64},…}, Tuple{Tsit5{Static.False,…}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, a::StaticArraysCore.SVector{6, Float64}, b::StaticArraysCore.SVector{6, Float64}, norm::typeof(LinearAlgebra.norm))
@ HCubature C:\Users\lakshay.julia\packages\HCubature\QvyJW\src\genz-malik.jl:121
[21] hcubature(f::Integrals.var"#41#43"{IntegralProblem{false, ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}}, Integrals.var"#24#26"{SciMLExpectations.var"#14#15"{GenericDistribution{SciMLExpectations.var"#pdf_func#4"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, SciMLExpectations.var"#rand_func#6"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}}, typeof(h), typeof(loss), SystemMap{ODEProblem{true,Vector{Float64},Tuple{Float64, Float64},…}, Tuple{Tsit5{Static.False,…}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, a::StaticArraysCore.SVector{6, Float64}, b::StaticArraysCore.SVector{6, Float64}, norm::typeof(LinearAlgebra.norm), rtol::Float64, atol::Float64, maxevals::Int64, initdiv::Int64)
@ HCubature C:\Users\lakshay.julia\packages\HCubature\QvyJW\src\HCubature.jl:61
[22] #hcubature#3
@ C:\Users\lakshay.julia\packages\HCubature\QvyJW\src\HCubature.jl:179 [inlined]
[23] __solvebp_call(prob::IntegralProblem{false, ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}}, Integrals.var"#24#26"{SciMLExpectations.var"#14#15"{GenericDistribution{SciMLExpectations.var"#pdf_func#4"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, SciMLExpectations.var"#rand_func#6"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}}, typeof(h), typeof(loss), SystemMap{ODEProblem{true,Vector{Float64},Tuple{Float64, Float64},…}, Tuple{Tsit5{Static.False,…}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, alg::HCubatureJL{typeof(LinearAlgebra.norm)}, sensealg::Integrals.ReCallVJP{Integrals.ZygoteVJP}, lb::StaticArraysCore.SVector{6, Float64}, ub::StaticArraysCore.SVector{6, Float64}, p::ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}}; reltol::Float64, abstol::Float64, maxiters::Int64)
@ Integrals C:\Users\lakshay.julia\packages\Integrals\9qNWp\src\Integrals.jl:158
[24] #__solvebp#35
@ C:\Users\lakshay.julia\packages\Integrals\9qNWp\src\Integrals.jl:123 [inlined]
[25] solve(prob::IntegralProblem{false, ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}}, SciMLExpectations.var"#14#15"{GenericDistribution{SciMLExpectations.var"#pdf_func#4"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, SciMLExpectations.var"#rand_func#6"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}}, typeof(h), typeof(loss), SystemMap{ODEProblem{true,Vector{Float64},Tuple{Float64, Float64},…}, Tuple{Tsit5{Static.False,…}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, alg::HCubatureJL{typeof(LinearAlgebra.norm)}; sensealg::Integrals.ReCallVJP{Integrals.ZygoteVJP}, do_inf_transformation::Nothing, kwargs::Base.Pairs{Symbol, Real, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:reltol, :abstol, :maxiters), Tuple{Float64, Float64, Int64}}})
@ Integrals C:\Users\lakshay.julia\packages\Integrals\9qNWp\src\Integrals.jl:108
[26] integrate(quadalg::HCubatureJL{typeof(LinearAlgebra.norm)}, adalg::NonfusedAD, f::Function, lb::StaticArraysCore.SVector{6, Float64}, ub::StaticArraysCore.SVector{6, Float64}, p::ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}}; nout::Int64, batch::Int64, kwargs::Base.Pairs{Symbol, Real, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:reltol, :abstol, :maxiters), Tuple{Float64, Float64, Int64}}})
@ SciMLExpectations C:\Users\lakshay.julia\packages\SciMLExpectations\DWytJ\src\expectation.jl:148
[27] solve(::ExpectationProblem{SystemMap{ODEProblem{true,Vector{Float64},Tuple{Float64, Float64},…}, Tuple{Tsit5{Static.False,…}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, typeof(loss), typeof(h), GenericDistribution{SciMLExpectations.var"#pdf_func#4"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, SciMLExpectations.var"#rand_func#6"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}}, ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}}}, ::Koopman{NonfusedAD}; maxiters::Int64, batch::Int64, quadalg::HCubatureJL{typeof(LinearAlgebra.norm)}, ireltol::Float64, iabstol::Float64, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ SciMLExpectations C:\Users\lakshay.julia\packages\SciMLExpectations\DWytJ\src\expectation.jl:134
[28] solve(::ExpectationProblem{SystemMap{ODEProblem{true,Vector{Float64},Tuple{Float64, Float64},…}, Tuple{Tsit5{Static.False,…}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, typeof(loss), typeof(h), GenericDistribution{SciMLExpectations.var"#pdf_func#4"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, SciMLExpectations.var"#rand_func#6"{Tuple{Normal{Float64}, Normal{Float64}, Normal{Float64}, Int64, Int64, Int64}}, StaticArraysCore.SVector{6, Float64}, StaticArraysCore.SVector{6, Float64}}, ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}}}, ::Koopman{NonfusedAD})
@ SciMLExpectations C:\Users\lakshay.julia\packages\SciMLExpectations\DWytJ\src\expectation.jl:125
[29] top-level scope
@ In[57]:1
Can you please help me with this ? I dont know if I am missing something
Here is the code I am trying to execute:
using SciMLExpectations
u0s_dis = [cor_dist_1,cor_dist_2,cor_dist_3,0,0,0]
A Genereic function containing all the aspects of the dynamical system you are uncertain about, in this example this is the initial condition.
gd = GenericDistribution(u0s_dis...)
#Covariance matrix
The function h which maps a realization of the uncertainty space to the initial conditions and parameters of the ODEProblem
h(x, u, p) = u, p
prob = ODEProblem(hcw!, u0, tspan, p)
sm = SystemMap(prob, solver)
exprob = ExpectationProblem(sm, loss, h, gd; nout = 1)
sol = solve(exprob,Koopman())
sol.u
Here, problem is the forced dynamics of a system
Regards
The text was updated successfully, but these errors were encountered: