function y = moist_calc(x)
W = x(1); % Water Volume [mm3]
S = x(2); % Sand Volume [mm3]
Sm = x(3); % Sand Moisture [%]
D = x(4); % Dry Sand Volume [mm3]
Dm = x(5); %  Dry Sand Moisture[%]
LEVEL = x(6); % Level [mm]
WT = W + ((Sm/100)*S) + ((Dm/100)*D); % Total Water Content
VT = W + S + D; % Total Volume
if LEVEL == 0 % If the SILO is empty
    y = 0;
elseif VT > 0 % Also if something comes in
    y = (WT/VT)*100;
else
    y = 0;
end