For the sake of simplicity, we will only consider the air resistance experienced by the pendulum bob itself, not by the rod. The air resistance force vector for the pendulum bob would be:
FD=−2ρCDA∣v∣v. Where v is the velocity vector of the bob. It is equal to (x˙,y˙). Hence:
FD=−2ρCDAl∣θ˙∣(x˙,y˙)=−2ρCDAl∣θ˙∣(−lθ˙sinθ,lθ˙cosθ)=2ρCDAl2∣θ˙∣θ˙(sinθ,−cosθ). To find the generalized force term, we need to find ∂θ∂r:
∂θ∂r=(∂θ∂x,∂θ∂y)=(−lsinθ,lcosθ). Hence:
Qθ=FD⋅∂θ∂r=2ρCDAl2∣θ˙∣θ˙(sinθ,−cosθ)⋅(−lsinθ,lcosθ)=2ρCDAl2∣θ˙∣θ˙(−lsin2θ−lcos2θ)=−2ρCDAl3∣θ˙∣θ˙. Hence Equations (??) become:
ml2θ¨+mglcosθ=−2ρCDAl3∣θ˙∣θ˙. Dividing by ml2 yields:
θ¨+lgcosθ=−2mρCDAl∣θ˙∣θ˙. Subtracting lgcosθ from both sides yields:
θ¨=−lgcosθ−2mρCDAl∣θ˙∣θ˙. This equation cannot be analytically solved, so numerical solutions are necessary. I numerically solve an even more complex version of the single pendulum equation here.
If you would like to see my derivation of the double rigid pendulum equations, it is here.