The chaotic dynamics of the transport equation for the L-mode to H-mode near the plasma in a tokamak is studied in detail with the Melnikov method. The transport equations represent a system with external and parametric excitation. The critical curves separating the chaotic regions and nonchaotic regions are presented for the system with periodically external excitation and linear parametric excitation, or cubic parametric excitation, respectively. The results obtained here show that there exist uncontrollable regions in which chaos always take place via heteroclinic bifurcation for the system with linear or cubic parametric excitation. Especially, there exists a controllable frequency, excited at which chaos does not occur via homoclinic bifurcation no matter how large the excitation amplitude is for the system with cubic parametric excitation. Some complicated dynamical behaviors are obtained for this class of systems.