In doped conductive polymers, polarons and bipolarons are formed

In doped conductive polymers, polarons and bipolarons are formed, and the chemical formula is given below. How can this be modeled and achieved?