summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerge Steer <serge.steer@scilab.org>2010-04-16 14:59:17 +0200
committerSerge Steer <serge.steer@scilab.org>2010-04-16 14:59:17 +0200
commitd238528635fedd4de6f41cf693bd7d9e910a9cb7 (patch)
tree26a2610e323353038248de3bf28b4b86ab07523e
parentcfe1255b0c6d0ec553ba4123e7c96a5fe5eead66 (diff)
downloadscilab-d238528635fedd4de6f41cf693bd7d9e910a9cb7.zip
scilab-d238528635fedd4de6f41cf693bd7d9e910a9cb7.tar.gz
bug 6635 fix
Change-Id: Ie9b74e844b2edec7057ef285d6b6d29553b06d25
-rw-r--r--scilab/CHANGES_5.3.X2
-rw-r--r--scilab/modules/cacsd/macros/calfrq.sci2
-rw-r--r--scilab/modules/cacsd/tests/nonreg_tests/bug_6635.dia.ref29
-rw-r--r--scilab/modules/cacsd/tests/nonreg_tests/bug_6635.tst36
4 files changed, 68 insertions, 1 deletions
diff --git a/scilab/CHANGES_5.3.X b/scilab/CHANGES_5.3.X
index 3edd61b..b83bcdc 100644
--- a/scilab/CHANGES_5.3.X
+++ b/scilab/CHANGES_5.3.X
@@ -187,6 +187,8 @@ Bug fixes:
187* bug 6556 fixed - fprintf() returned an error if it's called 2 times (or more) 187* bug 6556 fixed - fprintf() returned an error if it's called 2 times (or more)
188 on the same file. 188 on the same file.
189 189
190* bug 6635 fixed - Incorrectly drawn Bode plots (calfrq bug).
191
190* bug 6682 fixed - mprintf, msprintf, mfprintf did not manage octal (%o) format. 192* bug 6682 fixed - mprintf, msprintf, mfprintf did not manage octal (%o) format.
191 193
192* bug 6740 fixed - It was not possible to launch Scilab as Minimized 194* bug 6740 fixed - It was not possible to launch Scilab as Minimized
diff --git a/scilab/modules/cacsd/macros/calfrq.sci b/scilab/modules/cacsd/macros/calfrq.sci
index 9b99a42..b28f616 100644
--- a/scilab/modules/cacsd/macros/calfrq.sci
+++ b/scilab/modules/cacsd/macros/calfrq.sci
@@ -133,7 +133,7 @@ function [frq,bnds,splitf]=calfrq(h,fmin,fmax)
133 sing=[sing;%sel(roots(denh(i)),fmin,fmax,tol)]; 133 sing=[sing;%sel(roots(denh(i)),fmin,fmax,tol)];
134 end 134 end
135 135
136 pp=gsort(sing');npp=size(pp,'*');//' 136 pp=gsort(sing','g','i');npp=size(pp,'*');//'
137 137
138 // singularities just on the left of the range 138 // singularities just on the left of the range
139 kinf=find(pp<fmin) 139 kinf=find(pp<fmin)
diff --git a/scilab/modules/cacsd/tests/nonreg_tests/bug_6635.dia.ref b/scilab/modules/cacsd/tests/nonreg_tests/bug_6635.dia.ref
new file mode 100644
index 0000000..aab1d59
--- /dev/null
+++ b/scilab/modules/cacsd/tests/nonreg_tests/bug_6635.dia.ref
@@ -0,0 +1,29 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2010 - INRIA - Serge Steer
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- Non-regression test for bug 6635 -->
8//
9// <-- Bugzilla URL -->
10// http://bugzilla.scilab.org/show_bug.cgi?id=6635
11//
12// <-- Short Description -->
13// Incorrectly drawn Bode plots (calfrq bug).
14num=real(poly([0.75788802401980426;-0.74488662950015194;0.71042740727148268+%i*0.32150242887306801;
15 0.71042740727148268-%i*0.32150242887306801;0.88108463001435433;
16 0.65688756930625614+%i*0.70651639282163481;0.65688756930625614-%i*0.70651639282163481;
17 0.87396240470428910+%i*0.38544888973757035;0.87396240470428910-%i*0.38544888973757035;
18 0.96638845127253781+%i*0.20986303449468094;0.96638845127253781-%i*0.20986303449468094;
19 0.99463810059227120+%i*0.1259837606842592;0.99463810059227120-%i*0.1259837606842592;
20 -8.33517712317947712],'z'));
21den=real(poly([0.44209498830922006+%i*0.58376435045145136;0.44209498830922006-%i*0.58376435045145136;
22 0.74984178464015416+%i*0.23826316198364383;0.74984178464015416-%i*0.23826316198364383;
23 0.88908657183242579;0.78005500218689083;0.73910333806015660+%i*0.66143232274074371;
24 0.73910333806015660-%i*0.66143232274074371;0.91630828475086279+%i*0.37654428560847641;
25 0.91630828475086279-%i*0.37654428560847641;0.97669896242019394+%i*0.19145035111644124;
26 0.97669896242019394-%i*0.19145035111644124;0.98956694435920334+%i*0.09896014014807389;
27 0.98956694435920334-%i*0.09896014014807389],'z'));
28[frq,bnds,splitf]=calfrq(rlist(num,den,0.00999897500976181),1,10);
29if or(diff(frq)<0) then bugmes();quit;end
diff --git a/scilab/modules/cacsd/tests/nonreg_tests/bug_6635.tst b/scilab/modules/cacsd/tests/nonreg_tests/bug_6635.tst
new file mode 100644
index 0000000..d563c57
--- /dev/null
+++ b/scilab/modules/cacsd/tests/nonreg_tests/bug_6635.tst
@@ -0,0 +1,36 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2010 - INRIA - Serge Steer
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7
8// <-- Non-regression test for bug 6635 -->
9//
10// <-- Bugzilla URL -->
11// http://bugzilla.scilab.org/show_bug.cgi?id=6635
12//
13// <-- Short Description -->
14// Incorrectly drawn Bode plots (calfrq bug).
15
16num=real(poly([0.75788802401980426;-0.74488662950015194;0.71042740727148268+%i*0.32150242887306801;
17 0.71042740727148268-%i*0.32150242887306801;0.88108463001435433;
18 0.65688756930625614+%i*0.70651639282163481;0.65688756930625614-%i*0.70651639282163481;
19 0.87396240470428910+%i*0.38544888973757035;0.87396240470428910-%i*0.38544888973757035;
20 0.96638845127253781+%i*0.20986303449468094;0.96638845127253781-%i*0.20986303449468094;
21 0.99463810059227120+%i*0.1259837606842592;0.99463810059227120-%i*0.1259837606842592;
22 -8.33517712317947712],'z'));
23
24
25
26den=real(poly([0.44209498830922006+%i*0.58376435045145136;0.44209498830922006-%i*0.58376435045145136;
27 0.74984178464015416+%i*0.23826316198364383;0.74984178464015416-%i*0.23826316198364383;
28 0.88908657183242579;0.78005500218689083;0.73910333806015660+%i*0.66143232274074371;
29 0.73910333806015660-%i*0.66143232274074371;0.91630828475086279+%i*0.37654428560847641;
30 0.91630828475086279-%i*0.37654428560847641;0.97669896242019394+%i*0.19145035111644124;
31 0.97669896242019394-%i*0.19145035111644124;0.98956694435920334+%i*0.09896014014807389;
32 0.98956694435920334-%i*0.09896014014807389],'z'));
33
34
35[frq,bnds,splitf]=calfrq(rlist(num,den,0.00999897500976181),1,10);
36if or(diff(frq)<0) then pause,end