belson17 / modred

Modred main repository
BSD 2-Clause "Simplified" License
78 stars 38 forks source link

balanced truncation order issue #25

Closed shaesaert closed 4 years ago

shaesaert commented 7 years ago

There seems to be an error in the balanced_truncation function (modred.util), it does not take orders that are lower than Len(E).

It can be fixed by changing: https://github.com/belson17/modred/blob/c84f67afe03fd1f18fdd7bb99e964c3c11a2040b/modred/util.py#L481

to

SL = Lo.dot(U[:,:order]).dot(np.diag(E[:order]**-0.5))
SR = Lc.dot(V[:,:order]).dot(np.diag(E[:order]**-0.5))
belson17 commented 7 years ago

Thanks for catching this. I'll create an issue in github and we should have it fixed in the next release. Best, Brandt

On Thu, Oct 12, 2017 at 5:54 PM, shaesaert notifications@github.com wrote:

There seems to be an error in the balanced_truncation function (modred.util), it does not take orders that are lower than Len(E).

It can be fixed by changing: https://github.com/belson17/modred/blob/c84f67afe03fd1f18fdd7bb99e964c 3c11a2040b/modred/util.py#L481

to

SL = Lo.dot(U[:,:order]).dot(np.diag(E[:order]-0.5))SR = Lc.dot(V[:,:order]).dot(np.diag(E[:order]-0.5))

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/belson17/modred/issues/25, or mute the thread https://github.com/notifications/unsubscribe-auth/AE44J4EelOQ7SHRB4q6ln5n9Fj8hSmhjks5srrTigaJpZM4P31GL .