Julia 1.10 and higher.
PeriodicMatrices.jl
provides the basic tools to handle periodic time-varying matrices.
The time dependence can be either continuous or discrete.
A continuous-time periodic matrix can be specified in the following forms:
- periodic matrix function
- harmonic matrix series
- periodic matrix time series with uniform time grid
- periodic matrix time series with non-uniform time grid
- periodic symbolic matrix
- Fourier matrix series approximation
A discrete-time periodic matrix can be specified in the following forms:
- periodic matrix time series with time-varying dimensions with uniform time grid
- periodic matrix time series with time-varying dimensions with non-uniform time grid
- periodic matrix time series with constant dimensions with uniform time grid
- periodic matrix time series with constant dimensions with non-uniform time grid
For a periodic matrix A(t)
of period T
it is not assumed that T
is the minimum value
which satisfies the periodicity condition A(t) = A(t+T)
for all values of t
. To describe
matrices having multiple periods, a subperiod Tsub := T/n
can be defined, such that A(t) = A(t+Tsub)
,
for all t
. This allows a substantial memory saving for some classes of periodic representations.
The provided classes of periodic representation extend the classes used in the Periodic Systems Toolbox for Matlab (see [1]).
Several operations on periodic matrices are implemented, such as, inversion, transposing, norms, derivative/shifting, trace. All operations with two periodic matrices such as addition/substraction, multiplication, horizontal/vertical concatenation, block-diagonal appending, allow different, but commensurate, periods/subperiods.
Functions are provided to compute the characteristic multipliers and characteristic exponents of periodic matrices, using methods based on the periodic Schur decomposition of matrix products or structure exploitung fast algorithms. These functions are instrumental to apply Floquet theory to study the properties of solutions of various classes of differential equations (Mathieu, Hill, Meissner) and the stability of linear periodic systems (see PeriodicSystems package).
A frequently encountered periodic differential equation is of second order, expressible as
where
The above equation for
The above equation can be equivalently expressed as a first order system of differential equations, by defining
to recast the second order differential equation into the form
where
The state transition matrix
and the monodromy matrix
The Floquet-theory based stability analysis of the above equations addresses the determination of characteristic multipliers
The solution
In what follows we illustrate how to perform the stability analysis for the three types of equations based on the characteristic multipliers/exponents.
This is Example of Fig 3.1 in [3].
Assume the period is
using PeriodicMatrices
# set parameters
a = 1; q = .1; T = pi
ts = [0; τ; T]
ψ(t,ts) = isodd(findfirst(mod(t,T) .< ts)) ? -1 : 1
# setup of A(t)
A = PeriodicSwitchingMatrix([[0. 1.; -a+2*q*ψ(t,ts) 0] for t in ts[1:end-1]], ts[1:end-1], T)
ce = psceig(A)
# stability test
all(real(ce) .< 0)
The computed characteristic exponents are:
julia> ce
2-element Vector{ComplexF64}:
0.041379744661220644 + 1.0im
-0.0413797446612206 + 1.0im
and therefore the solutions are unstable. The computations can be easily extended to several switching points in
For a lossy Meissner equation, the computations reveal stability:
# setup of A(t)
ζ = 0.2
A = PeriodicSwitchingMatrix([[0. 1.; -a+2*q*ψ(t,ts) -2ζ] for t in ts[1:end-1]], ts[1:end-1], T)
ce = psceig(A)
# stability test
all(real(ce) .< 0)
and
julia> ce
2-element Vector{ComplexF64}:
-0.14798307933724503 + 1.0im
-0.252016920662755 + 1.0im
[1] A. Varga. A Periodic Systems Toolbox for Matlab. Proc. of IFAC 2005 World Congress, Prague, Czech Republic, 2005.
[2] S. Bittanti and P. Colaneri. Periodic Systems - Filtering and Control, Springer Verlag, 2009.
[3] J. A. Richards. Analysis of Periodically Time-Varying Systems, Springer Verlag, 1983.