Skip to content

create_statefbk_iosystem sets system name incorrectly #848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
murrayrm opened this issue Jan 14, 2023 · 3 comments · Fixed by #849 or #857
Closed

create_statefbk_iosystem sets system name incorrectly #848

murrayrm opened this issue Jan 14, 2023 · 3 comments · Fixed by #849 or #857
Assignees

Comments

@murrayrm
Copy link
Member

The create_statefbk_iosystem sets the name of the closed loop system that it creates to one of the system inputs. For example:

import numpy as np
import control as ct
sys = ct.ss([[0, 10], [-1, 0]], [[0], [1]], np.eye(2), 0, name='sys')
K, _, _ = ct.lqr(sys, np.eye(sys.nstates), np.eye(sys.ninputs))
ctrl, clsys = ct.create_statefbk_iosystem(sys, K)
print(clsys)

gives

<LinearICSystem>: u[0]
Inputs (3): ['xd[0]', 'xd[1]', 'ud[0]']
Outputs (3): ['y[0]', 'y[1]', 'u[0]']
States (2): ['sys_x[0]', 'sys_x[1]']

which has the name of the system as u[0] instead of something like sys[3].

@murrayrm murrayrm self-assigned this Jan 14, 2023
@murrayrm murrayrm linked a pull request Jan 14, 2023 that will close this issue
@henklaak
Copy link
Contributor

henklaak commented Feb 1, 2023

Problem is in the iosys.py 2871, where 'name' variable gets clobbered.

Submitted PR.

@henklaak
Copy link
Contributor

henklaak commented Feb 2, 2023

Close?

@bnavigator
Copy link
Contributor

Closed by #857

@bnavigator bnavigator linked a pull request Feb 2, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants