An innovative numerical technique is presented to adjust the inflow to a
supply chain in order to achieve a desired outflow, reducing the costs of
inventory, or the goods timing in warehouses. The supply chain is modelled by a
conservation law for the density of processed parts coupled to an ODE for the
queue buffer occupancy. The control problem is stated as the minimization of a
cost functional J measuring the queue size and the quadratic difference between
the outflow and the expected one. The main novelty is the extensive use of
generalized tangent vectors to a piecewise constant control, which represent
time shifts of discontinuity points. Such method allows convergence results and
error estimates for an Upwind- Euler steepest descent algorithm, which is also
tested by numerical simulations