% Input:
% phi2: Matrix
% A: Matrix (of continuous dynamics)
% edA: Matrix (expm(A))
% x0: function handle (support function of initial set)
% u: function handle (support function of free input)

% Output:
% epsilonomega_p,epsilonomega_n,epsilonpsi: function handle (support
% function)
% e_p,e_n : vector

% Description:
% Generates the sets big Epsilon and the values e+ and e- (for
% algoSpaceEx)

function [epsilonomega_p,epsilonomega_n,epsilonpsi,e_p,e_n] = calcepsilon(phi2,A,edA,x0,u)

a2x0 = @(l) x0((A^2)'*l);
a2x0_box = boxoperator(a2x0,size(A,2));
temp = @(l) a2x0_box(phi2'*l);
[epsilonomega_p,e_p] = boxoperator(temp,size(A,2));

a2ex0 = @(l) x0((A^2)'*edA'*l);
a2ex0_box = boxoperator(a2ex0,size(A,2));
temp = @(l) a2ex0_box(phi2'*l);
[epsilonomega_n,e_n] = boxoperator(temp,size(A,2));

au= @(l) u(A'*l);
au_box = boxoperator(au,size(A,2));
temp = @(l) au_box(phi2'*l);
epsilonpsi = boxoperator(temp,size(A,2));