function out = ChargingPolicy(Vh,qS,qSP,Vmax)

if   Vh  >= Vmax
     qD  = qS-qSP;
     qST = 0;
elseif Vh< Vmax
     qD  = 0;
     qST = qS-qSP;
end
out=[qD;qST];
end
