% Input:
% psidelta: function handle (support function)
% delta: double (sampling time)
% A: Matrix (describing the continous dynamics)
% Omega0delta: support function (initial set)
% N: Integer (number of sets to generate)

% Output:
% omegas: cell array of function handles (support functions representing the sets of the flowpipe)

% Decription:
% Generates the support function representations of the flowpipe (for algoSpaceEx)

function [omegas] = computeReachableSets(psidelta,delta,A,Omega0delta,N)
t= 0;

psi = @(l) 0;

omegas = cell(0);
omegas{1} = Omega0delta;

for i = 2:1:N
    
    t = t+ delta;
    etA = expm(A*t); 

    psi = @(l) psi(l) + psidelta(etA'*l);
    
    omega = @(l) Omega0delta(etA'*l) + psi(l);
    omegas{i} = omega;
   
end;