Projet

Général

Profil

Scilab Bilineaire » Historique » Version 1

Jacques LAFFONT, 10/11/2021 14:05

1 1 Jacques LAFFONT
h1. Scilab Bilineaire
2
3
h1. Bilinéaire inverse
4
5
<pre>
6
function Sysc=dls2cls(Sysd,T)
7
    s=poly(0,'s');
8
    z=poly(0,'z');
9
    numdeg = degree(Sysd.num);
10
    dendeg = degree(Sysd.den);
11
    if  numdeg>dendeg
12
        error('The discrete-time system is improper');
13
    end
14
    f = -(s*T+2);
15
    g = (s*T-2);
16
    bn = coeff(Sysd.num);
17
    an = coeff(Sysd.den);
18
    npad = dendeg - numdeg;
19
    if npad>0
20
        for i=0:npad
21
            bn = [bn 0];
22
        end
23
    end
24
    nums = 0;
25
    dens = 0;
26
    for i=0:dendeg
27
        nums = nums + bn(i+1)*(f^i)*(g^(dendeg-i));
28
        dens = dens + an(i+1)*(f^i)*(g^(dendeg-i));
29
    end
30
    Sysc = syslin('c',nums,dens);
31
endfunction
32
</pre>