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

TMJets gives different results based on set representation of X0 #623

Closed
schillic opened this issue May 2, 2022 · 0 comments · Fixed by #655
Closed

TMJets gives different results based on set representation of X0 #623

schillic opened this issue May 2, 2022 · 0 comments · Fixed by #655
Assignees
Labels
bug Something isn't working

Comments

@schillic
Copy link
Member

schillic commented May 2, 2022

The blue and red sets should be equivalent. The only difference is that X0 is once represented as a LineSegment and once as a Hyperrectangle. (The green set is only there for comparison.)

In one case the system starts from [-1, 1] as it should and in the other case it starts from [-2, 2]. This scaling by 2 is consistent for other choices of X0.

using ReachabilityAnalysis, Plots

@taylorize function f!(dx, x, p, t)
    dx[1] = x[2]
    dx[2] = -x[1]
end
A = [0.0 1; -1 0]

X0 = LineSegment([1.0, 0], [-1.0, 0])
X1 = Hyperrectangle([0.0, 0], [1.0, 0])
println(isequivalent(X0, X1))  # prints `true`

Tmax = 3*π

prob1 = @ivp(x' = A*x, x(0)  X0)
prob2 = @ivp(x' = f!(x), x(0)  X0, dim=2)
prob3 = @ivp(x' = f!(x), x(0)  X1, dim=2)

alg1 = GLGM06=1e-2)
alg2 = TMJets21a(orderT=10, orderQ=2, abstol=1e-15)

sol1 = solve(prob1, alg=alg1, T=Tmax)
sol2 = solve(prob2, alg=alg2, T=Tmax)
sol3 = solve(prob3, alg=alg2, T=Tmax)

fig = plot(ylim=[-2, 2], xlab="t", ylab="x(t)")
plot!(fig, sol2, vars=(0, 1), lw=0, c=:blue)
plot!(fig, sol3, vars=(0, 1), lw=0, c=:red)
plot!(fig, sol1, vars=(0, 1), lw=0, c=:green, alpha=1)

bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant