Skip to content

Commit

Permalink
Rename algebraic systems into descriptor systems
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Nov 23, 2022
1 parent 04bd7cc commit 8924d8b
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DocTestFilters = [r"[0-9\.]+ seconds \(.*\)"]

- Generic and flexible systems definitions, while being fast and type stable.
- Types for mathematical systems modeling: continuous, discrete, controlled,
linear algebraic, etc.
descriptor systems, etc.
- Iterator interfaces to handle constant or time-varying inputs.

## Ecosystem
Expand Down
8 changes: 4 additions & 4 deletions docs/src/lib/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ ConstrainedLinearContinuousSystem
ConstrainedAffineContinuousSystem
ConstrainedAffineControlContinuousSystem
ConstrainedLinearControlContinuousSystem
LinearAlgebraicContinuousSystem
ConstrainedLinearAlgebraicContinuousSystem
LinearDescriptorContinuousSystem
ConstrainedLinearDescriptorContinuousSystem
PolynomialContinuousSystem
ConstrainedPolynomialContinuousSystem
BlackBoxContinuousSystem
Expand Down Expand Up @@ -72,8 +72,8 @@ ConstrainedLinearDiscreteSystem
ConstrainedAffineDiscreteSystem
ConstrainedLinearControlDiscreteSystem
ConstrainedAffineControlDiscreteSystem
LinearAlgebraicDiscreteSystem
ConstrainedLinearAlgebraicDiscreteSystem
LinearDescriptorDiscreteSystem
ConstrainedLinearDescriptorDiscreteSystem
PolynomialDiscreteSystem
ConstrainedPolynomialDiscreteSystem
BlackBoxDiscreteSystem
Expand Down
6 changes: 3 additions & 3 deletions docs/src/man/systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ In the examples introduced so far, the macro has automatically created different
given a defining equation, either in scalar or in vector form, and state constraints.
It is possible to define systems with additive input terms or noise terms, with
constraints on the state, inputs or combinations of these. Other specific classes of
systems such as algebraic, polynomial or general nonlinear systems given by a standard
systems such as descriptor, polynomial or general nonlinear systems given by a standard
Julia function are available as well (see the tables below).

Some applications require distinguishing between *controlled* inputs and *uncontrolled* or
Expand Down Expand Up @@ -79,8 +79,8 @@ However in this table we only included continuous system types for brevity.
|CACS|[`ConstrainedAffineContinuousSystem`](@ref)|
|CACCS|[`ConstrainedAffineControlContinuousSystem`](@ref)|
|CLCCS|[`ConstrainedLinearControlContinuousSystem`](@ref)|
|LACS|[`LinearAlgebraicContinuousSystem`](@ref)|
|CLACS|[`ConstrainedLinearAlgebraicContinuousSystem`](@ref)|
|LACS|[`LinearDescriptorContinuousSystem`](@ref)|
|CLACS|[`ConstrainedLinearDescriptorContinuousSystem`](@ref)|
|PCS|[`PolynomialContinuousSystem`](@ref)|
|CPCS|[`PolynomialContinuousSystem`](@ref)|
|BBCS|[`BlackBoxContinuousSystem`](@ref)|
Expand Down
8 changes: 4 additions & 4 deletions src/MathematicalSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export ContinuousIdentitySystem,
ConstrainedAffineContinuousSystem,
ConstrainedAffineControlContinuousSystem,
ConstrainedLinearControlContinuousSystem,
LinearAlgebraicContinuousSystem,
ConstrainedLinearAlgebraicContinuousSystem,
LinearDescriptorContinuousSystem,
ConstrainedLinearDescriptorContinuousSystem,
PolynomialContinuousSystem,
ConstrainedPolynomialContinuousSystem,
BlackBoxContinuousSystem,
Expand Down Expand Up @@ -102,8 +102,8 @@ export DiscreteIdentitySystem,
ConstrainedAffineDiscreteSystem,
ConstrainedLinearControlDiscreteSystem,
ConstrainedAffineControlDiscreteSystem,
LinearAlgebraicDiscreteSystem,
ConstrainedLinearAlgebraicDiscreteSystem,
LinearDescriptorDiscreteSystem,
ConstrainedLinearDescriptorDiscreteSystem,
PolynomialDiscreteSystem,
ConstrainedPolynomialDiscreteSystem,
BlackBoxDiscreteSystem,
Expand Down
4 changes: 2 additions & 2 deletions src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,8 @@ Similarly, a noise variable is specified with `noise: var` or `noise=var`.
not correspond to the default value of `u`, but `foo` is parsed as being the input.
- If the left-hand side contains a multiplicative term in the form `E*x⁺` or `E*x'`,
the equation is parsed as an algebraic system. In this case, the asterisk
`*` operator is mandatory.
the equation is parsed as an algebraic equation and hence gives rise to a descriptor
system. In this case, the asterisk `*` operator is mandatory.
- Systems of the form `x' = α*x` where `α` is a scalar are parsed as linear
systems. The default dimension is `1` and `α` is parsed as `Float64`;
Expand Down
28 changes: 14 additions & 14 deletions src/systems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,8 @@ Discrete-time linear control system with domain constraints of the form:
"""
ConstrainedLinearControlDiscreteSystem

for (Z, AZ) in ((:LinearAlgebraicContinuousSystem, :AbstractContinuousSystem),
(:LinearAlgebraicDiscreteSystem, :AbstractDiscreteSystem))
for (Z, AZ) in ((:LinearDescriptorContinuousSystem, :AbstractContinuousSystem),
(:LinearDescriptorDiscreteSystem, :AbstractDiscreteSystem))
@eval begin
struct $(Z){T, MTA <: AbstractMatrix{T}, MTE <: AbstractMatrix{T}} <: $(AZ)
A::MTA
Expand Down Expand Up @@ -703,9 +703,9 @@ for (Z, AZ) in ((:LinearAlgebraicContinuousSystem, :AbstractContinuousSystem),
end

@doc """
LinearAlgebraicContinuousSystem
LinearDescriptorContinuousSystem
Continuous-time linear algebraic system of the form:
Continuous-time linear descriptor system of the form:
```math
E x(t)' = A x(t) \\; \\forall t.
Expand All @@ -716,12 +716,12 @@ Continuous-time linear algebraic system of the form:
- `A` -- state matrix
- `E` -- matrix, same size as `A`
"""
LinearAlgebraicContinuousSystem
LinearDescriptorContinuousSystem

@doc """
LinearAlgebraicDiscreteSystem
LinearDescriptorDiscreteSystem
Discrete-time linear algebraic system of the form:
Discrete-time linear descriptor system of the form:
```math
E x_{k+1} = A x_k \\; \\forall k.
Expand All @@ -732,10 +732,10 @@ Discrete-time linear algebraic system of the form:
- `A` -- state matrix
- `E` -- matrix, same size as `A`
"""
LinearAlgebraicDiscreteSystem
LinearDescriptorDiscreteSystem

for (Z, AZ) in ((:ConstrainedLinearAlgebraicContinuousSystem, :AbstractContinuousSystem),
(:ConstrainedLinearAlgebraicDiscreteSystem, :AbstractDiscreteSystem))
for (Z, AZ) in ((:ConstrainedLinearDescriptorContinuousSystem, :AbstractContinuousSystem),
(:ConstrainedLinearDescriptorDiscreteSystem, :AbstractDiscreteSystem))
@eval begin
struct $(Z){T, MTA <: AbstractMatrix{T}, MTE <: AbstractMatrix{T}, ST} <: $(AZ)
A::MTA
Expand Down Expand Up @@ -770,7 +770,7 @@ for (Z, AZ) in ((:ConstrainedLinearAlgebraicContinuousSystem, :AbstractContinuou
end

@doc """
ConstrainedLinearAlgebraicContinuousSystem
ConstrainedLinearDescriptorContinuousSystem
Continuous-time linear system with domain constraints of the form:
Expand All @@ -784,10 +784,10 @@ Continuous-time linear system with domain constraints of the form:
- `E` -- matrix, same size as `A`
- `X` -- state constraints
"""
ConstrainedLinearAlgebraicContinuousSystem
ConstrainedLinearDescriptorContinuousSystem

@doc """
ConstrainedLinearAlgebraicDiscreteSystem
ConstrainedLinearDescriptorDiscreteSystem
Discrete-time linear system with domain constraints of the form:
Expand All @@ -801,7 +801,7 @@ Discrete-time linear system with domain constraints of the form:
- `E` -- matrix, same size as `A`
- `X` -- state constraints
"""
ConstrainedLinearAlgebraicDiscreteSystem
ConstrainedLinearDescriptorDiscreteSystem

for (Z, AZ) in ((:PolynomialContinuousSystem, :AbstractContinuousSystem),
(:PolynomialDiscreteSystem, :AbstractDiscreteSystem))
Expand Down
14 changes: 7 additions & 7 deletions test/@system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ end
@test sys == ConstrainedAffineControlContinuousSystem(hcat(0.3), hcat(0.1), vcat(0.2), X, U)
end

@testset "@system for linear algebraic continous systems" begin
@testset "@system for linear descriptor continous systems" begin
# lhs needs a *
@test_throws ArgumentError @system(Ex' = Ax)
@test@system(E*x' = Ax) == LinearAlgebraicContinuousSystem(A, E)
@test@system(E*x' = Ax) == LinearDescriptorContinuousSystem(A, E)

@test @system(E*x' = A*x) == LinearAlgebraicContinuousSystem(A, E)
@test @system(E*x' = A*x, xX) == ConstrainedLinearAlgebraicContinuousSystem(A, E, X)
@test @system(E*x' = A*x) == LinearDescriptorContinuousSystem(A, E)
@test @system(E*x' = A*x, xX) == ConstrainedLinearDescriptorContinuousSystem(A, E, X)
end

@testset "@system for affine continuous systems" begin
Expand Down Expand Up @@ -214,13 +214,13 @@ end
@test @system(x⁺ = A1*x + c1) == AffineDiscreteSystem(A1, c1)
end

@testset "@system for linear algebraic discrete systems" begin
@testset "@system for linear descriptor discrete systems" begin
sys = @system(E*x⁺ = Ax)
@test sys == LinearAlgebraicDiscreteSystem(A, E)
@test sys == LinearDescriptorDiscreteSystem(A, E)
@test sys == @system(E1*x⁺ = A1*x)

sys = @system(E*x⁺ = A*x, x X)
@test sys == ConstrainedLinearAlgebraicDiscreteSystem(A, E, X)
@test sys == ConstrainedLinearDescriptorDiscreteSystem(A, E, X)
end

@testset "@system for linear control discrete systems" begin
Expand Down
16 changes: 8 additions & 8 deletions test/continuous.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ end
s = ConstrainedLinearControlContinuousSystem(A_sparse, B, X, U)
end

@testset "Continuous linear algebraic system" begin
s = LinearAlgebraicContinuousSystem(A, E)
@testset "Continuous linear descriptor system" begin
s = LinearDescriptorContinuousSystem(A, E)
@test state_matrix(s) == A
@test input_matrix(s) == nothing
@test affine_term(s) == nothing
Expand All @@ -266,12 +266,12 @@ end
@test inputset(s) == nothing
@test noiseset(s) == nothing
# Scalar System
scalar_sys = LinearAlgebraicContinuousSystem(a, e)
@test scalar_sys == LinearAlgebraicContinuousSystem(As, Es)
scalar_sys = LinearDescriptorContinuousSystem(a, e)
@test scalar_sys == LinearDescriptorContinuousSystem(As, Es)
end

@testset "Continuous constrained linear algebraic system" begin
s = ConstrainedLinearAlgebraicContinuousSystem(A, E, X)
@testset "Continuous constrained linear descriptor system" begin
s = ConstrainedLinearDescriptorContinuousSystem(A, E, X)
@test state_matrix(s) == A
@test input_matrix(s) == nothing
@test affine_term(s) == nothing
Expand All @@ -288,8 +288,8 @@ end
@test !isnoisy(s) && !iscontrolled(s) && isconstrained(s)
end
# Scalar System
scalar_sys = ConstrainedLinearAlgebraicContinuousSystem(a, e, Xs)
@test scalar_sys == ConstrainedLinearAlgebraicContinuousSystem(As, Es, Xs)
scalar_sys = ConstrainedLinearDescriptorContinuousSystem(a, e, Xs)
@test scalar_sys == ConstrainedLinearDescriptorContinuousSystem(As, Es, Xs)

@testset "Initial value problem" begin
x0 = Singleton([1.5, 2.0])
Expand Down
16 changes: 8 additions & 8 deletions test/discrete.jl
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ end
@test scalar_sys == ConstrainedLinearControlDiscreteSystem(As, Bs, Xs, Us)
end

@testset "Discrete linear algebraic system" begin
s = LinearAlgebraicDiscreteSystem(A, E)
@testset "Discrete linear descriptor system" begin
s = LinearDescriptorDiscreteSystem(A, E)
@test state_matrix(s) == A
@test input_matrix(s) == nothing
@test affine_term(s) == nothing
Expand All @@ -211,12 +211,12 @@ end
@test !isnoisy(s) && !iscontrolled(s) && !isconstrained(s)
end
# Scalar System
scalar_sys = LinearAlgebraicDiscreteSystem(a, e)
@test scalar_sys == LinearAlgebraicDiscreteSystem(As, Es)
scalar_sys = LinearDescriptorDiscreteSystem(a, e)
@test scalar_sys == LinearDescriptorDiscreteSystem(As, Es)
end

@testset "Discrete constrained linear algebraic system" begin
s = ConstrainedLinearAlgebraicDiscreteSystem(A, E, X)
@testset "Discrete constrained linear descriptor system" begin
s = ConstrainedLinearDescriptorDiscreteSystem(A, E, X)
@test state_matrix(s) == A
@test input_matrix(s) == nothing
@test affine_term(s) == nothing
Expand All @@ -233,8 +233,8 @@ end
@test !isnoisy(s) && !iscontrolled(s) && isconstrained(s)
end
# Scalar System
scalar_sys = ConstrainedLinearAlgebraicDiscreteSystem(a, e, Xs)
@test scalar_sys == ConstrainedLinearAlgebraicDiscreteSystem(As, Es, Xs)
scalar_sys = ConstrainedLinearDescriptorDiscreteSystem(a, e, Xs)
@test scalar_sys == ConstrainedLinearDescriptorDiscreteSystem(As, Es, Xs)
end

@testset "Polynomial system in discrete time" begin
Expand Down
4 changes: 2 additions & 2 deletions test/discretize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ end

# get affine ctypes
CTYPES = filter(x -> (occursin("Linear", string(x)) || occursin("Affine", string(x))) &&
!occursin("Algebraic", string(x)) , subtypes(AbstractContinuousSystem))
!occursin("Descriptor", string(x)) , subtypes(AbstractContinuousSystem))

# this test doesn't apply for second order systems
filter!(x -> x SECOND_ORDER_CTYPES, CTYPES)
Expand Down Expand Up @@ -74,7 +74,7 @@ end

# get affine ctypes
CTYPES = filter(x -> (occursin("Linear", string(x)) || occursin("Affine", string(x))) &&
!occursin("Algebraic", string(x)) , subtypes(AbstractContinuousSystem))
!occursin("Descriptor", string(x)) , subtypes(AbstractContinuousSystem))

# this test doesn't apply for second order systems
filter!(x -> x SECOND_ORDER_CTYPES, CTYPES)
Expand Down

0 comments on commit 8924d8b

Please sign in to comment.