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: Exercise1.m
    path of file: ./repos/Matlab4CRE/practicals/2021-2022/practicals03/matlab
    
    the code of the file until where you have to start completion: %-------------------------------------------------------------------------%
%        ___  ___      _   _       _       ___ _____ ______ _____         |
%        |  \/  |     | | | |     | |     /   /  __ \| ___ \  ___|        |
%        | .  . | __ _| |_| | __ _| |__  / /| | /  \/| |_/ / |__          |
%        | |\/| |/ _` | __| |/ _` | '_ \/ /_| | |    |    /|  __|         |
%        | |  | | (_| | |_| | (_| | |_) \___  | \__/\| |\ \| |___         |
%        \_|  |_/\__,_|\__|_|\__,_|_.__/    |_/\____/\_| \_\____/         |
%                                                                         |
%                                                                         |
%   Author: Alberto Cuoci <alberto.cuoci@polimi.it>                       |
%   CRECK Modeling Group <http://creckmodeling.chem.polimi.it>            |
%   Department of Chemistry, Materials and Chemical Engineering           |
%   Politecnico di Milano                                                 |
%   P.zza Leonardo da Vinci 32, 20133 M
    
function dY = PFR(z,Y)

    global A;       % [1/s]
    global Ea;      % [cal/mol]
    global P;       % [Pa]
    global S;       % [m2]
    global Te;      % [K]
    global U;       % [kcal/m2/h/K]
    global D;       % [m]
    global deltaHR; % [cal/mol]
    global Cp;      % [cal/mol/K]

    FA = Y(1);      % molar flow rate of A [kmol/h]
    FB = Y(2);      % molar flow rate of B [kmol/h]
    T  = Y(3);      % molar flow rate of C [kmol/h]
    
    k = A*exp(-Ea/1.987/T)*3600;        % [1/h]
    Ctot = P/8314/T;                    % [kmol/m3]
    Ftot = FA + FB;                     % [kmol/h]
    CA = Ctot * (FA/Ftot);              % [kmol/m3]
    r = k*CA;                           % [kmol/m3/h]
    Qr = -deltaHR*r;                    % [cal/m3/h]
    a = 4/D;                            % [1/m]
    
    % Mass balance equations
    dFA = -S*r;                     % [kmol/m/h]
    dFB =  S*r;                     % [kmol/m/h]
    
    % Energy balance equation
    dT  = (Qr + U*(Te-T)*a)*S/Ftot/Cp;  % [K/m]

    dY = [dFA dFB dT]';

end