Why continuous and discrete transfer function have different results
41 views (last 30 days)
Show older comments
I am trying to determine why the continuous and discrete transfer functions yield different results when each is fed with a sinusoidal input for a first order transfer function. How can I reduce or remove the error between the two transfer functions?
I am modeling a first order continuous system with a pole at s = -5. The objective is to determine a discrete transfer function that matches the continuous transfer function. To determine the discrete transfer function, I use the c2d command. I run the following code.
a = 5;
Ts = 1e-4;
trans = tf(1, [1, a]);
trans_matlab_match = c2d(trans, Ts, 'matched')
I determine that
1
-----
s + 5
in s domain maps to
9.998e-05
----------
z - 0.9995
in z domain.
I create a simulink model with the continuous and discrete transfer functions connected to the same input, and compare their outputs, shown below.
The parameters are taken from the Matlab script: The continuous transfer function parameters are:
Numerator: 1
Denominator: [1 5]
The discrete transfer function parameters are:
Numerator: 9.998e-05
Denominator:[1 -0.9995]
Ts = 1e-4
The amplitude of the sine wave generator is 1. The frequency is 2*pi*10. The solver is running in fixed step, with a step size of 'Ts' (i.e. 1e-4).
The difference block shows the error between the two transfer functions. Scope2 is shown below.
Should there be an error between the 2 transfer functions? If so, why is this happening?
Thanks.
0 Comments
Answers (2)
Azzi Abdelmalek
on 1 Apr 2016
You are not expecting to get to get the same result from the two transfer function, the sample time will cause some difference, but in your case the error seems to be very small, 10^-5
0 Comments
davood mansouri
on 27 Sep 2017
I have simulated a in model(control of inverters) that I have to use transfer function on that simulation. because of speeding of time of simulation I used discrete model and discrete transfer functions. but always i get zero out put until I get that "by using discrete transfer function block you get zero output". I have simulate in continues mode and the simulation runs well. the question is how is it possible to improve the response of discrete transfer function block?
0 Comments
See Also
Categories
Find more on General Applications in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!