The authors introduce StoDynProg, a small library created to solve Optimal Control problems arising in the management of Renewable Power Sources, in particular when coupled with an Energy Storage System. The library implements generic Stochastic Dynamic Programming (SDP) numerical methods which can solve a large class of Dynamic Optimization problems. They demonstrate the library capabilities with a prototype problem: smoothing the power of an OceanWave Energy Converter. First they use time series analysis to derive a stochastic Markovian model of this system since it is required by Dynamic Programming. Then, they briefly describe the \"Policy iteration\" algorithm they have implemented and the numerical tools being used.