AbstractAs one key basis of traffic flow theory, the fundamental diagram (FD) has wide application in traffic management and control. However, the FD of mixed human-driven vehicles (HVs) and cooperative adaptive cruise control (CACC) vehicles remains unclear. The deterministic and stochastic FD of mixed traffic was obtained. First, the longitudinal control model (LCM) and connected LCM (CLCM) were selected as the car-following model of HVs and CACCs. Next, in deterministic simulation, the mathematical expression of mixed-traffic FD was conducted considering the CACC penetration rate and platooning intensity. Then, the stochastic distribution of perception and response time calibrated by the vehicle trajectory data set NGSIM was introduced to derive the stochastic FD. After that, in stochastic simulation, taking the variance and computation effort into account, the optimal number of simulated vehicles to obtain steady-state FD was obtained. The impact of CACC penetration rates and platooning intensity was also explored. It revealed that the optimal number of simulated vehicles is 400. CACC can improve the capacity and critical density of highways. In mixed traffic, due to the large variance of HV driver response time, scattering remains unchanged regardless of CACC penetration when there are enough vehicles. Pure CACC traffic has minimum scattering. More importantly, the proposed framework is applicable to other CACC, adaptive cruise control (ACC), and HV car-following models, including further experimental models.