Proportional-Derivative Controller

    
Model the position of a moving body with 1 kg mass and use a sampled proportional-derivative (PD) controller to keep the position at a constant reference value:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=