[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #62185] Function 'impulse' throws error for a
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #62185] Function 'impulse' throws error for a certain simple 'ss' system |
Date: |
Mon, 14 Mar 2022 22:40:40 -0400 (EDT) |
URL:
<https://savannah.gnu.org/bugs/?62185>
Summary: Function 'impulse' throws error for a certain simple
'ss' system
Project: GNU Octave
Submitted by: None
Submitted on: Tue 15 Mar 2022 02:40:39 AM UTC
Category: Octave Forge Package
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: Chris
Originator Email: ccarter@tmt.org
Open/Closed: Open
Release: 6.4.0
Discussion Lock: Any
Operating System: Microsoft Windows
_______________________________________________________
Details:
The function 'impulse' throws an error when computing the impulse response of
a second order state-space model. Here is the relevant code:
% Initialization
m = 1.0 % Mass
k = 10.0 % Spring constant
b = 1 % Damping constant
% State-space model of the mass-spring-damper system
A = [0 1;...
-k/m -b/m]
B = [0;...
-1/m]
C = [1 0;...
0 1;...
-k/m -b/m]
D = [0;
0;
-1/m]
states = {'Position' 'Velocity'}
inputs = {'Force'}
outputs = {'Position' 'Velocity' 'Acceleration'}
system = ss(A,B,C,D,'statename',states,...
'inputname', inputs,...
'outputname', outputs)
% Time-domain responses
% Impulse responses
figure()
impulse(system(1,1))
figure()
impulse(system(2,1))
figure()
impulse(system(3,1))
The third impulse response fails to produce an output and throws the following
error:
error: Order numerator >= order denominator
error: called from
imp_invar at line 95 column 5
__c2d__ at line 65 column 16
c2d at line 87 column 7
__time_response__ at line 134 column 13
impulse at line 79 column 13
mass_spring_damper_ss_demo_01 at line 51 column 1
>>
For reference, Matlab (version info below) is able to compute the same impulse
response without crashing.
MATLAB Version: 9.11.0.1687835 (R2021b) Prerelease
MATLAB License Number: 865865
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19044)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM)
64-Bit Server VM mixed mode
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62185>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #62185] Function 'impulse' throws error for a certain simple 'ss' system,
anonymous <=