Objective: A promising treatment for congestive heart failure is the implementation of a left ventricular assist device (LVAD) that works as a mechanical pump. Modern LVADs work with adjustable constant rotor speed and provide therefore continuous blood flow; however, recently undertaken efforts try to mimic pulsatile blood flow by oscillating the pump speed. This work proposes an algorithmic framework to construct and evaluate optimal pump speed policies. Methods: We use a model that captures the atrioventricular plane displacement, which is a physiological indicator for heart failure. We employ mathematical optimization to adapt this model to patient specific data and to find optimal pump speed policies with respect to ventricular unloading and aortic valve opening. To this end, we reformulate the cardiovascular dynamics into a switched system and thereby reduce nonlinearities. We consider system switches that stem from varying the constant pump speed and that are state dependent such as valve opening or closing. Results: As a proof of concept study, we personalize the model to a selected patient with respect to ventricular pressure. The model fitting results in a root-mean-square deviation of about 6 mmHg. Optimized constant and piecewise constant rotor speed profiles improve the default initialized solution by 31% and 68% respectively. Conclusion: These in silico findings demonstrate the potential of personalized hemodynamical optimization for the LVAD therapy. Significance: LVADs and their optimal configuration are active research fields. Mathematical optimization enhances our understanding of how LVADs should provide pulsatility.