diff --git a/.github/workflows/SpellCheck.yml b/.github/workflows/SpellCheck.yml new file mode 100644 index 000000000..fe7db59f7 --- /dev/null +++ b/.github/workflows/SpellCheck.yml @@ -0,0 +1,13 @@ +name: Spell Check + +on: [pull_request] + +jobs: + typos-check: + name: check spelling + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + - name: Check spelling + uses: crate-ci/typos@master diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 000000000..f31de5ea5 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,13 @@ +[default.extend-words] +# do not correct the following strings: +fpr = "fpr" +PLAD = "PLAD" +Childs = "Childs" +OT = "OT" +ND = "ND" +GIR = "GIR" +AKS = "AKS" + +[files] +# do not check the following files: +extend-exclude = ["references.md"] diff --git a/README.md b/README.md index 142b0fa34..c06c7fff0 100644 --- a/README.md +++ b/README.md @@ -168,13 +168,13 @@ plot(sol, vars=(1, 2), xlab="x", ylab="v", lw=0.5, color=:red) ## :blue_book: Publications -This library has been applied in a number of scientic works. +This library has been applied in a number of scientific works.
Click to see the full list of publications that use ReachabilityAnalysis.jl. - + We list them in reverse chronological order. - + [11] **Combining Set Propagation with Finite Element Methods for Time Integration in Transient Solid Mechanics Problems.** Forets, Marcelo, Daniel Freire Caporale, and Jorge M. Pérez Zerpa. arXiv preprint [arXiv:2105.05841](https://arxiv.org/abs/2105.05841). Accepted in Computers & Structures (2021). [10] **Efficient reachability analysis of parametric linear hybrid systems with time-triggered transitions.** Marcelo Forets, Daniel Freire, Christian Schilling, 2020. [arXiv: 2006.12325](https://arxiv.org/abs/2006.12325). Published in @@ -203,7 +203,7 @@ Schilling (2020) ARCH20. To appear in 7th International Workshop on Applied Veri *Note:* Articles [1-7] use the former codebase `Reachability.jl`.
- + ## 📜 How to cite Research credit and full references to the scientific papers presenting the algorithms implemented in this package can be found in the source code for each algorithm and in the [References](https://juliareach.github.io/ReachabilityAnalysis.jl/dev/references/) section of the online documentation. diff --git a/docs/src/lib/discretize.md b/docs/src/lib/discretize.md index e70fe406a..c3604153d 100644 --- a/docs/src/lib/discretize.md +++ b/docs/src/lib/discretize.md @@ -38,7 +38,7 @@ compute exponential matrices. There are distinct ways to compute the matrix exponential $e^{A\delta}$ depending on the type of $A$ (see e.g. [^HIH08]). The available methods can be used through the (unexported) function `_exp`. -For high dimensional systems (typicall `n > 2000`), computing the matrix exponential +For high dimensional systems (typically `n > 2000`), computing the matrix exponential is expensive hence it is preferable to compute the action of the matrix exponential over vectors when needed, that is, $e^{δA} v$ for each $v$. This method is particularly well-suited if `A` is vert sparse. Use the option `exp=:krylov` (or `exp=:lazy`) for this purpose. diff --git a/docs/src/lib/systems.md b/docs/src/lib/systems.md index d693a9bd3..ca9eebf18 100644 --- a/docs/src/lib/systems.md +++ b/docs/src/lib/systems.md @@ -11,7 +11,7 @@ Depth = 3 ## Types and macros -The API reference for systms types and macros can be found in the +The API reference for systems types and macros can be found in the [MathematicalSystems.jl](https://juliareach.github.io/MathematicalSystems.jl/latest/man/systems/) documentation. Two commonly used macros are `@system` and `@ivp`, used to define a system and an initial-value problem respectively. diff --git a/docs/src/man/algorithms/LGG09.md b/docs/src/man/algorithms/LGG09.md index 28ddeef56..020e8a092 100644 --- a/docs/src/man/algorithms/LGG09.md +++ b/docs/src/man/algorithms/LGG09.md @@ -98,7 +98,7 @@ using the methods described above. Once both computations have finished, we can the resulting support functions in the same array. Use the flag `threaded=true` to use this method. -Implementation-wise the function `_reach_homog_dir_LGG09!` spawns differen threads +Implementation-wise the function `_reach_homog_dir_LGG09!` spawns different threads which populate the matrix `ρℓ::Matrix{N}(undef, length(dirs), NSTEPS)` with the computed values. Hence each thread computes a subset of distinct rows of `ρℓ`. @@ -145,6 +145,6 @@ $\lambda^k$ is positive if $k$ is even, otherwise it is negative. So we can writ ```math \rho(d, X_k) = (-\lambda)^k \rho((-1)^k d, X_0) + \sum_{i=0}^{k-1} (-\lambda)^{k-i-1} \rho((-1)^{k-i-1} d, V_i). ``` -The main difference between this case and the previus one is that now we have to evaluate +The main difference between this case and the previous one is that now we have to evaluate support functions $\rho(\pm d, X_0)$ and $\rho(\pm d, V_i)$. Again, simplification takes place if the $V_i$'s are constant and such special case is considered in the implementation. diff --git a/docs/src/man/algorithms/ORBIT.md b/docs/src/man/algorithms/ORBIT.md index 6bcc94f4f..debf6e82a 100644 --- a/docs/src/man/algorithms/ORBIT.md +++ b/docs/src/man/algorithms/ORBIT.md @@ -48,7 +48,7 @@ The matrix $\Phi = e^{A\delta}$ can be evaluated in different ways, using the fu (1) `method=:base` uses Julia's built-in implementation (if `method = :base`), -(2) `method = :lazy` uses a lazy wrapper of the matrix exponential which is then evaluted using Krylov subspace methods. +(2) `method = :lazy` uses a lazy wrapper of the matrix exponential which is then evaluated using Krylov subspace methods. Method (1) is the default method. Method (2) is particularly useful to work with very large and sparse matrices (e.g. typically of order `n > 2000`). Evaluation of $\Phi_1(u, \delta)$ is available through the function [`Φ₁`](@ref). Two implementations are available: diff --git a/docs/src/man/algorithms/VREP.md b/docs/src/man/algorithms/VREP.md index 4d26f2845..864278ea8 100644 --- a/docs/src/man/algorithms/VREP.md +++ b/docs/src/man/algorithms/VREP.md @@ -33,7 +33,7 @@ polygons (e.g. convex hull, Minkowski sum) implemented in [LazySets.jl](https://github.com/JuliaReach/LazySets.jl/). On the other hand, for systems of dimension higher than two, concrete polyhedral computations use the [Polyhedra.jl](https://github.com/JuliaPolyhedra/Polyhedra.jl) -libary which itself relies on specific *backends*, which +library which itself relies on specific *backends*, which can be specified with the `backend` keyword argument in the `VREP` algorithm constructor. Such backend is used in the discretization phase. Actually, `Polyhedra.jl` features a default solver (hence it doesn't require additional packages apart from `Polyhedra.jl` itself), diff --git a/docs/src/man/benchmarks/filtered_oscillator.md b/docs/src/man/benchmarks/filtered_oscillator.md index 5ccc70f49..b9d5fc1bb 100644 --- a/docs/src/man/benchmarks/filtered_oscillator.md +++ b/docs/src/man/benchmarks/filtered_oscillator.md @@ -12,7 +12,7 @@ model from [[FRE11]](@ref). The model consists of a two-dimensional switched osc and a parametric number of filters which are used to *smooth* the oscilllator's state. An interesting aspect of the model is that it is scalable: the total number of continuous variables can be made arbitrarily large. Moreover, this is a challenging benchmark -since several dozens of reach-sets may take each discrete jumps, hence clustering methods are indispensible. +since several dozens of reach-sets may take each discrete jumps, hence clustering methods are indispensable. The continuous variables ``x`` and ``y`` are used to denote the state of the oscillator, and the remaining ``m`` variables are used for the state of the filters. diff --git a/docs/src/man/examples_overview.md b/docs/src/man/examples_overview.md index 1b2490845..85213037d 100644 --- a/docs/src/man/examples_overview.md +++ b/docs/src/man/examples_overview.md @@ -9,7 +9,7 @@ We organize the models by the type of nonlinearities (if there are some), and whether they are purely continuous or present discrete transitions, i.e. hybrid systems. We have added a column with the associated scientific domain, and another column with the number of state variables. Roughly speaking, a higher number of state variables -usually correspnds to problems which are harder to solve, altough strictly speaking, +usually corresponds to problems which are harder to solve, although strictly speaking, this usually depends on the property to be verified. Column `P.V.` refers to the cases diff --git a/docs/src/man/faq.md b/docs/src/man/faq.md index fd8a20b34..6681f30ad 100644 --- a/docs/src/man/faq.md +++ b/docs/src/man/faq.md @@ -204,7 +204,7 @@ As it is seen in the question *Can I solve a for a single initial condition?*, even if the initial condition is a singleton, the obtained flowpipe is a sequence of boxes in the `x-t` plane, i.e. we obtain sets with non-zero width both in time and in space. This behavior may seem confusing at first, because the initial conditions -where determinitic. The catch is that reach-sets represents a set of states +where deterministic. The catch is that reach-sets represents a set of states reachable over a *time interval*, that certainly contains the exact solution for the time-span associated to the reach-set, `tspan(R)`. The projection of the flowpipe on the time axis thus returns a sequence of intervals, their width being the diff --git a/docs/src/man/introduction.md b/docs/src/man/introduction.md index a979a6c15..bfaf88b77 100644 --- a/docs/src/man/introduction.md +++ b/docs/src/man/introduction.md @@ -28,7 +28,7 @@ f(t, x0) = x0 * exp(-t) plot!(t -> f(t, 0.45), xlims=(0, 4), label="Analytic sol., x(0) = 0.45", color="red") plot!(t -> f(t, 0.55), xlims=(0, 4), label="Analytic sol., x(0) = 0.55", color="red") ``` -In practice, analytic solutons of ODEs are unknown. However, in this simple case +In practice, analytic solutions of ODEs are unknown. However, in this simple case we knew that for an initial point $x_0 \in \mathbb{R}$, the solution is $x(t) = x_0 e^{-t}$ so we plotted the trajectories associated to the extremal values in the given initial interval. diff --git a/docs/src/man/structure.md b/docs/src/man/structure.md index 4372e3ce8..15a142d20 100644 --- a/docs/src/man/structure.md +++ b/docs/src/man/structure.md @@ -15,7 +15,7 @@ that we want to perform on the outputs. of a given linear system. - Method to lazily compute the flowpipe when we are only interested in outputs. -- Example with linear combination of state varibles with LGG09 (eg. some of SLICOT benchmaris properties). +- Example with linear combination of state variables with LGG09 (eg. some of SLICOT benchmarks properties). ## State-space decomposition diff --git a/docs/src/man/systems.md b/docs/src/man/systems.md index e2305591c..0a543ff29 100644 --- a/docs/src/man/systems.md +++ b/docs/src/man/systems.md @@ -8,7 +8,7 @@ from `AbstractSystem`. ## Linear systems -Two commonly used types of systems are discrete and continous systems. +Two commonly used types of systems are discrete and continuous systems. **Discrete systems.** A discrete system consists of a matrix representing the system dynamics, a set of initial states, a set of nondeterministic inputs, and a discretization step diff --git a/docs/src/tutorials/linear_methods/discrete_time.md b/docs/src/tutorials/linear_methods/discrete_time.md index e40799f13..1df979f64 100644 --- a/docs/src/tutorials/linear_methods/discrete_time.md +++ b/docs/src/tutorials/linear_methods/discrete_time.md @@ -202,7 +202,7 @@ fig = plot(F, vars=(1, 2), ratio=1.) fig = DisplayAs.Text(DisplayAs.PNG(fig)) # hide ``` -Flowpipes implement Julia's array inteface. +Flowpipes implement Julia's array interface. ```@example discrete_propagation length(F) diff --git a/docs/src/tutorials/set_representations/distances.md b/docs/src/tutorials/set_representations/distances.md index 17340be2d..b4a592fd6 100644 --- a/docs/src/tutorials/set_representations/distances.md +++ b/docs/src/tutorials/set_representations/distances.md @@ -7,7 +7,7 @@ CurrentModule = ReachabilityAnalysis ## Hausdorff distance -Tthe notion of Hausdorff distance can be used to *measure* the distance between sets. +The notion of Hausdorff distance can be used to *measure* the distance between sets. It constitutes a practical theoretical tool to quantify the quality of an approximation. ```math diff --git a/docs/src/tutorials/set_representations/polyhedral_computations.md b/docs/src/tutorials/set_representations/polyhedral_computations.md index 658966b63..cd7c97d42 100644 --- a/docs/src/tutorials/set_representations/polyhedral_computations.md +++ b/docs/src/tutorials/set_representations/polyhedral_computations.md @@ -11,10 +11,8 @@ CurrentModule = ReachabilityAnalysis ## Limitations -Computing with concrete polyhedra in high dimensions is generally expensive. In particular, converting between vertex and constraint reprsentations (so-called dual representations) should be used only if it is strictly necessary. However, there are some operations that are cheap: +Computing with concrete polyhedra in high dimensions is generally expensive. In particular, converting between vertex and constraint representations (so-called dual representations) should be used only if it is strictly necessary. However, there are some operations that are cheap: - Intersecting two (or more) sets in constraint representation, or whose `constraints_list` can be computed efficiently. Such computation only requires concatenating the constraints and removing redundant inequalities (operation that requires the solution of linear programs). - Taking linear maps of sets in vertex representation, $MX$. This operation requires to map each vertex of $X$ under the transformation $M$. Linear transformations can also be done efficiently in constraint representation provided that the matrix $M$ is invertible. LazySets handles other cases ($M$ not invertible, and the sets either in constraint or in vertex representation), but they are generally expensive in high dimensions. However, using specific classes of sets (e.g. zonotopes). - -- diff --git a/docs/src/tutorials/set_representations/zonotopes.md b/docs/src/tutorials/set_representations/zonotopes.md index eae8cb1d0..aa58891c7 100644 --- a/docs/src/tutorials/set_representations/zonotopes.md +++ b/docs/src/tutorials/set_representations/zonotopes.md @@ -28,7 +28,7 @@ a finite number of generators $g_1, . . . , g_p ∈ \mathbb{R}^n$ such that Z = \left\{ c + \sum_{i=1}^{p} \xi_i g_i | \xi_i ∈ [−1, 1]\right\}. ``` It is common to note $Z = (c, \langle g_1 . . . , g_p \rangle)$ or simply -$Z = (c, G)$, where $g_i$ is the $i$-th column of $G$. In the examle of above, +$Z = (c, G)$, where $g_i$ is the $i$-th column of $G$. In the example above, ```@example zonotope_definition @show center(Z) diff --git a/examples/ISS/ISS.jl b/examples/ISS/ISS.jl index b02b591ea..fc476ca66 100644 --- a/examples/ISS/ISS.jl +++ b/examples/ISS/ISS.jl @@ -18,7 +18,7 @@ # y(t) & = & C x(t) # \end{array} # ``` -# It was proposed as a benchmark in ARCH 2016 [^TLT16]. The matrix dimensiones are +# It was proposed as a benchmark in ARCH 2016 [^TLT16]. The matrix dimensions are # ``A ∈ \mathbb{R}^{270\times 270}``, ``B ∈ \mathbb{R}^{270\times 3}`` and # ``C ∈ \mathbb{R}^{3\times 270}``. diff --git a/examples/Lorenz/Lorenz.jl b/examples/Lorenz/Lorenz.jl index 5d7c1bb5a..4f23ace9f 100644 --- a/examples/Lorenz/Lorenz.jl +++ b/examples/Lorenz/Lorenz.jl @@ -85,7 +85,7 @@ fig = plot(solz; vars=(0, 2), xlab="t", ylab="y") #!jl DisplayAs.Text(DisplayAs.PNG(fig)) #hide # Since we have computed overapproximations of the exact flowipe, the following -# quantities are a lower bound on the exact minimum (resp. an uppper bound on the +# quantities are a lower bound on the exact minimum (resp. an upper bound on the # exact maximum): -ρ([0.0, -1.0, 0.0], solz) diff --git a/examples/OpAmp/OpAmp.jl b/examples/OpAmp/OpAmp.jl index 1f9474cb9..b5735535c 100644 --- a/examples/OpAmp/OpAmp.jl +++ b/examples/OpAmp/OpAmp.jl @@ -230,7 +230,7 @@ X0 = Singleton(zeros(2)); #- -# We solve both instances by choosing som values of ``δ`` and ``γ``: +# We solve both instances by choosing some values for ``δ`` and ``γ``: ## linearly increasing input signal prob_lin = opamp_with_saturation(; X0=X0, γ=0.0, δ=100.0, Es=1.0); diff --git a/examples/Platoon/Platoon.jl b/examples/Platoon/Platoon.jl index 783b426e9..567aa6a2e 100644 --- a/examples/Platoon/Platoon.jl +++ b/examples/Platoon/Platoon.jl @@ -154,7 +154,7 @@ function platoon(; deterministic_switching::Bool=true, H = HybridSystem(automaton, modes, resetmaps, [AutonomousSwitching()]) - ## initial condition is at the orgin in mode 1 + ## initial condition is at the origin in mode 1 X0 = BallInf(zeros(n), 0.0) initial_condition = [(1, X0)] @@ -217,7 +217,7 @@ sol_PLAD01_BND42 = solve(prob_PLAD01; dmin_specification(sol_PLAD01_BND42, 42) # In more detail we can check how is the flowpipe from violating the property. -# The specification requires that each of the follwing quantities is greater +# The specification requires that each of the following quantities is greater # than `-dmin = -42`. # Minimum of ``x_1(t)``: diff --git a/examples/ProductionDestruction/ProductionDestruction.jl b/examples/ProductionDestruction/ProductionDestruction.jl index 918dea2c8..934f567cd 100644 --- a/examples/ProductionDestruction/ProductionDestruction.jl +++ b/examples/ProductionDestruction/ProductionDestruction.jl @@ -68,7 +68,7 @@ using ReachabilityAnalysis, Symbolics, Plots const positive_orthant = HPolyhedron([x >= 0, y >= 0, z >= 0], [x, y, z]) # Given a set $X \subseteq \mathbb{R}^n$, to check whether the positivity constraint -# holds correspnods to checking wheter ``X`` is included in the positive orthant. +# holds corresponds to checking whether ``X`` is included in the positive orthant. # This computation can be done efficiently using support functions, and it is available # in `LazySets.jl`. Multiple dispatch takes care based on the types of the arguments # in the call `X ⊆ positive_orthant` depending on the type of ``X``. @@ -173,7 +173,7 @@ fig = plot(solP; vars=(0, 3), linecolor=:blue, color=:blue, alpha=0.3, lab="P") # ## Case I & P -# When uncertainty in both the intial states and the paramters are present, we can +# When uncertainty in both the initial states and the parameters are present, we can # reuse the function `prod_dest_IP!`, but setting an uncertain initial condition # and an uncertain parameter. # Recall that we are interested in ``x(0) \in [9.5, 10.0]`` and ``a \in [0.296, 0.304]``. diff --git a/examples/TransmissionLine/TransmissionLine.jl b/examples/TransmissionLine/TransmissionLine.jl index 14d8a75af..84ff699c0 100644 --- a/examples/TransmissionLine/TransmissionLine.jl +++ b/examples/TransmissionLine/TransmissionLine.jl @@ -111,7 +111,7 @@ function tline(; η=3, R=1.00, Rd=10.0, L=1e-10, C=1e-13 * 4.00) return A, B end -# We can visualize the structure of the cofficients matrix ``A`` for the case +# We can visualize the structure of the coefficients matrix ``A`` for the case # $\eta = 20$ with `spy` plot: using Plots diff --git a/src/Algorithms/ASB07/post.jl b/src/Algorithms/ASB07/post.jl index 8b161a0b3..47328439c 100644 --- a/src/Algorithms/ASB07/post.jl +++ b/src/Algorithms/ASB07/post.jl @@ -43,7 +43,7 @@ function post(alg::ASB07{N}, ivp::IVP{<:AbstractContinuousSystem}, tspan; reach_homog_ASB07!(F, Ω0, Φ, NSTEPS, δ, max_order, X, recursive, reduction_method, Δt0) else U = inputset(ivp_discr) - @assert isa(U, LazySet) "expcted input of type `<:LazySet`, but got $(typeof(U))" + @assert isa(U, LazySet) "expected input of type `<:LazySet`, but got $(typeof(U))" U = _convert_or_overapproximate(Zonotope, U) reach_inhomog_ASB07!(F, Ω0, Φ, NSTEPS, δ, max_order, X, U, recursive, reduction_method, Δt0) end diff --git a/src/Algorithms/BFFPSV18/BFFPSV18.jl b/src/Algorithms/BFFPSV18/BFFPSV18.jl index 3faf63387..e6ad2757b 100644 --- a/src/Algorithms/BFFPSV18/BFFPSV18.jl +++ b/src/Algorithms/BFFPSV18/BFFPSV18.jl @@ -18,7 +18,7 @@ Implementation of the reachability method for linear systems using block decompo after discretization - `sparse` -- (optional, default: `false`) if `true`, assume that the state transition matrix is sparse -- `view` -- (optional, default: `false`) if `true`, use implementaton that +- `view` -- (optional, default: `false`) if `true`, use implementation that uses arrays views matrix is sparse @@ -53,7 +53,7 @@ TODO: ### References This algorithm is essentially an extension of the method in [[BFFPSV18]](@ref). -Blocks can have different dimensions and the set represenation can be different +Blocks can have different dimensions and the set representation can be different for each block. For a general introduction we refer to the dissertation [[SCHI18]](@ref). diff --git a/src/Algorithms/BOX/post.jl b/src/Algorithms/BOX/post.jl index 052e33ae8..019aa65d3 100644 --- a/src/Algorithms/BOX/post.jl +++ b/src/Algorithms/BOX/post.jl @@ -32,7 +32,7 @@ function post(alg::BOX{N}, ivp::IVP{<:AbstractContinuousSystem}, tspan; Ω0 = _overapproximate(Ω0, Hyperrectangle) # reconvert the set of initial states and state matrix, if needed - #static = haskey(kwargs, :static) ? kwargs[:static] : alg.stati + #static = haskey(kwargs, :static) ? kwargs[:static] : alg.static Ω0 = _reconvert(Ω0, static, dim) Φ = _reconvert(Φ, static, dim) @@ -46,7 +46,7 @@ function post(alg::BOX{N}, ivp::IVP{<:AbstractContinuousSystem}, tspan; reach_homog_BOX!(F, Ω0, Φ, NSTEPS, δ, X, recursive, Δt0) else U = inputset(ivp_discr) - @assert isa(U, LazySet) "expcted input of type `<:LazySet`, but got $(typeof(U))" + @assert isa(U, LazySet) "expected input of type `<:LazySet`, but got $(typeof(U))" # TODO: can we use support function evaluations for the input set? U = overapproximate(U, Hyperrectangle) reach_inhomog_BOX!(F, Ω0, Φ, NSTEPS, δ, X, U, recursive, Δt0) diff --git a/src/Algorithms/GLGM06/reach_homog.jl b/src/Algorithms/GLGM06/reach_homog.jl index 03952df58..8fc3c1698 100644 --- a/src/Algorithms/GLGM06/reach_homog.jl +++ b/src/Algorithms/GLGM06/reach_homog.jl @@ -75,7 +75,7 @@ function reach_homog_GLGM06!(F::Vector{ReachSet{N,Zonotope{N,Vector{N},Matrix{N} return F end -# check interection with invariant on the loop +# check intersection with invariant on the loop function reach_homog_GLGM06!(F::Vector{ReachSet{N,Zonotope{N,VN,MN}}}, Ω0::Zonotope{N,VN,MN}, Φ::AbstractMatrix, @@ -104,7 +104,7 @@ function reach_homog_GLGM06!(F::Vector{ReachSet{N,Zonotope{N,VN,MN}}}, return F end -# check interection with invariant on the loop, implementation with zonotope preallocation +# check intersection with invariant on the loop, implementation with zonotope preallocation function reach_homog_GLGM06!(F::Vector{ReachSet{N,Zonotope{N,Vector{N},Matrix{N}}}}, Ω0::Zonotope{N,Vector{N},Matrix{N}}, Φ::AbstractMatrix, diff --git a/src/Algorithms/TMJets/common.jl b/src/Algorithms/TMJets/common.jl index 4320a91d8..2187c4afb 100644 --- a/src/Algorithms/TMJets/common.jl +++ b/src/Algorithms/TMJets/common.jl @@ -4,7 +4,7 @@ using TaylorModels: TaylorModelN using TaylorModels: fp_rpa, remainder, initialize! # ================================= -# Defaut values for the parameters +# Default values for the parameters # ================================= const DEFAULT_MAX_STEPS_TMJETS = 2000 @@ -20,7 +20,7 @@ The algorithm TMJets defaults to `TMJets21b`. const TMJets = TMJets21b # ======================================================================= -# Initialization funtions to prepare the input for validated integration +# Initialization functions to prepare the input for validated integration # ======================================================================= # fallback diff --git a/src/Algorithms/VREP/post.jl b/src/Algorithms/VREP/post.jl index 0a7e796e3..01721ae06 100644 --- a/src/Algorithms/VREP/post.jl +++ b/src/Algorithms/VREP/post.jl @@ -1,5 +1,5 @@ # =========================== -# Continous post interface +# Continuous post interface # =========================== # this algorithm uses polygons (two dimensions) or polytopes (any dimension) in vertex representation diff --git a/src/Continuous/fields.jl b/src/Continuous/fields.jl index 83dba9710..769e415e8 100644 --- a/src/Continuous/fields.jl +++ b/src/Continuous/fields.jl @@ -56,7 +56,7 @@ end function outofplace_field(ivp::InitialValueProblem) vf = VectorField(ivp) - # function closure over the inital-value problem + # function closure over the initial-value problem f = function f_outofplace(x, p, t) return vf(x) end @@ -67,7 +67,7 @@ end function inplace_field!(ivp::InitialValueProblem) vf = VectorField(ivp) - # function closure over the inital-value problem + # function closure over the initial-value problem f! = function f_inplace!(dx, x, p, t) return dx .= vf(x) end diff --git a/src/Continuous/normalization.jl b/src/Continuous/normalization.jl index 668be6b2e..a33a451dd 100644 --- a/src/Continuous/normalization.jl +++ b/src/Continuous/normalization.jl @@ -198,7 +198,7 @@ julia> dim(next_set(inputset(sext), 1)) 4 ``` -Extending a varing input set with more than one extra dimension: +Extending a varying input set with more than one extra dimension: 1] normalize(::AffineContinuousSystem{Float64,Array{Float64,2},Array{Float64,1}}) at /home/mforets/.julia/dev/ReachabilityAnalysis/src/Continuous/normalization.jl:387 ```jldoctest add_dimension_cont_sys julia> sext = add_dimension(s, 7); @@ -406,11 +406,11 @@ end # we left the n-dimensional second order system to a 2n-dimensional first # order system # if derivatives_last = true (Default) -# we assum that the first n variables correspond to position and the last n +# we assume that the first n variables correspond to position and the last n # to velocities as in x̃ = [x, x'] # # otherwise, if derivatives_last = false -# we assum that the first n variables correspond to velocities and the last n +# we assume that the first n variables correspond to velocities and the last n # to position as in x̃ = [x', x] function _second_order_linear_matrix(M::AbstractMatrix{N}, C, K; derivatives_last=true) where {N} n = size(M, 1) @@ -564,7 +564,7 @@ isconstantinput(::VaryingInput) = false isconstantinput(::LazySet) = true # The canonical form is: -# - If the system doesn't have input, a constrained linear continous system (CLCS) +# - If the system doesn't have input, a constrained linear continuous system (CLCS) # x' = Ax, x ∈ X # - If the system has an input, a CLCCS, x' = Ax + u, x ∈ X, u ∈ U # If the original system is unconstrained, the constraint set X is the universal set. diff --git a/src/Continuous/solve.jl b/src/Continuous/solve.jl index b1619aba3..0664be199 100644 --- a/src/Continuous/solve.jl +++ b/src/Continuous/solve.jl @@ -8,7 +8,7 @@ const AbstractContinuousSystem_ = AbstractContinuousSystem # to trick the linter solve(ivp::IVP{<:AbstractContinuousSystem}, tspan, alg; kwargs...) Solves the initial-value problem defined by `ivp` over the time span `tspan`, -using the algorihm `alg`. If no algorithm is given, a default algorithm is chosen. +using the algorithm `alg`. If no algorithm is given, a default algorithm is chosen. ### Input @@ -299,7 +299,7 @@ function _get_cpost(ivp, args...; kwargs...) got_opC = haskey(kwargs, :opC) no_args = isempty(args) || args[1] === nothing - # continous post was specified + # continuous post was specified if got_alg cpost = kwargs[:alg] elseif got_algorithm diff --git a/src/Discretization/Backward.jl b/src/Discretization/Backward.jl index 2852937ab..f1d145e0c 100644 --- a/src/Discretization/Backward.jl +++ b/src/Discretization/Backward.jl @@ -12,7 +12,7 @@ Backward approximation model. ### Fields - `exp` -- exponentiation method -- `setops` -- set opertaions method +- `setops` -- set operations method - `sih` -- symmetric interval hull - `inv` -- (optional, default: `false`) if `true`, assume that the state matrix is invertible and use its inverse in the `Φ` functions diff --git a/src/Discretization/StepIntersect.jl b/src/Discretization/StepIntersect.jl index e09ab31bd..11e5feaa6 100644 --- a/src/Discretization/StepIntersect.jl +++ b/src/Discretization/StepIntersect.jl @@ -21,9 +21,9 @@ model with one step backward of the same model. Let ``x' = Ax`` with ``x(0) ∈ X₀``. This methods consists of: - Compute the discretized system with step-size ``δ`` obtaining ``Ω0`` and the given - approxatmion model `method`. + approximation model `method`. -- Compute the (lazy) linear map ``ΦX₀``. This set constains of the (exact) reachable +- Compute the (lazy) linear map ``ΦX₀``. This set consists of the (exact) reachable states at the time point ``δ``. - Apply the approximation model `method` with initial condition ``ΦX₀`` one step diff --git a/src/Discretization/discretization.jl b/src/Discretization/discretization.jl index 5ffeba45a..e58f14de4 100644 --- a/src/Discretization/discretization.jl +++ b/src/Discretization/discretization.jl @@ -17,7 +17,7 @@ end # some algorithms require a polyhedral computations backend hasbackend(alg::AbstractApproximationModel) = false -# symmetric inteval hull options +# symmetric interval hull options sih(X, ::Val{:lazy}) = SymmetricIntervalHull(X) sih(X, ::Val{:concrete}) = _symmetric_interval_hull(X) diff --git a/src/Flowpipes/Flowpipe.jl b/src/Flowpipes/Flowpipe.jl index bad2ae72f..18da6adf6 100644 --- a/src/Flowpipes/Flowpipe.jl +++ b/src/Flowpipes/Flowpipe.jl @@ -315,7 +315,7 @@ end # it is assumed that rows = (idx_pos_dir, idx_neg_dir) is such that each integer # idx_pos_dir and idx_neg_dir refers to the row of the support function matrix -# correponding to a positive (resp. negative) direction +# corresponding to a positive (resp. negative) direction function flatten(fp::Flowpipe{N,<:TemplateReachSet}, rows=(1, 2)) where {N} # get the matrix of support function evaluations mat = support_function_matrix(fp) diff --git a/src/Flowpipes/clustering.jl b/src/Flowpipes/clustering.jl index eecdd04f4..e8af5f851 100644 --- a/src/Flowpipes/clustering.jl +++ b/src/Flowpipes/clustering.jl @@ -11,7 +11,7 @@ set union of the input reach-sets is included in the set union of the output rea By taking the convex hull of the input reach-sets one can reduce the number of outputs sets to a single one, overapproximately. This is the method that corresponds -to the `LazyClustering` type. However, in some cases it is conveinent to do other +to the `LazyClustering` type. However, in some cases it is convenient to do other types of transformations, such as: - Return several reach-sets that are obtained by grouping the input in a way @@ -29,7 +29,7 @@ The following strategies are implemented at the interface level: - If `P` is of type `Missing`: no partition is applied -- If `P` is of type integer: the partition corresponds to gruping the into the given integer +- If `P` is of type integer: the partition corresponds to grouping the into the given integer number of sets (or as close as possible) - If `P` is of type vector of vectors: the given partition is applied diff --git a/src/Flowpipes/setops.jl b/src/Flowpipes/setops.jl index caef200c9..54acff4e0 100644 --- a/src/Flowpipes/setops.jl +++ b/src/Flowpipes/setops.jl @@ -11,7 +11,7 @@ end _reconvert(Ω0::Zonotope{N,Vector{N},Matrix{N}}, static::Val{false}, dim, ngens) where {N} = Ω0 _reconvert(Ω0::Zonotope{N,<:SVector,<:SMatrix}, static::Val{true}, dim) where {N} = Ω0 -# convert any zonotope to be represented wih regular arrays +# convert any zonotope to be represented with regular arrays function _reconvert(Ω0::Zonotope, static::Val{false}, dim, ngens) return Zonotope(Vector(Ω0.center), Matrix(Ω0.generators)) end @@ -54,7 +54,7 @@ function _reconvert(Ω0::Hyperrectangle{N,Vector{N},Vector{N}}, static::Val{true end _reconvert(Ω0::Hyperrectangle{N,<:SVector,<:SVector}, static::Val{true}, dim) where {N} = Ω0 -# convert any Hyperrectangle to be represented wih regular arrays +# convert any Hyperrectangle to be represented with regular arrays function _reconvert(Ω0::Hyperrectangle, static::Val{false}, dim::Missing) return Ω0 = Hyperrectangle(Vector(Ω0.center), Matrix(Ω0.radius); check_bounds=false) end @@ -203,11 +203,11 @@ end # Projection # ========================= -# extend LazySets concrete projection for other arg fomats +# extend LazySets concrete projection for other arguments LazySets.project(X::LazySet, vars::NTuple{D,<:Integer}) where {D} = project(X, collect(vars)) LazySets.project(X::LazySet; vars) = project(X, vars) -# extend LazySets lazy projection for other arg fomats +# extend LazySets lazy projection for other arguments LazySets.Projection(X::LazySet, vars::NTuple{D,<:Integer}) where {D} = Projection(X, collect(vars)) LazySets.Projection(X::LazySet; vars) = Projection(X, vars) diff --git a/src/Flowpipes/solutions.jl b/src/Flowpipes/solutions.jl index 887e12e37..7670f5f5f 100644 --- a/src/Flowpipes/solutions.jl +++ b/src/Flowpipes/solutions.jl @@ -54,7 +54,7 @@ sets, and a dictionary of options. ### Fields - `Xk` -- the list of [`AbstractReachSet`](@ref)s -- `alg` -- algorihm used +- `alg` -- algorithm used - `options` -- the dictionary of options """ struct ReachSolution{FT<:AbstractFlowpipe,ST<:AbstractPost} <: AbstractSolution diff --git a/src/Hybrid/constructors.jl b/src/Hybrid/constructors.jl index 04899dcd3..a368cac70 100644 --- a/src/Hybrid/constructors.jl +++ b/src/Hybrid/constructors.jl @@ -5,7 +5,7 @@ import HybridSystems import HybridSystems: HybridSystem -# hybrid automaton with one location and a self-loop TODO comparare / use OneStateAutomaton +# hybrid automaton with one location and a self-loop TODO compare / use OneStateAutomaton function HybridSystem(mode::AbstractContinuousSystem, reset_map::AbstractMap) automaton = GraphAutomaton(1) add_transition!(automaton, 1, 1, 1) @@ -93,9 +93,9 @@ This type is parametric in: The type associated to the jitter, `J`, can be one of the following: - `Missing` -- no jitter, i.e. switchings are deterministic -- `Number` -- symetric jitter, i.e. non-deterministic switchings occur in the +- `Number` -- symmetric jitter, i.e. non-deterministic switchings occur in the intervals `[Tsample - ζ, Tsample + ζ]` -- `IA.Interval` -- nonsymetric jitter, i.e. non-deterministic switchings occur in the +- `IA.Interval` -- non-symmetric jitter, i.e. non-deterministic switchings occur in the intervals `[Tsample + inf(ζ), Tsample + sup(ζ)]`; note that the infimum is expected to be negative for most use cases, i.e. when the jitter interval is centered at zero diff --git a/src/Hybrid/waiting_list.jl b/src/Hybrid/waiting_list.jl index 96273938b..4e3847ba3 100644 --- a/src/Hybrid/waiting_list.jl +++ b/src/Hybrid/waiting_list.jl @@ -159,7 +159,7 @@ end # Waiting list allowing storage of sets of different types # =============================================================== -# non-strictly typed waiting list, useful for cases in which the set reprsentation +# non-strictly typed waiting list, useful for cases in which the set representation # to be added in the list is not known a priori struct MixedWaitingList{TN,QT<:StateInLocation} <: AbstractWaitingList times::Vector{TN} diff --git a/src/ReachSets/AbstractReachSet.jl b/src/ReachSets/AbstractReachSet.jl index 2e9da555c..f413aec7c 100644 --- a/src/ReachSets/AbstractReachSet.jl +++ b/src/ReachSets/AbstractReachSet.jl @@ -260,7 +260,7 @@ end return isdisjoint(set(H), Y) end -# used for disjointness check in continuos post-operators +# used for disjointness check in continuous post-operators function _is_intersection_empty(P::HPolyhedron, Z::Zonotope, ::BoxEnclosure) return isdisjoint(P, box_approximation(Z)) end diff --git a/test/models/generated/Platoon.jl b/test/models/generated/Platoon.jl index 4849b7744..94b57874b 100644 --- a/test/models/generated/Platoon.jl +++ b/test/models/generated/Platoon.jl @@ -104,7 +104,7 @@ function platoon(; deterministic_switching::Bool=true, H = HybridSystem(automaton, modes, resetmaps, [AutonomousSwitching()]) - # initial condition is at the orgin in mode 1 + # initial condition is at the origin in mode 1 X0 = BallInf(zeros(n), 0.0) initial_condition = [(1, X0)]