This paper presents a convex programming formulation to accurately compute the Lambert W-function. This function is widely used in modeling solar PVs, i.e., explicitly modeling the current voltage curve for solar PV performance. Unfortunately, the Lambert W function cannot be expressed by elementary functions and its computation also follows a complex procedure. To address these issues, we propose to leverage the exponential cone model to equivalently cast the computation of Lambert W function as solving a convex optimization problem whose constraints are representable with elementary functions. In other words, the Lambert W function can be exactly computed by means of convex programming without needing its close-form. We validate our results by comparing the accuracy of our proposed method for computing Lambert W function and its applications on modeling current-voltage curves of solar PV and Maximum Power Point Tracking System.