
simulate this circuit – Schematic created using CircuitLab
This is a simple RC circuit with an AC voltage source, \$E = V_0 \cos(\omega t)\$. In the sinusoidal state, \$Y_{\text{resistor}} = G\$ and \$Y_{\text{capacitor}} = C\omega j\$. The capacitor is not charged at all at \$t = 0\$. According to the KCL at each node, we get a system of equations that can be represented in terms of matrices \$\mathbf{Y}\mathbf{V} = \mathbf{I}\$:
\begin{gather} \begin{bmatrix} G & -G & 0 \\ -G & G + C\omega j & -C\omega j \\ 0 & -C\omega j & C\omega j \end{bmatrix} \begin{bmatrix} v_a \\ v_b \\ v_c \end{bmatrix} = \begin{bmatrix} -i_a \\ 0 \\ i_a \end{bmatrix}\text{.} \end{gather}
Setting node \$v_c\$ as the reference node (\$v_c = 0\$) and node \$v_a\$ as the super node (\$v_a = E\$) gives this matrix equation, which is the same as modified nodal analysis:
\begin{gather} \begin{bmatrix} G & -G & 1 \\ -G & G + C\omega j & 0 \\ 1 & 0 & 0 \end{bmatrix} \begin{bmatrix} v_a \\ v_b \\ i_a \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ E \end{bmatrix}\text{.} \end{gather}
Solving the equation (and substituting \$E\$ with \$V_0\angle 0\$) yields below:
\begin{gather} \begin{bmatrix} v_a \\ v_b \\ i_a \end{bmatrix} = \begin{bmatrix} V_0 \\ \frac{V_0}{G^2 + C^2{\omega}^2} \left( G^2 - GC{\omega}j \right) \\ \frac{-V_0}{G^2 + C^2{\omega}^2} \left( GC^2\omega^2 + G^2C{\omega} j \right) \end{bmatrix}\text{.} \end{gather}
Substituting \$V_0 = G = C = 1\$ and \$ s = \omega j\$, and solving for \$v_{resistor}\$ and \$v_{capacitor}\$ yields below:
$$ v_{\text{resistor}}(s) = v_a - v_b = 1 - \frac{1-\omega j}{1+\omega ^2} = 1 - \frac{1}{s+1}\text{,} $$ $$ v_{\text{capacitor}}(s) = v_b - v_c = v_b = \frac{1-\omega j}{1+\omega ^2} = \frac{1}{s+1}\text{.} $$
The problem begins when I apply the inverse Laplace transform and get the solution in \$t\$: $$ v_{\text{resistor}}(t) = \mathcal{L}^{-1} \left\{v_{\text{resistor}}(s)\right\} = \mathcal{L}^{-1} \left\{1 - \frac{1}{s+1}\right\} = \delta(t) - e^{-t} \text{,} $$ $$ v_{\text{capacitor}}(t) = \mathcal{L}^{-1} \left\{v_{\text{capacitor}}(s)\right\} = \mathcal{L}^{-1} \left\{\frac{1}{s+1}\right\} = e^{-t} \text{.} $$
I have several questions: Why do i get an exponentially decaying time function (is this correct), when there was an assumption made about the sinusoidal state which led to \$Y_{\text{capacitor}} = C\omega j\$ and \$ s = \omega j\$ (no exponential decay)? Also, I don't have an exact clue about what these two represent: \$v_{\text{resistor}}(t)\$ looks similar to \$ 1- e^{-t}\$, and this should be for the capacitor voltage, not resistor. I think the two are swapped, but I couldn't find a flaw in the logic. I'd greatly appreciate your help.
Reason for using modified nodal analysis I have very limited knowledge of AC electric circuit analysis/signal processing (Dirac delta function)/time and phase/frequency domain in Laplace transform. My ultimate goal is to perform modified nodal analysis on a system of very large and complex RC circuit network with a DC voltage source (hence multiple nodes) and obtain all nodal voltages with respect to time \$ t\$, probably using Python (Numpy and Scipy). I've been searching for the most efficient and scalable method for the past 3 weeks for the RC circuit analysis. I know how to obtain a differential equation for above circuit, but with many resistors and capacitors, it will lead to solving a differential matrix equation (preferably analytically), which would be my last option.