Skip to content

plotting example mimo system #959

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
hariharan382 opened this issue Jan 5, 2024 · 1 comment
Closed

plotting example mimo system #959

hariharan382 opened this issue Jan 5, 2024 · 1 comment
Labels

Comments

@hariharan382
Copy link

hariharan382 commented Jan 5, 2024

Hi All I am trying is to run the example mimo plotting in docs (0.9.4) , my version of the control pkg is 0.9.4, I could not plot the example code as below

sys1 = ct.tf([1], [1, 2, 1], name='sys1')
sys2 = ct.tf([1, 0.2], [1, 1, 3, 1, 1], name='sys2')
response = ct.frequency_response([sys1, sys2])

ct.bode_plot(response, initial_phase=0)

but getting error

File "C:\Users\user\OneDrive\Documents\2_dof_control_systems python\src\trial.py", line 21, in <module> ct.bode_plot(response, initial_phase=0) File "C:\Users\user\miniforge3\envs\control_env\Lib\site-packages\control\freqplot.py", line 214, in bode_plot omega, omega_range_given = _determine_omega_vector( ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\miniforge3\envs\control_env\Lib\site-packages\control\freqplot.py", line 1593, in _determine_omega_vector omega_out = _default_frequency_range( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\miniforge3\envs\control_env\Lib\site-packages\control\freqplot.py", line 1666, in _default_frequency_range if sys.isctime(): ^^^^^^^^^^^ AttributeError: 'TimeResponseData' object has no attribute 'isctime'

I could not plot any example as mention in docs below
https://python-control.readthedocs.io/en/latest/plotting.html#response-functions

some times, it complains omega is required from frequency_response, but in "frequency_response" method omega is optional , I don't where is the problem

@murrayrm
Copy link
Member

murrayrm commented Jan 6, 2024

A couple of issues:

Ways to fix the problem:

  • If you want to stick with version 0.9.4, you can generate a bode plot using bode_plot([sys1, sys2]).
  • If you want to use the update _response/_plot pattern, checkout the main branch on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants