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 — Scaling difference in impulse response size compared to scipy.signal · Issue #813 · python-control/python-control

Scaling difference in impulse response size compared to scipy.signal #813

New issue
Copy link
New issue
Copy link
Closed
#812
Closed
Scaling difference in impulse response size compared to scipy.signal#813
#812
Copy link

Description

@sawyerbfuller
sawyerbfuller
opened on Dec 10, 2022
Issue body actions

Discussed in #747

Originally posted by fhchl June 29, 2022
I had some code that I wanted to port from using scipy.signal.StateSpace etc. to python-control. There seems to be some scaling difference between the two implementations. What am I overlooking?

import numpy as np
import control
import scipy.signal

# random state space matrices
t= np.linspace(0, 10, dtype=float)
ss = control.drss(3, 2, 1)
A, B, C, D = ss.A, ss.B, ss.C, ss.D
dt = t[1]

# compute impulse response with python-control
ss = control.ss(A, B, C, D, dt=dt)
t_control, h_control = control.impulse_response(ss, T=t)
plt.figure()
plt.plot(t_control, h_control[0, 0])
plt.plot(t_control, h_control[1, 0])

# compute impulse response with scipy.signal
ss_scipy = scipy.signal.StateSpace(A, B, C, D, dt=dt)
t_scipy, (h_scipy,) = scipy.signal.dimpulse(ss_scipy, t=t)
plt.figure()
plt.plot(t_scipy, h_scipy[:, 0])
plt.plot(t_scipy, h_scipy[:, 1])

plt.show()

Creates these two here.

output

output

Activity

  1. sawyerbfuller
    linked a pull request that will close this issueUpdate docstring for impulse for discrete sys #812on Dec 10, 2022
  2. murrayrm
    closed this as completedin #812on Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue 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.