# Is electric charge a state variable since derivative of charge flow is defined as current?

$i=\frac{dq}{dt}$

Is 'q' a state variable in general?

• Charge is a physical quantity, a scalar. The number of free electrons in a given space at a given time. Static and not moving. – crowie Dec 24 '16 at 6:02
• Anything can be a state variable, from a gps coordinate to a voltage to the position velocity or acceleration of a car – Voltage Spike Dec 24 '16 at 6:24

Yes, if we understand the same thing by state variable.

If we are trying to do a time-step by step simulation of a circuit, then we might proceed as follows

a) using the following initial conditions for each step

source voltages and currents
the ground voltage (=0)
the voltage across any capacitor (as it depends on the capacitor charge)
the current through any inductor (as it depends on the inductor flux)

b) now solve for all the remaining voltages and currents

c) now update the capacitor voltages due to the time integrated current that flows into them, and update the inductor currents due to the time integrated voltage across them, these become the initial conditions for the next step

A related notion is that charge in a capacitor, and current in an inductor, stores energy.