GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — allow complex statespace matrices by bnavigator · Pull Request #484 · python-control/python-control

Conversation

@bnavigator

@bnavigator bnavigator commented Dec 29, 2020

Copy link
Copy Markdown
Contributor

Outsourced from #438, because it is not directly related to the test suite.

To be combined with #376

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bnavigator
allow complex statespace matrices
0fda8c0
@coveralls

coveralls commented Dec 30, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.005%) to 86.624% when pulling 0fda8c0 on bnavigator:complex-statespace into 51c797e on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator bnavigator mentioned this pull request Dec 30, 2020
Release 0.8.4 and 0.9.0 sequencing #451
Closed
@bnavigator bnavigator linked an issue Dec 30, 2020 that may be closed by this pull request
Complex state matrices #371
Open
@roryyorke

roryyorke commented Jan 9, 2021

Copy link
Copy Markdown
Contributor

I suspect this might be quite a lot of work to properly support (see below).

Would we change Slycot to reject complex matrices when real are expected? This might be a good idea anyway.

Would we support TFs with complex coefficients?

In [15]: import control as ct

In [16]: import control.matlab as ml

In [17]: ct.gram(ct.ss(-1-1j, 2, 3, 4), 'o')
/home/rory/.miniconda3/envs/controldev/lib/python3.8/site-packages/slycot/synthesis.py:792: ComplexWarning: Casting complex values to real discards the imaginary part
  out = _wrapper.sb03md(dico,n,C,A,U,job=job,fact=fact,trana=trana,ldwork=ldwork)
Out[17]: matrix([[4.5]])

In [18]: y, t = ml.step(ct.ss(-1-1j, 2, 3, 4)); y[1]
/home/rory/src/python-control/control/timeresp.py:376: ComplexWarning: Casting complex values to real discards the imaginary part
  xout[:, i] = (dot(Ad, xout[:, i-1]) + dot(Bd0, U[:, i-1]) +
Out[18]: 4.26995014112991
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator

bnavigator commented Jan 9, 2021

Copy link
Copy Markdown
Contributor Author

ComplexWarning: Casting complex values to real discards the imaginary part

Also, see discussion in #376. We could set a warning filter making this an error in Slycot.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@murrayrm murrayrm mentioned this pull request Feb 25, 2021
Numpy automatically casting Complex to Float #551
Closed
@bnavigator bnavigator mentioned this pull request Mar 19, 2021
sys.dcgain() should return a real value rather than a complex value (until/unless we support complex coefficients) #578
Closed
@bnavigator bnavigator mentioned this pull request Apr 24, 2021
allow float precision in result assertions #615
Merged
@LSchmerber

LSchmerber commented Sep 3, 2021

Copy link
Copy Markdown

Hi,
First, thanks for this library.
I still have the complex values to float issue when starting matrix creation from complex eigen values and with Rev 0.9.0
image

rico500 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rico500

rico500 commented Aug 29, 2022

Copy link
Copy Markdown

Has the development for this feature been discontinued? Is there a big road-block depending on another package (slycot?)?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lytex

lytex commented Sep 20, 2022

Copy link
Copy Markdown

If I remember correctly, Slycot had some functions that could be easily extended to handle complex cases
#376 (comment)
However,

tb05ad_ng and tb04ad_r are casting complex values to real, but as far as I know it seems there are no complex routine equivalents to these functions

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator

bnavigator commented Sep 21, 2022

Copy link
Copy Markdown
Contributor Author

The main roadblock is probably developer time. I might resuming working on this not earlier than in 2 or 3 months. Contributions from others are always welcome of course.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator bnavigator closed this Feb 18, 2024
@bnavigator
bnavigator deleted the complex-statespace branch February 18, 2024 20:29
@bnavigator
bnavigator restored the complex-statespace branch February 18, 2024 20:32
@bnavigator bnavigator reopened this Feb 18, 2024
@murrayrm murrayrm mentioned this pull request Nov 13, 2024
Complex numbers in state space matrices get cast to real in control.StateSpace(...) constructor - a bug? #1058
Open
@murrayrm murrayrm mentioned this pull request Nov 29, 2025
Unsupported NumPy datatype complex128 #1188
Open
@murrayrm

murrayrm commented Aug 8, 2026

Copy link
Copy Markdown
Member

This draft PR is more than 5 years old. I suggest we close it unless there are plans to rebase and revise.

bnavigator reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator

bnavigator commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

This has to be done and tested from a new base

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator bnavigator closed this Aug 8, 2026
@murrayrm murrayrm mentioned this pull request Aug 14, 2026
Preserve complex StateSpace matrices #1230
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Complex state matrices

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@bnavigator @coveralls @roryyorke @LSchmerber @rico500 @lytex @murrayrm
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — 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.