title: How do I implement control system block of a transfer function in C++?
body: <p>I want to define a control system block like:</p>
  
  <pre><code>class ControlSystemBlock
  {
   public:
    ControlSystemBlock()
    {
     m_dbTimeStep = 0.001; // time between two consequential inputs
    }
  
    // this method can be called anytime,
    // but the object will assume
    // that it was called
    // after m_dbTimeStep before the last call
    void LoadNewInput(double dbInputValue);
  
    double GetCurrentOutput();
    // ...
   private:
    double m_dbTimeStep;
    // ...
  };
  </code></pre>
  
  <p>The system will receive inputs, and according to these inputs and user defined transfer-function in it, its output value will change in time.  </p>
  
  <p>For instance, assume that I want to implement the transfer function <code>H(s) = 1 / (s + 2)</code>. How do I do it? Is there any algorithm for that?</p>