I have already made a small program using these equations. I am working with discrete data that updates the values of the parameters each Iterations. Miu and lambda are user defined, and all initial values are 0.
x(k) = x(k-1)+d_y(k-1);
u_1(k) = (-miu)*sign(x(k)-y(k-1));
U_1(k) = U_1(k-1)+u_1(k);
d_y(k) = U_1(k) - lamda*sqrt(abs(x(k)-y(k-1)))*sign(x(k)-y(k-1));
My main question is that how do i integrate the x-dot and u1-dot (x(k) and U_1(k) in the program). I am using the Euler backward and forward method that are used by the discrete integrator block in simulink. I am geting the following result when i give a linear line as an input. Can anyone please check my program and suggest how to smooth the curve