[scilab-Users] Converting from continuous to discrete time tranfer function.

Adrien Vogt-Schilb vogt at centre-cired.fr
Wed Aug 1 14:59:35 CEST 2012


On 25/07/2012 00:16, steven hallacy wrote:
> Hello,
>
> With Scilab, I know of two ways of converting from a continuous time 
> transfer function (e.g. 1/s) to a discrete time transfer funtion:
>
> 1st way:
> s=poly(0,'s')
> ss2tf(cls2dls(tf2ss(syslin('c',1/s)),0.1))
>
> This way requires a lot of typing.
>
> 2nd Way:
> s=poly(0,'s');z=poly(0,'z');
> sl=syslin('c',1/s);
> sl2=horner(sl,(2/0.1)*(z-1)/(z+1))
>
> This way requires me to remember the tustin approximation.
>
> Does matlab have anything like Matlab's c2d function?
>
> Stephen
Hi

Did you try defining it yourself?

function y=c2d(x,p)

if argn(2)<2
p=0.1
end


  y= ss2tf(cls2dls(tf2ss(syslin('c',x)),p))
endfunction

s=poly(0,'s')
c2d(1/s)


you can do similar stuff each time you use something that requires lots 
of typing

BR
AVS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20120801/6437459a/attachment.htm>


More information about the users mailing list