GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Casting complex number to float · Issue #1141 · python-control/python-control Closed DescriptionCode to reproduce the problem: sys = ctrl.zpk([], [1j], 1) plt.figure(figsize=(8, 6)) ctrl.root_locus(sys, color='red') #<-- Problem is here plt.xlabel('Real Axis (σ)') plt.ylabel('Imaginary Axis (jω)') plt.grid(True) plt.show() In the diagram, you can see the pole is placed at the wrong location. but I looked into it and found a quick solution (though I am not familiar with the code, and it might be deeper than I found) in the files xferfcn.py (lines 1068, and 1072) there are two arrays that are created of type Then another issue arises in plocus.py (line 267), if the coefficients are complex, it is again casted into a float. I am not sure what this value is used for, but I believe this can be fixed by casting the input type to complex if it isn't already, then using the magnitude of the complex number instead of casting it, which I believe the abs() function will do for default python Should be an easy fix, hope this helps Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |