classdef ControllerOpenLoop < Controller
% Vídeo: http://personales.upv.es/asala/YT/V/tank1BAP.html
    properties %Controller State stored here.
    end
    methods
        function obj=ControllerOpenLoop() %constructor
        end

        function Track(obj,sensor,manual_u,T)
            %do nothing; code would be needed for "bumpless transfer".
        end

        function u=ComputeU(obj,setpoint,measurement_unused,T)
            u=ControllerOpenLoop.NonLinear(setpoint);
        end %ComputeU
    end %Methods

    methods (Static)

      function u=Linear(reference)
          Kr=1/2.3;
          input_oper_point=0.9;
          output_oper_point=1;
          u=input_oper_point+Kr*(reference-output_oper_point); 
      end

        function u=NonLinear(reference)
            outflow_reference=0.9*sqrt(reference);
            u=outflow_reference;
        end
    end
end
