%The main function for ODE system solution.
%Input: t - time period length in hours;
%aalc - ADH activity in IU/ml, aaldh - AlDH activity in IU/ml;
%pyrcoef - pyruvate concentration in the exterbal media; param - a column
%3 numbers, the first one is ethanol initial concentration; the second one
%is a multiplier of right-hand side of equation for ethanol (0 by default),
%the third one is a multiplier of right-hand side of equation for
%acetaldehyde (1 by default); IC - a column of initial conditions;
%Output: t - time grid; y - solution of ODE system.
function [t,y] = solveGlyAlc_transp_a(t,aalc,aaldh,pyrcoef,param,IC)
if nargin<6
    G6P = 0.073414;
    F6P = 0.024048;
    FDP = 0.036335;
    DAP = 0.06969;
    GAP = 0.031203;
    DPG13 = 7.64682e-4;
    DPG23 = 4.742029;
    PG3 = 0.046298;
    PG2 = 0.010886;
    PEP = 0.010075;
    NAD = 0.048;
    PYR = 0.070045;
    LAC = 1.2;
    Z=3.17;
    ETH=param(1);
    ACA=0;
    AC=0;
    IC=[G6P F6P FDP DAP GAP DPG13 DPG23 PG3 PG2 PEP PYR LAC NAD Z ETH ...
    ACA AC];
end
options=odeset('AbsTol',1e-8,'RelTol', 1e-4);

[t,y]=ode15s(@(t,x) rhsGlyAlc_transp_a(t,x,aalc,aaldh,pyrcoef,param),...
    [0 t],IC,options);
end