Before posing the question I would like to write the assumption I make for the power concept in passive circuits. As far as I know the power dissipated in an RLC circuit is the active power which is actually only dissipated through the resistor R. Power through L and C components are associated with reactive power which means they in average do not dissipate power, they absorb and give back the energy to the circuit continuously.
If the above is true, then I assume a simulation should indicate the average power through an inductor or a capacitor as zero.
Here is a simulation for inductor case where the input is a periodic pulse (plot shows the power through the inductor):
It seems the integral of the above plot with time is zero.
But below in capacitor case I don't get the expected plot:
In this case the integral of the above power plot with time is non-zero. And it is increasing.
Why in the capacitor case the average power is non-zero unlike in inductor case in this LTspice simulation?
EDIT: Below is the input signal asked as request:
Here are the settings:
Edit 2: Here in case of sine input:
Capacitor power from beginning to steady state (source is pulse again):
And a zoom section from the steady-state:
And here below the capacitor power in mW(blue line) and its integral(green line) for the first 500 sec:
As you see the integral goes to a constant which indicates the capacitor does not suck energy anymore from the circuit after certain amount of seconds.
Is the energy at the beginning called as dissipated or stored? In other words is the power at the beginning active or reactive?