Skip to content
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

MethodError in reachset projection #702

Closed
mforets opened this issue Oct 23, 2019 · 0 comments · Fixed by #703
Closed

MethodError in reachset projection #702

mforets opened this issue Oct 23, 2019 · 0 comments · Fixed by #703
Assignees
Labels

Comments

@mforets
Copy link
Member

mforets commented Oct 23, 2019

using Revise
using Reachability, MathematicalSystems, TaylorIntegration

# Equations of motion
# We write the function such that the operations are either unary or binary:
@taylorize function laubloomis!(dx, x, params, t)
    dx[1] = 1.4*x[3] - 0.9*x[1]
    dx[2] = 2.5*x[5] - 1.5*x[2]
    dx[3] = 0.6*x[7] - 0.8*(x[2]*x[3])
    dx[4] = 2 - 1.3*(x[3]*x[4])
    dx[5] = 0.7*x[1] - (x[4]*x[5])
    dx[6] = 0.3*x[1] - 3.1*x[6]
    dx[7] = 1.8*x[6] - 1.6*(x[2]*x[7])
    return dx
end

function laubloomis(; T=20.0, W=0.01, plot_vars=[0, 4],
                      property=(t,x)->x[4] < 4.5,
                      project_reachset=true)

    # equations, x' = f(x(t))
    𝐹 = BlackBoxContinuousSystem(laubloomis!, 7)

    X0c = [1.2, 1.05, 1.5, 2.4, 1.0, 0.1, 0.45]
    X0 = Hyperrectangle(X0c, fill(W, 7))

    # instantiate the IVP
    𝑃 = InitialValueProblem(𝐹, X0)

    # general options
    𝑂 = Options(:T=>T, :plot_vars=>plot_vars, :property=>property,
                :project_reachset=>project_reachset, :mode=>"check")

    return (𝑃, 𝑂)
end

𝑃, 𝑂 = laubloomis(W=0.01, property=(t,x)->x[4] < 4.5, project_reachset=true)

𝑂₁ = Options(:abs_tol=>1e-10, :orderT=>7, :orderQ=>1, :max_steps=>1000)

# first run
sol_case_1 = solve(𝑃, 𝑂, op=TMJets(𝑂₁));

MethodError: Cannot `convert` an object of type Array{ReachSet{#s220} where #s220<:(Hyperrectangle{Float64,VNC,VNR} where VNR<:AbstractArray{Float64,1} where VNC<:AbstractArray{Float64,1}),1} to an object of type AbstractSolution
Closest candidates are:
  convert(::Type{#s16} where #s16<:Union{Number, T}, !Matched::MultivariatePolynomials.AbstractPolynomialLike{T}) where T at /home/mforets/.julia/packages/MultivariatePolynomials/0oEYT/src/conversion.jl:15
  convert(::Type{T}, !Matched::T) where T at essentials.jl:167

Stacktrace:
 [1] #solve!#40(::TMJets, ::typeof(Reachability.solve!), ::InitialValueProblem{BlackBoxContinuousSystem{typeof(laubloomis!)},Hyperrectangle{Float64,Array{Float64,1},Array{Float64,1}}}, ::Options) at /home/mforets/.julia/dev/Reachability/src/solve.jl:79
 [2] #solve#39 at ./none:0 [inlined]
 [3] (::getfield(Reachability, Symbol("#kw##solve")))(::NamedTuple{(:op,),Tuple{TMJets}}, ::typeof(solve), ::InitialValueProblem{BlackBoxContinuousSystem{typeof(laubloomis!)},Hyperrectangle{Float64,Array{Float64,1},Array{Float64,1}}}, ::Options) at ./none:0
 [4] top-level scope at In[5]:4
@mforets mforets added the bug label Oct 23, 2019
@mforets mforets self-assigned this Oct 23, 2019
mforets added a commit that referenced this issue Oct 24, 2019
* remove output type annotationsin solve

* fix projection params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant