function dedt = ESuperposedEqNew4(t,y,sgm_t,sgm, w0, h0, l0, e_cr, e_f, my_struct) % ode15i(odefun,tspan,y0,yp0,option)
% Solving Carreau differential equation
d=sqrt(pi)*3.5e-3;
nur_a_Squeeze = my_struct.a_sq;
nur_b_Squeeze = my_struct.b_sq;
nur_a_Bleed = my_struct.a_bl;
nur_b_Bleed = my_struct.b_sq;

kk = my_struct.kk; 
ksi_l = exp(-2*e_cr); 
ksi_f = exp(-2*e_f); 
cond= @(ee) (abs(ee)<abs(e_cr));
nur_b=@(ee) cond(ee)*nur_b_Squeeze+(1-cond(ee))*nur_b_Bleed;
nur_a=@(ee) cond(ee)*nur_a_Squeeze+(1-cond(ee))*nur_a_Bleed;
MacroNu = @(ee) cond(ee)*(2*(((w0/h0)^2)*exp(-4*ee)))+(1-cond(ee))*(2*(((w0/h0)^2)*exp(-2*(ee+e_cr))));
MicroNu = @(ee) cond(ee)*(2*sqrt(ksi_l)*exp(ee)*kk*(((kk/(sqrt(ksi_f)*exp(ee)-kk))^2)+3))+(1-cond(ee))*(2*kk*(kk/(sqrt(ksi_f)*exp(ee)-kk))^2);
StermNu = @(ee) MacroNu(ee)*MicroNu(ee);
SrateNu = @(dedt) -nur_b*((-dedt)^(nur_a+1));
sgm_ap = interp1(sgm_t,sgm,t);

temp = -sgm_ap/(StermNu(y)*nur_b(y));
dedt = -(temp)^(1/(nur_a(y)+1.0));


end
