% This function takes in, for one disturbance at a time, the disturbance gain
% and the sensitivity and tau for the tank, and creates the SGd transfer
% function

function SGd = sgd(kd,sens,tau)

% Defining s as the Laplace variable s
s = tf('s');

 gd = kd/(tau*s+1);          % Disturbance TF
 sgd = sens*gd;              % Output y (outlet concentration)
 [A,B,C,D]=ssdata(sgd);      % Extracting the matrix data from the state-space model
 SGd=tf(ss(A,B,C,D));        % Creating a TF model of the state-space model

