You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: Exercise5.m
    path of file: ./repos/Matlab4CRE/practicals/2020-2021/practicals02/matlab
    
    the code of the file until where you have to start completion: %-------------------------------------------------------------------------%
%        ___  ___      _   _       _       ___ _____ ______ _____         |
%        |  \/  |     | | | |     | |     /   /
    
function F = CSTR(Y)

    global A1;           % [1/s]
    global Ea1;          % [cal/mol]
    global A2;           % [1/s]
    global Ea2;          % [cal/mol]
    global CAin;         % [kmol/m3]
    global CBin;         % [kmol/m3]
    global CCin;         % [kmol/m3]
    global tau;          % [s]
    global Tin;          % [K]
    global T0;           % [K]
    global HA0;          % [kcal/kmol]
    global HB0;          % [kcal/kmol]
    global HC0;          % [kcal/kmol]
    global CpA;          % [kcal/kmol/K]
    global CpB;          % [kcal/kmol/K]
    global CpC;          % [kcal/kmol/K]
    
    % Recover unknowns 
    CA = Y(1);                  % [kmol/m3]
    CB = Y(2);                  % [kmol/m3]
    CC = Y(3);                  % [kmol/m3]
    T  = Y(4);                  % [kmol/m3]
    
    % Reaction rates
    k1 = A1*exp(-Ea1/1.987/T);  % [1/s]
    k2 = A2*exp(-Ea2/1.987/T);  % [1/s]
    r1 = k1*CA;                 % [kmol/m3/s]
    r2 = k2*CA;                 % [kmol/m3/s]
    
    % Formation rates
    RA = -r1-r2;                % [kmol/m3/s]
    RB = r1;                    % [kmol/m3/s]
    RC = r2;                    % [kmol/m3/s]
    
    % Enthalpies
    HAin = HA0+CpA*(Tin-T0);
    HBin = HB0+CpB*(Tin-T0);
    HCin = HC0+CpC*(Tin-T0);
    HA   = HA0+CpA*(T-T0);
    HB   = HB0+CpB*(T-T0);
    HC   = HC0+CpC*(T-T0);
    
    % Non linear equations
    F(1) = (CAin-CA)/tau + RA;
    F(2) = (CBin-CB)/tau + RB;
    F(3) = (CCin-CC)/tau + RC;
    F(4) = HAin*CAin+HBin*CBin+HCin*CCin - (HA*CA+HB*CB+HC*CC);
    
end