# How to change a pure (ideal) differentiator system into a practical one using MATLAB/Simulink?

A pure/ideal integrator has transfer function H(s)= s. If we try to get its step response in MATLAB we get the error "Cannot simulate the time response of models with more zeros than poles".

Similarly, if we try to get a step response in Simulink, we get a sharp (very thin) vertical line, which apparently goes to infinity.

How can we convert this ideal (pure) differentiator into a practical one?

I have placed my MATLAB code below:

clc
clear
close all
den=%denominator of transfer function
num=[1 0]%numerator of transfer function
sys=tf(num,den)%transfer function expression of ideal(pure) differentiator system
step(sys)%step response


I am also attaching a snapshot of the Simulink model: Update: based upon recieved comment & answer, i updated my question and also included snapshot of simulink model where low pass filter transfer function is used in place of derivative block, i also placed snapshot of simulink model where high pass filter transfer function is used in place of derivative block. But i am still confused,which one(Low pass filter or high pass filter) will be better replacement of pure(ideal)derivative block as asked in main question title

• Make the transfer function a highpass: $s\rightarrow\frac{s}{s+1}$. Now it has a pole and the orders of the numerator and the denominator are equal. All that's left is to ensure that the pole is well outside the area of interest. Nov 5, 2022 at 13:41
• @aconcernedcitizen please try to check my updated question Nov 7, 2022 at 9:48
• Did you miss this part: "All that's left is to ensure that the pole is well outside the area of interest."? Nov 7, 2022 at 12:10
• Will you please elaborate "All that's left is to ensure that the pole is well outside the area of interest." I am not able to understand that properly .Do you mean samething that @Andy aka mentioned in his below answer & comments? Nov 7, 2022 at 13:02
• Where is the pole in $\frac{s}{s+1}$ and what is its value? What can you do to increase its value? How can you compensate for the gain in order to have the necessary slope and value at the desired frequency? If you can't answer these questions then maybe you should read some more before venturing further. Nov 7, 2022 at 14:39

• A low pass TF will be typically $\dfrac{1}{1+sRC}$. How you implement that is up to you. I don't know what your DSP toolbox contains. Nov 7, 2022 at 9:17