* Bug #8162 fixed - Area of stability of plzr was wrong for continuous systems (... 13/11313/2
Charlotte HECQUET [Thu, 18 Apr 2013 11:41:54 +0000 (13:41 +0200)]
Change-Id: Iff51b473ed9f6492753235666e664a51eb33e81b

scilab/CHANGES_5.5.X
scilab/modules/cacsd/macros/plzr.sci
scilab/modules/cacsd/tests/nonreg_tests/bug_8162.dia.ref [new file with mode: 0644]
scilab/modules/cacsd/tests/nonreg_tests/bug_8162.tst [new file with mode: 0644]
scilab/modules/cacsd/tests/unit_tests/plzr.dia.ref [new file with mode: 0644]
scilab/modules/cacsd/tests/unit_tests/plzr.tst [new file with mode: 0644]

index b3df14a..6eb3d9f 100644 (file)
@@ -89,6 +89,8 @@ Bug fixes
 
 * Bug #8607 fixed - Some error messages in modules/overloading/macros were not standard and not localized.
 
+* Bug #8162 fixed - Area of stability of plzr was wrong for continuous systems (+unit test added).
+
 * Bug #8667 fixed - Handling of %nan in functions min,max,median is not correctly documented.
 
 * Bug #8680 fixed - Output argument "end" of the regexp function has been changed.
index a575363..ce3371d 100644 (file)
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function plzr(a,b,c,d)
-//
-// Copyright INRIA
-  [lhs,rhs]=argn(0)
+    //
+    // Copyright INRIA
+    [lhs,rhs]=argn(0)
 
-  if rhs == 0 then
-    s=poly(0,'s');
-    n=[1+s, 2+3*s+4*s^2, 5;0, 1-s, s];
-    d=[1+3*s, 5-s^3, s+1;1+s, 1+s+s^2, 3*s-1];
-    h=syslin('c',n./d); 
-    plzr(h);
-    return;
-  end
-
-  select typeof(a)
-  case 'rational' then
-    if rhs<>1 then 
-      error(msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"),"plzr",1)),
-    end
-    a=tf2ss(a),
-    [a,b,c,d]=a(2:5)
-    if type(d)<>1 then 
-      error(msprintf(gettext("%s: Wrong value of input argument %d: Proper system expected.\n"),"plzr",1));
-    end
-  case 'state-space' then
-    if rhs<>1 then 
-      error(msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"),"plzr",1)),
+    if rhs == 0 then
+        s=poly(0,'s');
+        n=[1+s, 2+3*s+4*s^2, 5;0, 1-s, s];
+        d=[1+3*s, 5-s^3, s+1;1+s, 1+s+s^2, 3*s-1];
+        h=syslin('c',n./d); 
+        plzr(h);
+        return;
     end
-    [a,b,c,d]=a(2:5)
-    if type(d)<>1 then 
-      error(msprintf(gettext("%s: Wrong value of input argument %d: Proper system expected.\n"),"plzr",1));
-    end
-  case 'constant' then
-    if rhs<>4 then 
-      error(msprintf(gettext("%s: Wrong number of input argument: %d expected.\n"),"plzr",4)),
+
+    select typeof(a)
+    case 'rational' then
+        if rhs<>1 then 
+            error(msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"),"plzr",1)),
+        end
+        a=tf2ss(a),
+        dt=a.dt;
+        [a,b,c,d]=a(2:5)
+        if type(d)<>1 then 
+            error(msprintf(gettext("%s: Wrong value of input argument %d: Proper system expected.\n"),"plzr",1));
+        end
+    case 'state-space' then
+        if rhs<>1 then 
+            error(msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"),"plzr",1)),
+        end
+        dt=a(7);
+        [a,b,c,d]=a(2:5)
+        if type(d)<>1 then 
+            error(msprintf(gettext("%s: Wrong value of input argument %d: Proper system expected.\n"),"plzr",1));
+        end
+    case 'constant' then
+        if rhs<>4 then 
+            error(msprintf(gettext("%s: Wrong number of input argument: %d expected.\n"),"plzr",4)),
+        end
+        if type(d)<>1 then 
+            error(msprintf(gettext("%s: Wrong type for input argument #%d: Array of floating point numbers expected.\n"),..
+            "plzr",4));
+        end
+        dt=[];
+    else
+        if rhs==1 then
+            error(msprintf(gettext("%s: Wrong type for input argument #%d: Linear dynamical system expected.\n"),"plzr",1))
+        else
+            error(msprintf(gettext("%s: Wrong type of input argument #%d: Array of floating point numbers expected.\n"),"plzr",1))
+        end
     end
     if type(d)<>1 then 
-      error(msprintf(gettext("%s: Wrong type for input argument #%d: Array of floating point numbers expected.\n"),..
-                    "plzr",4));
+        error(msprintf(gettext("%s: Wrong type for input argument #%d: Array of floating point numbers expected.\n"),..
+        "plzr",4));
     end
 
-  else
-    if rhs==1 then
-      error(msprintf(gettext("%s: Wrong type for input argument #%d: Linear dynamical system expected.\n"),"plzr",1))
-    else
-      error(msprintf(gettext("%s: Wrong type of input argument #%d: Array of floating point numbers expected.\n"),"plzr",1))
+    dr=spec(a)
+    [al,be]=tr_zer(a,b,c,d)
+    nr=al./be
+    ni=imag(nr);nr=real(nr)
+    di=imag(dr);dr=real(dr)
+    //
+    mxx=max([nr;dr;1]*1.1)
+    mnx=min([nr;dr;-1]*1.1)
+    my=max(abs([ni;di;1])*1.1)
+
+    rect=[mnx, -my, mxx, my];
+
+    wdim=get(gcf(),'axes_size')
+    dx=(mxx-mnx)/wdim(1);dy=2*my/wdim(2)
+    if dy>dx then 
+        ax=(dy*wdim(1)-mxx+mnx)/2
+        mxx=mxx+ax;mnx=mnx-ax
+    elseif dy<dx then
+        ay=(dx*wdim(2)-2*my)/2
+        my=my+ay
     end
-  end
-  if type(d)<>1 then 
-    error(msprintf(gettext("%s: Wrong type for input argument #%d: Array of floating point numbers expected.\n"),..
-                  "plzr",4));
-  end
+    rect=[mnx, -my, mxx, my];
 
+    fig=gcf();
+    immediate_drawing=fig.immediate_drawing;
+    fig.immediate_drawing="off";
 
-  dr=spec(a)
-  [al,be]=tr_zer(a,b,c,d)
-  nr=al./be
-  ni=imag(nr);nr=real(nr)
-  di=imag(dr);dr=real(dr)
-  //
-  mxx=max([nr;dr;1]*1.1)
-  mnx=min([nr;dr;-1]*1.1)
-  my=max(abs([ni;di;1])*1.1)
-  rect=[mnx, -my, mxx, my];
+    ax=gca();
+    ax.data_bounds=[mnx, -my; mxx, my];
+    ax.axes_visible='on';
 
-  wdim=get(gcf(),'axes_size')
-  dx=(mxx-mnx)/wdim(1);dy=2*my/wdim(2)
-  if dy>dx then 
-    ax=(dy*wdim(1)-mxx+mnx)/2
-    mxx=mxx+ax;mnx=mnx-ax
-  elseif dy<dx then
-    ay=(dx*wdim(2)-2*my)/2
-    my=my+ay
-  end
-  rect=[mnx, -my, mxx, my];
-  
-  fig=gcf();
-  immediate_drawing=fig.immediate_drawing;
-  fig.immediate_drawing="off";
+    legs=[],lhandle=[]
+    if size(nr,'*')<>0 then
+        xpoly(nr,ni)
+        e=gce();e.line_mode='off';e.mark_mode='on';
+        e.mark_size_unit="point";e.mark_size=7;e.mark_style=5;
+        legs=[legs;gettext("Zeros")]
+        lhandle=[e;lhandle]
+    end;
+    if size(dr,'*')<>0 then
+        xpoly(dr,di)
+        e=gce();e.line_mode='off';e.mark_mode='on';
+        e.mark_size_unit="point";e.mark_size=7;e.mark_style=2;
+        legs=[legs;gettext("Poles")]
+        lhandle=[e;lhandle]
+    end
+    if dt == 'd' then
+        ax.grid=ones(1,3)*color('gray')
+        ax.box = "on";
+        xarc(-1,1,2,2,0,360*64)
+        xtitle(gettext("Transmission zeros and poles"),gettext("Real axis"), ...
+        gettext("Imaginary axis"));
+    else
+        ax.grid=ones(1,3)*color('gray')
+        ax.box = "on";
+        ymin=ax.data_bounds(1,2);
+        ymax=ax.data_bounds(2,2);
+        xsegs([0,0],[ymin,ymax])
+        xtitle(gettext("Transmission zeros and poles"),gettext("Real axis"), ...
+        gettext("Imaginary axis"));
+    end
 
-  ax=gca();
-  ax.data_bounds=[mnx, -my; mxx, my];
-  ax.axes_visible='on';
-  legs=[],lhandle=[]
-  if size(nr,'*')<>0 then
-    xpoly(nr,ni)
-    e=gce();e.line_mode='off';e.mark_mode='on';
-    e.mark_size_unit="point";e.mark_size=7;e.mark_style=5;
-    legs=[legs;gettext("Zeros")]
-    lhandle=[e;lhandle]
-  end;
-  if size(dr,'*')<>0 then
-    xpoly(dr,di)
-    e=gce();e.line_mode='off';e.mark_mode='on';
-    e.mark_size_unit="point";e.mark_size=7;e.mark_style=2;
-    legs=[legs;gettext("Poles")]
-    lhandle=[e;lhandle]
-  end
-  ax.grid=ones(1,3)*color('gray')
-  ax.box = "on";
-  xarc(-1,1,2,2,0,360*64)
-  xtitle(gettext("Transmission zeros and poles"),gettext("Real axis"), ...
-        gettext("Imaginary axis"));
-  if legs<>[] then legend(lhandle,legs,1),end
-  fig.immediate_drawing=immediate_drawing;
-  show_window();
+    if legs<>[] then legend(lhandle,legs,1),end
+    fig.immediate_drawing=immediate_drawing;
+    show_window();
 endfunction
diff --git a/scilab/modules/cacsd/tests/nonreg_tests/bug_8162.dia.ref b/scilab/modules/cacsd/tests/nonreg_tests/bug_8162.dia.ref
new file mode 100644 (file)
index 0000000..73fa768
--- /dev/null
@@ -0,0 +1,26 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- TEST WITH GRAPHIC -->
+//
+// <-- Non-regression test for bug 8162 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=8162
+//
+// <-- Short Description -->
+// Area of stability in continuous is wrong
+s=poly(0,'s');
+n=[1+s   2+3*s+4*s^2        5; 0        1-s             s];
+d=[1+3*s   5-s^3           s+1;1+s     1+s+s^2      3*s-1];
+h=syslin('c',n./d); 
+assert_checktrue(execstr("plzr(h)","errcatch")==0);
+fig=gcf();
+ax=fig.children;
+assert_checktrue(ax.children(2).type=='Segs');
+assert_checktrue(ax.children(2).data-[0,-1.6289709;0,1.6289709]<1d-5);
+close
diff --git a/scilab/modules/cacsd/tests/nonreg_tests/bug_8162.tst b/scilab/modules/cacsd/tests/nonreg_tests/bug_8162.tst
new file mode 100644 (file)
index 0000000..9306600
--- /dev/null
@@ -0,0 +1,27 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- TEST WITH GRAPHIC -->
+//
+// <-- Non-regression test for bug 8162 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=8162
+//
+// <-- Short Description -->
+// Area of stability in continuous is wrong
+
+s=poly(0,'s');
+n=[1+s   2+3*s+4*s^2        5; 0        1-s             s];
+d=[1+3*s   5-s^3           s+1;1+s     1+s+s^2      3*s-1];
+h=syslin('c',n./d); 
+assert_checktrue(execstr("plzr(h)","errcatch")==0);
+fig=gcf();
+ax=fig.children;
+assert_checktrue(ax.children(2).type=='Segs');
+assert_checktrue(ax.children(2).data-[0,-1.6289709;0,1.6289709]<1d-5);
+close
diff --git a/scilab/modules/cacsd/tests/unit_tests/plzr.dia.ref b/scilab/modules/cacsd/tests/unit_tests/plzr.dia.ref
new file mode 100644 (file)
index 0000000..4c37488
--- /dev/null
@@ -0,0 +1,135 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH GRAPHIC -->
+//
+// <-- ENGLISH IMPOSED -->
+//
+// Unit tests for plzr()
+function checkplzr(h,zrs,pls)
+    if typeof(h)=='rational' then
+        plzr(h);
+        h=tf2ss(h);
+        [a,b,c,d]=h(2:5);
+        dt=h.dt;
+    elseif typeof(h)=='state-space' then
+        plzr(h);
+        [a,b,c,d]=h(2:5)
+        dt=h.dt;
+    else
+        plzr(h(1),h(2),h(3),h(4));
+        a=h(1);
+        b=h(2);
+        c=h(3);
+        d=h(4);
+        dt=[];
+    end
+    fig=gcf();
+    ax=fig.children;
+    dr=spec(a)
+    [al,be]=tr_zer(a,b,c,d)
+    nr=al./be;
+    nr=real(nr);
+    dr=real(dr);
+    //nb_child=size
+    assert_checkequal(ax.type,"Axes");
+    // Check axis name
+    assert_checkequal(ax.x_label.text,"Real axis");
+    assert_checkequal(ax.y_label.text, "Imaginary axis");
+    // Check legend
+    assert_checkequal(ax.children(1).type,"Legend");
+    // Check stability
+    if dt == 'd' then
+        assert_checkequal(ax.children(2).type,"Arc");
+    else
+        assert_checkequal(ax.children(2).type,"Segs");
+    end
+    // Check zeros
+    if size(nr,'*') <> 0 & size(dr,'*') == 0 then
+        assert_checkequal(ax.children(1).text,"Zeros");
+        assert_checkequal(ax.children(3).type,"Polyline");
+        assert_checktrue(ax.children(3).data-zrs<1d-5);
+    end
+    // Check poles
+    if size(dr,'*') <> 0 & size(nr,'*') == 0 then
+        assert_checkequal(ax.children(1).text,"Poles");
+        assert_checkequal(ax.children(3).type,"Polyline");
+        assert_checktrue(ax.children(3).data-pls<1d-5);
+    end
+    // Check zeros and poles
+    if size(nr,'*')<> 0 & size(dr,'*') <> 0 then
+        assert_checkequal(ax.children(1).text,["Zeros";"Poles"]);
+        assert_checkequal(ax.children(3).type,"Polyline");
+        assert_checkequal(ax.children(4).type,"Polyline");
+        assert_checktrue(ax.children(3).data-zrs<1d-5);
+        assert_checktrue(ax.children(4).data-pls<1d-5);
+    end
+    close
+endfunction
+// With zeros and poles
+s=poly(0,'s');
+n=1+s;
+d=1+3*s;
+// continuous transfert fct
+hc=syslin('c',n./d);
+checkplzr(hc,[-1/3 0],[-1 0]);
+// discete transfert fct
+hd=syslin('d',n./d);
+checkplzr(hd,[-1/3 0],[-1 0]);
+// undifined time domain transfert fct
+h=syslin([],n./d);
+checkplzr(h,[-1/3 0],[-1 0]);
+// continuous state-space
+ssc=tf2ss(hc);
+checkplzr(ssc,[-1/3 0],[-1 0]);
+checkplzr([ssc(2),ssc(3),ssc(4),ssc(5)],[-1/3 0],[-1 0]);
+// discrete state-space
+ssd=tf2ss(hd);
+checkplzr(ssd,[-1/3 0],[-1 0]);
+// undifined time domain state-space
+ss=tf2ss(h);
+checkplzr(ss,[-1/3 0],[-1 0]);
+checkplzr([ss(2),ss(3),ss(4),ss(5)],[-1/3 0],[-1 0]);
+// With poles
+s=poly(0,'s');
+n=[1+s 2+3*s+4*s^2];
+d=[1+3*s 5-s^3];
+// continuous transfert fct
+hc=syslin('c',n./d)
+ hc  =
+                          2  
+    1 + s      2 + 3s + 4s   
+    -----      -----------   
+                       3     
+    1 + 3s        5 - s      
+checkplzr(hc,[],[1.7099759,0;-0.8549880,1.4808826;-0.8549880,-1.4808826;-1/3 0]);
+// discete transfert fct
+hd=syslin('d',n./d);
+checkplzr(hd,[],[1.7099759,0;-0.8549880,1.4808826;-0.8549880,-1.4808826;-1/3 0]);
+// undifined time domain transfert fct
+h=syslin([],n./d);
+checkplzr(h,[],[1.7099759,0;-0.8549880,1.4808826;-0.8549880,-1.4808826;-1/3 0]);
+// continuous state-space
+ssc=tf2ss(hc);
+checkplzr(ssc,[],[1.7099759,0;-0.8549880,1.4808826;-0.8549880,-1.4808826;-1/3 0]);
+// discrete state-space
+ssd=tf2ss(hd);
+checkplzr(ssd,[],[1.7099759,0;-0.8549880,1.4808826;-0.8549880,-1.4808826;-1/3 0]);
+// undifined time domain state-space
+ss=tf2ss(h);
+checkplzr(ss,[],[1.7099759,0;-0.8549880,1.4808826;-0.8549880,-1.4808826;-1/3 0]);
+// error messages
+errmsg1=msprintf(gettext("%s: Wrong number of input argument: %d expected.\n"),"plzr",4);
+assert_checkerror("plzr(1)",errmsg1);
+errmsg2=msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"),"plzr",1);
+assert_checkerror("plzr(h,1)",errmsg2);
+errmsg3=msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"),"plzr",1);
+assert_checkerror("plzr(ss,1)",errmsg3);
+errmsg4=msprintf(gettext("%s: Wrong type for input argument #%d: Linear dynamical system expected.\n"),"plzr",1);
+assert_checkerror("plzr(n)",errmsg4);
+errmsg5=msprintf(gettext("%s: Wrong type of input argument #%d: Array of floating point numbers expected.\n"),"plzr",1);
+assert_checkerror("plzr(""s"",""d"")",errmsg5);
diff --git a/scilab/modules/cacsd/tests/unit_tests/plzr.tst b/scilab/modules/cacsd/tests/unit_tests/plzr.tst
new file mode 100644 (file)
index 0000000..c69b315
--- /dev/null
@@ -0,0 +1,139 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH GRAPHIC -->
+//
+// <-- ENGLISH IMPOSED -->
+//
+// Unit tests for plzr()
+
+function checkplzr(h,zrs,pls)
+    
+    if typeof(h)=='rational' then
+        plzr(h);
+        h=tf2ss(h);
+        [a,b,c,d]=h(2:5);
+        dt=h.dt;
+    elseif typeof(h)=='state-space' then
+        plzr(h);
+        [a,b,c,d]=h(2:5)
+        dt=h.dt;
+    else
+        plzr(h(1),h(2),h(3),h(4));
+        a=h(1);
+        b=h(2);
+        c=h(3);
+        d=h(4);
+        dt=[];
+    end
+    fig=gcf();
+    ax=fig.children;
+    dr=spec(a)
+    [al,be]=tr_zer(a,b,c,d)
+    nr=al./be;
+    nr=real(nr);
+    dr=real(dr);
+    
+    //nb_child=size
+    assert_checkequal(ax.type,"Axes");
+
+    // Check axis name
+    assert_checkequal(ax.x_label.text,"Real axis");
+    assert_checkequal(ax.y_label.text, "Imaginary axis");
+
+    // Check legend
+    assert_checkequal(ax.children(1).type,"Legend");
+
+    // Check stability
+    if dt == 'd' then
+        assert_checkequal(ax.children(2).type,"Arc");
+    else
+        assert_checkequal(ax.children(2).type,"Segs");
+    end
+
+    // Check zeros
+    if size(nr,'*') <> 0 & size(dr,'*') == 0 then
+        assert_checkequal(ax.children(1).text,"Zeros");
+        assert_checkequal(ax.children(3).type,"Polyline");
+        assert_checktrue(ax.children(3).data-zrs<1d-5);
+    end
+    // Check poles
+    if size(dr,'*') <> 0 & size(nr,'*') == 0 then
+        assert_checkequal(ax.children(1).text,"Poles");
+        assert_checkequal(ax.children(3).type,"Polyline");
+        assert_checktrue(ax.children(3).data-pls<1d-5);
+    end
+    // Check zeros and poles
+    if size(nr,'*')<> 0 & size(dr,'*') <> 0 then
+        assert_checkequal(ax.children(1).text,["Zeros";"Poles"]);
+        assert_checkequal(ax.children(3).type,"Polyline");
+        assert_checkequal(ax.children(4).type,"Polyline");
+        assert_checktrue(ax.children(3).data-zrs<1d-5);
+        assert_checktrue(ax.children(4).data-pls<1d-5);
+    end
+    close
+endfunction
+
+// With zeros and poles
+s=poly(0,'s');
+n=1+s;
+d=1+3*s;
+// continuous transfert fct
+hc=syslin('c',n./d);
+checkplzr(hc,[-1/3 0],[-1 0]);
+// discete transfert fct
+hd=syslin('d',n./d);
+checkplzr(hd,[-1/3 0],[-1 0]);
+// undifined time domain transfert fct
+h=syslin([],n./d);
+checkplzr(h,[-1/3 0],[-1 0]);
+// continuous state-space
+ssc=tf2ss(hc);
+checkplzr(ssc,[-1/3 0],[-1 0]);
+checkplzr([ssc(2),ssc(3),ssc(4),ssc(5)],[-1/3 0],[-1 0]);
+// discrete state-space
+ssd=tf2ss(hd);
+checkplzr(ssd,[-1/3 0],[-1 0]);
+// undifined time domain state-space
+ss=tf2ss(h);
+checkplzr(ss,[-1/3 0],[-1 0]);
+checkplzr([ss(2),ss(3),ss(4),ss(5)],[-1/3 0],[-1 0]);
+
+// With poles
+s=poly(0,'s');
+n=[1+s 2+3*s+4*s^2];
+d=[1+3*s 5-s^3];
+// continuous transfert fct
+hc=syslin('c',n./d)
+checkplzr(hc,[],[1.7099759,0;-0.8549880,1.4808826;-0.8549880,-1.4808826;-1/3 0]);
+// discete transfert fct
+hd=syslin('d',n./d);
+checkplzr(hd,[],[1.7099759,0;-0.8549880,1.4808826;-0.8549880,-1.4808826;-1/3 0]);
+// undifined time domain transfert fct
+h=syslin([],n./d);
+checkplzr(h,[],[1.7099759,0;-0.8549880,1.4808826;-0.8549880,-1.4808826;-1/3 0]);
+// continuous state-space
+ssc=tf2ss(hc);
+checkplzr(ssc,[],[1.7099759,0;-0.8549880,1.4808826;-0.8549880,-1.4808826;-1/3 0]);
+// discrete state-space
+ssd=tf2ss(hd);
+checkplzr(ssd,[],[1.7099759,0;-0.8549880,1.4808826;-0.8549880,-1.4808826;-1/3 0]);
+// undifined time domain state-space
+ss=tf2ss(h);
+checkplzr(ss,[],[1.7099759,0;-0.8549880,1.4808826;-0.8549880,-1.4808826;-1/3 0]);
+
+// error messages
+errmsg1=msprintf(gettext("%s: Wrong number of input argument: %d expected.\n"),"plzr",4);
+assert_checkerror("plzr(1)",errmsg1);
+errmsg2=msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"),"plzr",1);
+assert_checkerror("plzr(h,1)",errmsg2);
+errmsg3=msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"),"plzr",1);
+assert_checkerror("plzr(ss,1)",errmsg3);
+errmsg4=msprintf(gettext("%s: Wrong type for input argument #%d: Linear dynamical system expected.\n"),"plzr",1);
+assert_checkerror("plzr(n)",errmsg4);
+errmsg5=msprintf(gettext("%s: Wrong type of input argument #%d: Array of floating point numbers expected.\n"),"plzr",1);
+assert_checkerror("plzr(""s"",""d"")",errmsg5);