Repository navigation
control.rlocus kwarg klist->gains #324
Copy link
Copy link
Closed
Description
pymoca/test/notebooks/Spring.ipynb
Line 1265 in 9d597d7
| "control.rlocus(ss[0,0], klist=pl.logspace(-2,1,1000));\n", |
raises
TypeError Traceback (most recent call last)
Cell In[29], [line 1](vscode-notebook-cell:?execution_count=29&line=1)
----> [1](vscode-notebook-cell:?execution_count=29&line=1) control.rlocus(ss[0,0], klist=pl.logspace(-2,1,1000));
[2](vscode-notebook-cell:?execution_count=29&line=2) pl.grid()
File c:\Users\G.McBain\.venv\pymoca\Lib\site-packages\control\rlocus.py:188, in root_locus_plot(sysdata, kvect, grid, plot, **kwargs)
[185](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/rlocus.py:185) return responses.loci, responses.gains
[187](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/rlocus.py:187) # Plot the root loci
--> [188](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/rlocus.py:188) out = responses.plot(grid=grid, **kwargs)
[190](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/rlocus.py:190) # Legacy processing: return locations of poles and zeros as a tuple
[191](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/rlocus.py:191) if plot is True:
File c:\Users\G.McBain\.venv\pymoca\Lib\site-packages\control\pzmap.py:127, in PoleZeroData.plot(self, *args, **kwargs)
[123](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/pzmap.py:123) kwargs = kwargs.copy()
[124](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/pzmap.py:124) kwargs['grid'] = config._get_param(
[125](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/pzmap.py:125) 'rlocus', 'grid', kwargs.get('grid', None), _rlocus_defaults)
--> [127](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/pzmap.py:127) return pole_zero_plot(self, *args, **kwargs)
File c:\Users\G.McBain\.venv\pymoca\Lib\site-packages\control\pzmap.py:261, in pole_zero_plot(data, plot, grid, title, marker_color, marker_size, marker_width, legend_loc, xlim, ylim, interactive, ax, scaling, initial_gain, **kwargs)
[259](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/pzmap.py:259) marker_width = config._get_param('pzmap', 'marker_width', marker_width, 1.5)
[260](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/pzmap.py:260) xlim_user, ylim_user = xlim, ylim
--> [261](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/pzmap.py:261) freqplot_rcParams = config._get_param(
[262](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/pzmap.py:262) 'freqplot', 'rcParams', kwargs, _freqplot_defaults,
[263](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/pzmap.py:263) pop=True, last=True)
[264](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/pzmap.py:264) user_ax = ax
[266](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/pzmap.py:266) # If argument was a singleton, turn it into a tuple
File c:\Users\G.McBain\.venv\pymoca\Lib\site-packages\control\config.py:204, in _get_param(module, param, argval, defval, pop, last)
[202](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/config.py:202) val = argval.pop(param, None) if pop else argval.get(param, None)
[203](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/config.py:203) if last and argval:
--> [204](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/config.py:204) raise TypeError("unrecognized keywords: " + str(argval))
[205](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/config.py:205) argval = val
[207](file:///C:/Users/G.McBain/.venv/pymoca/Lib/site-packages/control/config.py:207) # If we were passed a dict for the defval, get the param value from thereThe upstream documentation is inconsistent; see python-control/python-control#998, suggesting that replacing klist with kvect should do the trick. It does.
control.rlocus(ss[0,0], kvect=pl.logspace(-2,1,1000));Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

Activity
control.rlocus wants kvect not klist pymoca#324
bnavigator commentedon May 9, 2024
As your own title says, this
kvectwill be deprecated in favor ofgainsfor the next release.gdmcbain commentedon May 10, 2024
Right, yes, sorry, (as noted in python-control/python-control#998) I thought
control.rlocuswascontrol.matlab.wrappers.rlocusrather thancontrol.rlocus.rlocus = control.rlocus.root_locus_plot.klist->gains pymoca#324
klist->kvect pymoca#324
control==0.10.0 pymoca#324
examples/Spring: Fix wrong keyword to control.locus kist->kvect
examples/Spring: Fix wrong keyword to control.locus kist->kvect
examples/Spring: Fix wrong keyword to control.locus kist->kvect