Say I have a capacitor to which I apply a square pulse of power for $t_1$. Potential will grow to unity (fully charged) exponentially over time, and decay back to 0 (no charge) exponentially over time. I can calculate potential at a time $t_2$ after the pulse ends as
$$(1-e^{-kt_1})(e^{-kt_2})$$
My problem is, when I apply several pulses of power my model grows and decays repeatedly as above, but the solution is less obvious to me.
For sufficiently long and constant $t_1$ and $t_2$, this just looks like a regular RC waveform response to a step input, like a capacitor charging and discharging.
Over time, if $t_1$ and $t_2$ are sufficiently small so as not to reach 1 and 0, and I vary the lengths of the charging and discharging times, what happens to my potential?
I can see one tedious way to find out is piecewise, where each growth closes the distance between the last decay endpoint and unity, while each decay closes the distance between the last growth endpoint and 0. In such a situation I think that it would look like:
$$(1-e^{-kt_1})(e^{-kt_2}) = P_1$$ $$\Bigl( P_1+(1-P_1)(1-e^{-kt_3})\Bigr)(e^{-kt_4}) = P_2$$ $$\Bigl( P_2+(1-P_2)(1-e^{-kt_5})\Bigr)(e^{-kt_6}) = P_3$$
Firstly, have I derived the behavior correctly?
Secondly - obviously this will grow in complexity quite quickly. Is there a way to calculate this easier than a very long set of piecewise calculations?