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

Add discretization method from d/dt #536

Merged
merged 1 commit into from
Aug 12, 2021
Merged

Conversation

schillic
Copy link
Member

@schillic schillic commented Jul 30, 2021

This requires JuliaReach/LazySets.jl#2800.

using ReachabilityAnalysis, Plots
using ReachabilityAnalysis: ForwardDdt
import DifferentialEquations

A = [0.0 1.0; -1.0 0.0]
X0 = BallInf([1.0, 1.0], 0.1)

prob = @ivp(x' = Ax, x(0)  X0)
dt = (0.0, 20.0)

δ = 2e-1
X1 = linear_map(exp(A*δ), X0)
template = PolarDirections(200)

sol = solve(prob, ensemble=true, include_vertices=true, trajectories=0, tspan=dt, alg=LGG09=δ, template=template, approx_model=ForwardDdt()));
sol_ua = solve(prob, tspan=dt, alg=LGG09=δ, template=template, approx_model=ForwardDdt(oa=false)));

plot(X0)
plot!(X1)
plot!(sol[1], vars=(1, 2), alpha=0.2)
plot!(convex_hull(X0, X1), alpha=0.2)
plot!(sol_ua[1], vars=(1, 2), alpha=0.5)
plot!(ensemble(sol), vars=(1, 2), alpha=1, c=:black)
xlims!(-ρ([-1.0, 0.0], sol[1]), ρ([1.0, 0.0], sol[1]))
ylims!(-ρ([0.0, -1.0], sol[1]), ρ([0.0, 1.0], sol[1]))

ua1

plot(sol[1:9], vars=(1, 2), alpha=0.2)
plot!(sol_ua[1:9], vars=(1, 2), alpha=0.5)
plot!(ensemble(sol), vars=(1, 2), alpha=1, c=:black)
xlims!(1, 1.6)

ua2

@schillic schillic force-pushed the schillic/discretize_ddt branch from ce29646 to 1fe4e7d Compare July 31, 2021 12:04
@schillic schillic marked this pull request as ready for review July 31, 2021 12:05
@schillic schillic requested a review from mforets July 31, 2021 13:40
@mforets mforets merged commit 5df11fa into master Aug 12, 2021
@mforets mforets deleted the schillic/discretize_ddt branch August 12, 2021 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants