| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a775479 commit f91f372
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -188,7 +188,9 @@ def root_locus_plot( | |||
| 188 | 188 | if isinstance(sysdata, list) and all( | |
| 189 | 189 | [isinstance(sys, LTI) for sys in sysdata]) or \ | |
| 190 | 190 | isinstance(sysdata, LTI): | |
| 191 | - responses = root_locus_map(sysdata, gains=gains) | ||
| 191 | + responses = root_locus_map( | ||
| 192 | + sysdata, gains=gains, xlim=kwargs.get('xlim'), | ||
| 193 | + ylim=kwargs.get('ylim')) | ||
| 192 | 194 | else: | |
| 193 | 195 | responses = sysdata | |
| 194 | 196 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -180,6 +180,19 @@ def test_root_locus_plots(sys, grid, xlim, ylim, interactive): | |||
| 180 | 180 | # TODO: add tests to make sure everything "looks" OK | |
| 181 | 181 | ||
| 182 | 182 | ||
| 183 | + @pytest.mark.usefixtures("mplcleanup") | ||
| 184 | + def test_root_locus_plot_initial_limits_refine_gains(): | ||
| 185 | + sys = ct.tf([1000], [1, 25, 100, 0]) | ||
| 186 | + xlim = (-10.813628105112421, 14.760795435937652) | ||
| 187 | + ylim = (-35.61713798641108, 33.879716621220311) | ||
| 188 | + | ||
| 189 | + cplt = ct.root_locus_plot( | ||
| 190 | + sys, grid=False, xlim=xlim, ylim=ylim, interactive=False) | ||
| 191 | + expected = ct.root_locus_map(sys, xlim=xlim, ylim=ylim) | ||
| 192 | + | ||
| 193 | + assert len(cplt.lines[0, 2][0].get_xdata()) == len(expected.gains) | ||
| 194 | + | ||
| 195 | + | ||
| 183 | 196 | # Test deprecated keywords | |
| 184 | 197 | @pytest.mark.parametrize("keyword", ["kvect", "k"]) | |
| 185 | 198 | @pytest.mark.usefixtures("mplcleanup") | |
| Back | FazBrowse Home | New Git URL |
0 commit comments