JuliaReach / ReachabilityBenchmarks

JuliaReach benchmark suite
MIT License
4 stars 1 forks source link

WIP Add transmission-line model #190

Open schillic opened 4 years ago

schillic commented 4 years ago

This is based on the paper mentioned in the file and the CORA model and settings.

Problems:

ERROR: LoadError: AssertionError: c < 1
Stacktrace:
 [1] #_expm_remainder#6(::Int64, ::typeof(IntervalMatrices._expm_remainder),
     ::IntervalMatrix{Float64,IntervalArithmetic.Interval{Float64},
     Array{IntervalArithmetic.Interval{Float64},2}}, ::Float64, ::Int64) at
     .julia/dev/IntervalMatrices/src/exponential.jl:103

further suggestions by @mforets

mforets commented 4 years ago

what does this setting mean?

Seems to me that options.eAt is a cache to hold exp(mid(A) * δ).

computed zonotope centers contain NaNs and Infs

That's bad, that reminds me this issue but i thought it was solved. Do you have an indication where such values arise?

schillic commented 4 years ago

Here is what we want to end up with (CORA results) in the η = 2 (4D) case (corresponding to Figure 9 and 10 of the paper):

Fig9 Fig10a Fig10b

For better visibility, here is what happens for time horizon = 0.002 (one time step only):

Fig9_1 Fig10a_1 Fig10b_1

schillic commented 4 years ago

Here are results with BFFPSV18 and the center matrices:

transmission_line_t-U_n transmission_line_U_1-I_1 transmission_line_U_n-I_n

First time step including the (continuous-time) initial states:

transmission_line_t-U_n transmission_line_U_1-I_1 transmission_line_U_n-I_n

Observations:

schillic commented 4 years ago

Because that precision looked horrible, here is BFFPSV18 with δ' = δ/100.0: transmission_line_t-U_n transmission_line_U_1-I_1 transmission_line_U_n-I_n

schillic commented 4 years ago

Updated projections of X(0) with improved computation of the exponential remainder (https://github.com/JuliaReach/IntervalMatrices.jl/pull/71):

transmission_line_t-U_n transmission_line_U_1-I_1 transmission_line_U_n-I_n

This is definitely a major improvement but still an order of magnitude away from the true solution.

schillic commented 4 years ago

With the latest fixes, and ignoring a current bug in the discretization for now, the results of ASB07 and ASB07_decomposed (with one-block partition) are equivalent in the first two steps. However, after two steps they diverge, and surprisingly the decomposed version is not a superset of the other.

ASB07

transmission_line_X0_t-U_n_x

ASB07_decomposed

transmission_line_X0_t-U_n

schillic commented 4 years ago

Another bugfix later, we are getting closer... (blue: ASB07_decomposed, red: ASB07, light green: BFFPSV18 for fixed parameters, yellow: X0)

transmission_line_X0_t-U_n

As can be seen, ASB07_decomposed and ASB07 are very similar until after a while ASB07_decomposed grows (rather quickly). And indeed if we continued the plot, the growth would get arbitrarily big.

Here is the same plot for a 10x smaller time step:

transmission_line_X0_t-U_n

schillic commented 4 years ago

Some updates:

For η = 2 we can make the sets at least not diverge too much by computing the matrix exponential anew in each iteration:

transmission_line_t-U_n_2

However, η = 4 still diverges:

transmission_line_t-U_n_4

schillic commented 4 years ago

On the positive side, ASB07_decomposed is much more robust for bigger time steps than BFFPSV18:

δ = 0.0001 (observe that BFFPSV18 and ASB07 produce the same output): transmission_line_t-U_n01

δ = 0.001: transmission_line_t-U_n1

δ = 0.002: transmission_line_t-U_n2

δ = 0.005 (observe the unsoundness between steps 3 and 4 that we still need to fix): transmission_line_t-U_n5

δ = 0.01: transmission_line_t-U_n10