Skip to content

Problems with baltrunc #479

@olof3

Description

@olof3

As reported by @ma-laforge in #298, there are some problems with baltrunc

A = diagm([-1.0, -2, -3])
B = [1 2; 3 4; 5 6]
C = [1 2 3]
D = [1 -1]
sys = ss(A, B, C, D)
julia> baltrunc(sys)
ERROR: The number of columns of B (2) and D (1) are not equal

The problem is the following line

if unitgain
    D = D/(C*inv(-A)*B)
end

The implementation of baltrunc does not seems consistent with the section on model reduction in the given reference (Glad & Ljung), so I am not sure what the fix would be. I guess one solution would be just to update the whole function according to the reference. Do you remember anything about this @baggepinnen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions