Based on the four compartment model by Grodins we develop a model for the response of the cardiovascular system to a short term submaximal workload. Basic mechanisms included in the model are Starling's law of the heart, the Bowditch effect and autoregulation in the peripheral regions. A fundamental assumption is that the action of the feedback control is represented by the baroceptor loop and minimizes a quadratic cost functional. Simulation results show that the model provides a satisfactory description of data obtained in bicycle ergometer tests.