function [C Ceq] = nonlinconst(u,d,tintp,par1,par,t,init)
%Nonlinear inequality constraints

%Parameters
Tr_min = par1.Tr_min;
Tr_max = par1.Tr_max;
Tf_min = par1.Tf_min;
Tf_max = par1.Tf_max; 

[t x] = ode15s(@(t,x)equations(t,x,u,d,tintp,par),t,init);

Tf = x(:,1);
Tr = x(:,2);

% C <= 0
C(1) = -(max(Tf) - Tf_max);  % [K]
C(2) = -(max(Tr) - Tr_max); % [K]
C(3) = -(Tf_min - min(Tf)); % [K]
C(4) = -(Tr_min - min(Tr)); % [K]

 C = [C(1) C(2) C(3) C(4)]; 

Ceq = [];

