Modeling a multiple-chain emeraldine gas sensor for NH3 and NO2 detection