function y = temp_calc(x)
W = x(1); % Water Volume [mm3]
Wt = x(2); % Water Temperature [C]
S = x(3); % Sand Volume [mm3]
St = x(4); % Sand Temperature [C]
D = x(5); % Dry Sand Volume [mm3]
Dt = x(6); % Dry Sand Temperature [C]
LEVEL = x(7); % Level [mm]
Rt = 26; % Room Temperature [C]
if LEVEL == 0 % If the SILO is empty
    y = Rt; % the temperature = the Room Temperature
else
    y = ((W*Wt) + (S*St) + (D*Dt))/(W + S + D); % Mixture Temperature
end