Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: No dt in StateSpace operations #9913

Closed
AndyLamperski opened this issue Mar 7, 2019 · 0 comments · Fixed by #12092
Closed

BUG: No dt in StateSpace operations #9913

AndyLamperski opened this issue Mar 7, 2019 · 0 comments · Fixed by #12092
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.signal
Milestone

Comments

@AndyLamperski
Copy link

When adding or multiplying discrete-time StateSpace systems, the "dt" gets dropped, so that they become continuous time systems.

Reproducing code example:

M = np.ones((1,1))

P1 = sig.StateSpace(M,M,M,M,dt=1)
P2 = sig.StateSpace(M,M,M,M,dt=1)
P3 = P1 + P2
print(P1.dt,P2.dt,P3.dt)

This gives an output of

1 1 None

I think that all that is needed is to fix add the "dt" to the return statements of add, mul, and so on:

        return StateSpace(np.asarray(a, dtype=common_dtype),
                          np.asarray(b, dtype=common_dtype),
                          np.asarray(c, dtype=common_dtype),
                          np.asarray(d, dtype=common_dtype),
                          dt=self.dt)

However, I can't get the github scipy to compile correctly (due to #8325), so I have not tested this.

Scipy/Numpy/Python version information:

import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)
1.2.1 1.14.3 sys.version_info(major=3, minor=6, micro=8, releaselevel='final', serial=0)
@ilayn ilayn added defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.signal labels Mar 8, 2019
@larsoner larsoner added this to the 1.5.0 milestone May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.signal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants