Commit 8821978
committed
2 fixes. 1st fix: the m_nr branch which is meant to handle negative reals takes the -1 root and uses the p_nr case causes t_emp to become infinite due to ln|p|=0 causing a division by zero and a RuntimeWarning. FIX exclude |p|=1 so they use the m_w case which uses cycle counting formula which is appropriate for unit circle poles.
2nd fix: The m_int case used p.real -1 <sqrt_eps instead of np.abs (p.real-1)<sqrt_eps. Without abs any pole with Re(p) < 1 were matched rather than just poles near +1 causing stable poles like 0.95 to be discarded as discrete integrators. I updated the corresponding test to have the expected value to match the correct result.
Fixes #1204.1 parent 146ccee commit 8821978
2 files changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
817 | 820 | | |
818 | 821 | | |
819 | 822 | | |
820 | | - | |
| 823 | + | |
821 | 824 | | |
822 | 825 | | |
823 | 826 | | |
| |||
826 | 829 | | |
827 | 830 | | |
828 | 831 | | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
829 | 840 | | |
830 | 841 | | |
831 | 842 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2172 | 2172 | | |
2173 | 2173 | | |
2174 | 2174 | | |
2175 | | - | |
| 2175 | + | |
2176 | 2176 | | |
2177 | 2177 | | |
2178 | 2178 | | |
2179 | 2179 | | |
2180 | 2180 | | |
| 2181 | + | |
2181 | 2182 | | |
2182 | 2183 | | |
2183 | 2184 | | |
| |||
0 commit comments