Electrical RC circuit

For a simple RC circuit with a resistor and capacitor in series with a controlled voltage source, the derivation for the voltage across the capacitor and resistor is easy, i.e. substituting current $$\I\$$ as a derivative of charge $$\Q\$$ in and $$\Q/C\$$ for the capacitor then integration which leads to the equation

$$V_c = V_\text{source}\left(1-e^{-t/RC}\right)$$

and

$$V_r = V_\text{source}e^{-t/RC}$$

How would this equation change in case we don't have an ideal capacitor and ideal resistor? How would we come to this differential equation in this case? For example, the separation of ions in a fluid can be done by supplying low voltages which would act like a capacitor charging up and the separation of ions takes place and there is resistance inside the fluid itself. Both of them are unfortunately not ideal in this case.

• A general capacitor model can be found here: iequalscdvdt.com/cap_model.html (you can discard ESL and DA for your case.) But what are you trying to do? Do you have an oscilloscope at your disposition? Commented Oct 13, 2022 at 14:09
• You could write a differential equation for your system, and then solve it Commented Oct 13, 2022 at 14:21
• How to determine the equation? Well that might take some experimentation. Commented Oct 13, 2022 at 15:07
• You need to define precisely how the capacitor and resistor are not ideal, and then model them using combinations of ideal components. Until you can do that there is no point in talking about equations. Commented Oct 13, 2022 at 15:51
• You would model the non-idealities with whatever model you want using a network of ideal components and solve the equation. Commented Oct 13, 2022 at 16:40