Matlab Pade approximation influence on bode plot and step response

I would like to approximate a delay via the pade approximation. I set a normal delay via the exponential term and I set a delay via the pade approximation and I look the difference between the both with a bode plot and a step response. This is totaly different ... So this is not an approximation ... Where is my error ?

Have a nice day :)

You need to properly select a time vector for the step function. I suspect that Matlab has trouble automatically selecting a good time vector for small delays.

try this

close all;
clear all;
clc;

s = tf('s');

sys_retard = exp(-2E-6*s);

T = linspace(0, 10*2E-6, 1000);

figure(1);
output1 = step(sys_retard, T);
figure
plot(T, output1,'b', T, output2,'r');


Edit :

Try the same thing for your bode plot. Select the frequency vector yourself and aim for a good resolution.

• The same probably also holds for the frequency vector in the Bode plot. Commented Jun 17, 2021 at 15:29
• yeah, see my edit
– Ben
Commented Jun 17, 2021 at 15:32

The Padé approximation technique seeks to find a rational transfer function that matches the Taylor series expansion of the function being approximated to as many terms as possible. From what the Matlab manual says, it looks like this is what the pade method is doing.

If you want the approximant to match the Bode plot, use a different approximation technique. If you want the approximant to match the step responds, also use a different technique.