In this paper we develop partial differential equations (PDEs) that model the generation of a large class of morphological filters, the levelings and the openings/closings by reconstruction. These types of filters are very useful in numerous image analysis and vision tasks ranging from enhancement, to geometric feature detection, to segmentation. The developed PDEs are nonlinear functions of the first spatial derivatives and model these nonlinear filters as the limit of a controlled growth starting from an initial seed signal. This growth is of the multiscale dilation or erosion type and the controlling mechanism is a switch that reverses the growth when the difference between the current evolution and a reference signal switches signs. We discuss theoretical aspects of these PDEs, propose discrete algorithms for their numerical solution and corresponding filter implementation, and provide insights via several experiments. Finally, we outline the use of these PDEs for improving ...