Superposition (Stacking) of ALSSMs [ex101.1]#

Generating two discrete-time autonomous linear state space models and stack them to a single model, generating a two-channel stacked output.

Note that dump_tree() returns the internal structure of the stacked LSSM and helps debugging.

Note: replacing AlssmStacked() by AlssmStackedSO() generates a summed (instead of a stacked) output.

Out:

-- Print --
AlssmStacked(A=[[1.,1.,1.,1.,0.,0.],[0.,1.,2.,3.,0.,0.],[0.,0.,1.,3.,0.,0.],[0.,0.,0.,1.,0.,0.],[0.,0.,0.,0.,1.,1.],[0.,0.,0.,0.,0.,1.]], C=[[1,0,0,0,0,0],[0,0,0,0,1,0]], label=alssm-stacked)

-- Structure --
└-AlssmStacked, A: (6, 6), C: (2, 6), label: alssm-stacked
  └-AlssmPoly, A: (4, 4), C: (4,), label: alssm-polynomial
  └-Alssm, A: (2, 2), C: (2,), label: alssm-line

import lmlib as lm

A = [[1, 1], [0, 1]]
C = [1, 0]
alssm_line = lm.Alssm(A, C, label="alssm-line")

alssm_poly = lm.AlssmPoly(poly_degree=3, label="alssm-polynomial")

# stacking ALSSM
alssm_stacked = lm.AlssmStacked((alssm_poly, alssm_line), label="alssm-stacked")

# print content and structure
print("-- Print --")
print(alssm_stacked)

print("\n-- Structure --")
print(alssm_stacked.dump_tree())

Total running time of the script: ( 0 minutes 0.001 seconds)

Gallery generated by Sphinx-Gallery