Consider the following circuit:
simulate this circuit – Schematic created using CircuitLab
\$E\$ is a constant voltage source. The switch is closed at time \$t = 0\$. The request is to calculate the generic equation for \$i_L(t)\$.
Using the PSC convention i get the following Kirchhoff equations:
1) \$L{ {d i_L} \over {dt}} -v_c = 0\$ (KVL)
2) \$v_c -E -i_R R= 0\$ (KVL)
3) \$-i_R -i_C -i_L = 0\$ (KCL)
After few substitutions and algebraic manipulations I get the differential equation which describe the circuit:
\$-{d^2i_L \over dt^2} -{1 \over CR}{di_L \over dt}-{1 \over CL}i_L = -{E \over CLR}\$
(Replace \$i_C\$ with the capacitor law on the 3. Replace \$i_R\$ form the 2 in the 3 then replace \$v_c\$ from the 1 in the 3.)
The answer is correct but I want to find the same equation using a different method. By assuming the state variable as known I can replace \$L\$ with a current source and \$C\$ with a voltage source (I just applied the Substitution theorem). Then using the Superposition theorem I obtain these three circuits:
The current directions are the same of the original circuit. I get these two equations:
\$v_L = 0 + v_C + 0\$
\$i_C = -i_L - {v_C \over R} -{E \over R}\$
After replacing \$v_L\$ and \$i_C\$:
\$-L{di_L \over dt} = 0 + v_C + 0\$
\$-C{dv_C \over dt} = -i_L - {v_C \over R} -{E \over R}\$
However by replacing \$v_C\$ in the second equation with \$-L{di_L \over dt}\$ I can't get the same equation obtained with the Kirchhoff laws. Not only the signs are different but also the coefficients of each term are different.
What am I missing ? Can this method applied for every AC circuit ?