Purpose: Correct MLC modeling is essential to the accurate IMRT delivery. Most TPSs use simplified models with parameters of leaf transmission (LT) and dynamic leaf gap (DLG). The common way to determine them is through extrapolation from measurements. In this study, we propose a new technique to determine these parameters with EPID and ion chambers using specially designed fluence pattern. Methods: The fluence has symmetric twin peaks separated by 10cm and each has a width of 2cm. The DMLC files were generated based on initial values of LT and DLG from measurements. Plans were delivered to EPID and analyzed in portal dosimetry software. The FWHM of each peak was evaluated. The optimal DLG value was determined by iteratively adjusting its value and repeating calculation to match the FWHM between calculation and measurement. To determine LT, an ion chamber was placed at the central axis where dose is primarily from MLC leakage. Both Millennium MLC (MMLC) and HDMLC in Varian Truebeam were investigated for photon energies of 6X, 10X, 15X. QAs of realistic IMRT plans were performed and compared. Results: The MMLC has measured LT values from 1.3%–1.5%, and corresponding optimal values 1.6–1.9%, an increase of 20% on average. The DLGs extrapolated from measurement are 0.8–0.9 mm, and optimal at 1.2–1.6 mm, a 60% increase. For HDMLC, the LTs are similar. However, the DLGs are much smaller, with extrapolations at 0.15–0.21 mm, and optimal at 0.4–0.7 mm. The portal dosimetry QA for 6X plan with MMLC reduces pixels failing γ (criteria: 3%/1mm) from 9% to 3% with optimal parameters. Similarly, QA for 15X plan with HDMLC reduces from 21% to 6%. Conclusion: We have developed a method to determine optimal MLC parameters that minimize TPS modeling errors. This ensures that patient specific QA reflects the true discrepancies in treatment plan or machine delivery.