Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Scaling difference in impulse response compared to scipy.signal#747

Answeredbybnavigator
fhchl asked this question inQ&A
Discussion options

I had some code that I wanted to port from usingscipy.signal.StateSpace etc. topython-control. There seems to be some scaling difference between the two implementations. What am I overlooking?

importnumpyasnpimportcontrolimportscipy.signal# random state space matricest=np.linspace(0,10,dtype=float)ss=control.drss(3,2,1)A,B,C,D=ss.A,ss.B,ss.C,ss.Ddt=t[1]# compute impulse response with python-controlss=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.signalss_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

You must be logged in to vote

python-control computes the response to a unit area impulse, rather than a unit height impulse:#447

Replies: 1 comment 2 replies

Comment options

python-control computes the response to a unit area impulse, rather than a unit height impulse:#447

You must be logged in to vote
2 replies
@fhchl
Comment options

That's a subtle and important detail.Thanks! Would it make sense to document this in impulse_response's docstring or am I just too ignorant of this common concept?

@bnavigator
Comment options

I think it would totally make sense to mention it in the docs.

Answer selected byfhchl
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@fhchl@bnavigator

[8]ページ先頭

©2009-2025 Movatter.jp