I have a Simulink model and I want to translate the whole model to a python code. Now I am struggling with the translation of a block named "derivative". The documentation regarding this block is available in Click here.
I have used the following code to take the derivative of my input signal:
derivative = np.gradient(percentage, time)
where the np is the Numpy library. The shows the input signal. And after applying the derivative I was expecting to get
which I got this one:
.