1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) ????-2008 - INRIA - Serge Steer
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
//state space
a=[1 2;0 4];b=[1;1];c=[1 2];
sl=syslin('c',a,b,c);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>0)|or(sl.dt<>'c') then bugmes();quit;end
sl=syslin('d',a,b,c);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>0)|or(sl.dt<>'d') then bugmes();quit;end
sl=syslin(0.1,a,b,c);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>0)|or(sl.dt<>0.1) then bugmes();quit;end
sl=syslin('c',a,b,c,1);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>1)|or(sl.dt<>'c') then bugmes();quit;end
sl=syslin('d',a,b,c,1);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>1)|or(sl.dt<>'d') then bugmes();quit;end
sl=syslin(0.1,a,b,c,1);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>1)|or(sl.dt<>0.1) then bugmes();quit;end
sl=syslin('c',a,b,c,1+%s);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>1+%s)|or(sl.dt<>'c') then bugmes();quit;end
sl=syslin('d',a,b,c,1+%s);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>1+%s)|or(sl.dt<>'d') then bugmes();quit;end
sl=syslin(0.1,a,b,c,1+%s);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>1+%s)|or(sl.dt<>0.1) then bugmes();quit;end
b=eye(2,2);d=zeros(1,2);
sl=syslin('c',a,b,c,d);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>d)|or(sl.dt<>'c') then bugmes();quit;end
sl=syslin('d',a,b,c,d);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>d)|or(sl.dt<>'d') then bugmes();quit;end
sl=syslin(0.1,a,b,c,d);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>d)|or(sl.dt<>0.1) then bugmes();quit;end
c=[];d=[]
d =
[]
sl=syslin('c',a,b,c,d);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>d)|or(sl.dt<>'c') then bugmes();quit;end
sl=syslin('d',a,b,c,d);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>d)|or(sl.dt<>'d') then bugmes();quit;end
sl=syslin(0.1,a,b,c,d);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>d)|or(sl.dt<>0.1) then bugmes();quit;end
c=[1 2];d=[];b=[];
sl=syslin('c',a,b,c,d);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>d)|or(sl.dt<>'c') then bugmes();quit;end
sl=syslin('d',a,b,c,d);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>d)|or(sl.dt<>'d') then bugmes();quit;end
sl=syslin(0.1,a,b,c,d);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>d)|or(sl.dt<>0.1) then bugmes();quit;end
a=[];b=[];c=[];d=1;
sl=syslin('c',a,b,c,d);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>d)|or(sl.dt<>'c') then bugmes();quit;end
sl=syslin('d',a,b,c,d);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>d)|or(sl.dt<>'d') then bugmes();quit;end
sl=syslin(0.1,a,b,c,d);
if or(sl.A<>a)|or(sl.B<>b)|or(sl.C<>c)|or(sl.D<>d)|or(sl.dt<>0.1) then bugmes();quit;end
//transfer functions
num=1+%s;den=1-%s+3*%s^2;simp_mode(%f);
sl=syslin('c',num,den);
if or(sl.num<>num)|or(sl.den<>den)|or(sl.dt<>'c') then bugmes();quit;end
sl=syslin('c',num./den);
if or(sl.num<>num)|or(sl.den<>den)|or(sl.dt<>'c') then bugmes();quit;end
num=1+%z;den=1-%z+3*%z^2;simp_mode(%f);
sl=syslin('d',num,den);
if or(sl.num<>num)|or(sl.den<>den)|or(sl.dt<>'d') then bugmes();quit;end
sl=syslin('d',num./den);
num=[1+%s %s^2];den=(1-%s+3*%s^2)*ones(num);simp_mode(%f);
sl=syslin('c',num,den);
if or(sl.num<>num)|or(sl.den<>den)|or(sl.dt<>'c') then bugmes();quit;end
num=[1+%z 2];den=(1-%z+3*%z^2)*ones(num);simp_mode(%f);
sl=syslin('c',num./den);
if or(sl.num<>num)|or(sl.den<>den)|or(sl.dt<>'c') then bugmes();quit;end
|