That’s good to hear from you again, welcome to this new great Scilab place!
Scilab itself does no handle pure delays in transfer functions but there a toolbox that should at least partly implement them (I did not tested it yet) with several overloadings:
A priori, this toolbox uses Padé approximants, but this has to be checked.
I noticed in a Julia library some code for pade approximant
Maybe it could be worth to implement a pade function in Scilab.
Here is code
function [coeffs]=pade_coeffs(n)
coeffs = []
for i = 0:n
coeffs(i+1) = nchoosek(n, i) * prod(n+1:2*n-i)
end
endfunction
function [coeffs_scaled]=_linscale_coeffs(coeffs, a)
a_pow = 1
coeffs_scaled(1) = coeffs(1)
for k = 2:length(coeffs)
a_pow = a * a_pow
coeffs_scaled(k) = coeffs(k) * a_pow
end
endfunction
function [T]=pade(tau, n)
coeffs = pade_coeffs(n)
coeffs_scaled = _linscale_coeffs(coeffs, tau)
num = poly(_linscale_coeffs(coeffs, -tau), "s", "coeff")
den = poly(_linscale_coeffs(coeffs, tau), "s", "coeff")
T = syslin("c", num, den)
endfunction
//p = poly(coeffs, "x", "coeff")
s = poly(0, 's')
Gs = 1 // static gain
tau = 4 // time constant
H = syslin('c', Gs / (1 + tau * s))
Td = 2.0 // delay
Hd = pade(Td, 10)
T = H * Hd
time = linspace(0, 20, 51);
rep = csim('step', time, T);
plot(time, rep);