The growing demand for sustainable technology in the automotive industry has led to vibrant research on mechatronic engines. The mechatronic engine replaces and integrates existing mechanical devices with advanced electronics to increase flexibility of engine control. The flexible engine control is to achieve optimal performance in regards to exhaust emissions and fuel efficiency. This thesis, in particular, concerns modeling, analysis, and tracking control of an electrohydraulic camless engine valve actuator for flexible gas flow control. The thesis consists of three main chapters. In the first chapter, a control-oriented charge mixing model is developed to analyze the effect of variable valve actuation on mixing of fresh charge and residual gas, referred to as charge mixing. The complex charge mixing is simplified by the enthalpy transfer between two control volumes: the mixed and unmixed zones. Then, thermodynamic interaction between two zones depending on variable valve actuation is modeled. The model is validated through engine simulations and optical engine tests. Further simulation studies are conducted to investigate the effect of different valve actuation strategies. In the second chapter, nonlinear frequency domain models of an electrohydraulic actuator are developed for spectral analysis and system identification. Both analytic and experimental approaches are presented. The analytic frequency domain model is derived from physical dynamics using Volterra series representation of a nonlinear system. Spectral analysis with the analytic model helps to uncover the critical nonlinear features of the electrohydraulic actuator in frequency domain. The experimental frequency domain model is identified from frequency response. With the assumption of the block-oriented model structures, the models are parametrized and the associated parameters are estimated based on spectral analysis. In the third chapter, internal model principle-based robust tracking control of an electrohydraulic actuator is presented to achieve nonstationary valve motion of a camless engine. As in many reciprocating machines, reference valve motion of an internal combustion engine is defined as a periodic signal in rotational angle domain of the engine. However, the reference valve motion is aperiodic in time domain, because rotational speed of the engine varies with time. Such motion is referred to as nonstationary motion whose frequency contents vary with time. Regarding a nonstationary reference signal modeled by a time varying exosystem, the high-order time varying internal model is proposed and its effectiveness is demonstrated by implementation on the prototype electrohydraulic camless engine valve actuator.