To describe the microtrajectory change behavior of two-wheeled vehicles when encountering nonrigid obstacles, this paper proposes an obstacle avoidance model of two-wheeled vehicles for nonrigid obstacles based on the improved social force method. In the model, the obstacle avoidance characteristics of two-wheeled vehicles for nonrigid obstacles and the safety operation requirements of two-wheeled vehicles are considered. The calculation methods of the minimum boundary distance of avoidance and the boundary avoidance force range edge function are proposed based on the ultimate turning angle and boundary avoidance characteristics, respectively. The speed control and direction control behavior of the rider to the vehicle is abstracted as the form of social force, and the two-wheeled vehicle/rider individual is subjected to the avoidance force and correction force perpendicular to the direction of the longitudinal axis of the vehicle body. The centrifugal trajectory obstacle avoidance motion obeying the Newtonian mechanics is studied based on the characteristics of the vehicle body turning angle change. Different traffic environments are constructed by MATLAB software and simulated according to the model running logic, and sensitivity analysis is performed based on the actual data collected in the survey. The simulation results show that, under the same conditions, compared with μi = 50N, when μi = 200N, the X-axis displacement of the simulated vehicle in the avoidance process is shortened by 26.31%, and the body deflection angle increases by 50.75% at the end moment of the avoidance process. Compared with electric motorcycles, the displacement of the X-axis in the avoidance process of the electric bicycle is shortened by 16.92%, and the body deflection angle at the end moment of the avoidance process is increased by 13.68%. The simulation results show that the model can well describe the trajectory change behavior characteristics of two-wheeled vehicles/riders encountering nonrigid obstacles in real situations, and the obstacle avoidance model of two-wheeled vehicles proposed in this paper is considered to be traffic justified.