Modeling of three-phase grid connected voltage source inverters (VSI) often involves simplifications like constant DC-link voltage or averaging over a switching period. These simplifications remove transistor switching and DC-link capacitor dynamics from the model. In this paper, a three-phase VSI with LCL filter is modeled as a state-space system using three-phase representation. DClink voltage is not considered constant and no averaging is used. The model becomes a piecewise linear system which includes dynamics from both switching and variable DC voltage. Component values in each phase are treated separately, which enables simulation of unbalanced systems. Since no transformations are used, there is a one-to-one relationship between the model and real variables. It also allows non-sinusoidal grid voltages. Simulation of dead-time and rectifier operation is described and tested. Modeling and equations are described in detail. The model is verified by simulation and experiments.