User:Teabagrumon/Sandbox

$$ \begin{array}{lrcll} \color{NavyBlue}\left(Eq\ 1\right)\color{Black}\qquad & i_1(t) & = & C\left(\frac{d}{dt}v_i(t)-\frac{d}{dt} v_a(t)\right)& \qquad\color{Brown}\left(\mathrm{Capacitor\ Equation\ for\ C_1}\right) \\\\

\color{NavyBlue}\left(Eq\ 2\right)\color{Black}\qquad & i_2(t) & = & C\left(\frac{d}{dt}v_a(t)-\frac{d}{dt} v_o(t)\right)& \qquad\color{Brown}\left(\mathrm{Capacitor\ Equation\ for\ C_2}\right) \\\\

\color{NavyBlue}\left(Eq\ 3\right)\color{Black}\qquad & i_2(t) & = & \frac{v_o(t)}{R_A}& \qquad\color{Brown}\left(\mathrm{Resistor\ Equation\ for\ R_A}\right) \\\\

\color{NavyBlue}\left(Eq\ 4\right)\color{Black}\qquad & i_3(t) & = & \frac{v_a(t)-v_o(t)}{R_B}& \qquad\color{Brown}\left(\mathrm{Resistor\ Equation\ for\ R_B}\right) \\\\

\color{NavyBlue}\left(Eq\ 5\right)\color{Black}\qquad & i_1(t) & = & i_2(t) + i_3(t)& \qquad\color{Brown}\left(\mathrm{Kirchhoff's\ Current\ Law}\right)

\end{array} $$

$$ \begin{array}{lrcl} \color{Red}\left(Eq\ 6\right)\color{Black}\qquad & \frac{v_o(t)}{R_A} + \frac{v_a(t)}{R_B} - \frac{v_o(t)}{R_B} & = & C \frac{d}{dt}v_i(t) - C \frac{d}{dt}v_a(t) \\\\

\color{Red}\left(Eq\ 7\right)\color{Black}\qquad & \frac{d}{dt}v_a(t) & = & \frac{v_o(t)}{C\,R_A}+\frac{d}{dt}v_o(t) \\\\

\color{Red}\left(Eq\ 7b\right)\color{Black}\qquad & v_a(t) & = & \frac{1}{C\,R_A}\,\int v_o(t)\, dt+v_o(t)+K_1 \\\\

\end{array} $$

$$ \color{PineGreen}\left(Eq\ 8\right)\color{Black}\qquad \frac{d}{dt}v_o(t) + \frac{2}{C\,R_A}v_o(t) + \frac{1}{C^2\,R_A\,R_B}\int v_o(t)\, dt = \frac{d}{dt}v_i(t) - \frac{K_1}{R_B} $$

$$ \begin{array}{lrcl} \color{Cerulean}\left(Eq\ 9\right)\color{Black}\qquad & v_o(t) & = & B\, s\,e^{r\,t}\sin\left(s\,t\right) - A\, s\,e^{r\,t}\cos\left(s\,t\right)\\\\ & r & = & \frac{1}{C\,R_A}\\\\ & s & = & \frac{\sqrt{R_A\,R_B - R_B^2}}{C\,R_A\,R_B} \end{array} $$

Here's with the new notation

$$ \begin{array}{lrcl} \color{Cerulean}\left(Eq\ 9\right)\color{Black}\qquad & v_o(t) & = & A \, e^{r\,t}\sin\left(s\,t\right) + B \, e^{r\,t}\cos\left(s\,t\right)\\\\ & r & = & \frac{1}{C\,R_A}\\\\ & s & = & \frac{\sqrt{R_A\,R_B - R_B^2}}{C\,R_A\,R_B} \end{array} $$

Rewritten for pre-computing:

$$ \begin{array}{lrcl} \color{Cerulean}\left(Eq\ 9b\right)\color{Black}\qquad & v_o(\Delta t) & = & A \, E_S + B \, E_C\\\\ & E_S & = & e^{r\,\Delta t}\sin\left(s\,\Delta t\right)\\\\ & E_C & = & e^{r\,\Delta t}\cos\left(s\,\Delta t\right)\\\\ & \Delta t & = & \frac{1}{Sampling\ Rate}\\\\ & r & = & \frac{1}{C\,R_A}\\\\ & s & = & \frac{\sqrt{R_A\,R_B - R_B^2}}{C\,R_A\,R_B} \end{array} $$

$$ \begin{array}{lrcl} \color{Violet}\left(Eq\ 10a\right)\color{Black}\qquad & A & = & A_1 \, v_o(0) + A_2 \, B\\\\ \color{Violet}\left(Eq\ 10b\right)\color{Black}\qquad & B & = & B_0 \, m + B_1 \, i_1(0) + B_2 \, v_o(0)\\\\ & A_1 & = & \frac{1}{r}\\\\ & A_2 & = & \frac{-s}{r}\\\\ & B_0 & = & \frac{r}{s\,r^2+s^3}\\\\ & B_1 & = & \frac{-r}{s\,r^2\,C+s^3\,C}\\\\ & B_2 & = & \frac{-r-r^2\,R_A\,C+s^2\,R_A\,C}{s\,r^2\,R_A\,C+s^3\,R_A\,C}\\\\ \end{array} $$

New Notation: $$ \begin{array}{lrcl} \color{Violet}\left(Eq\ 10a\right)\color{Black}\qquad & A & = & A_0 \, i_1(0) + A_1 \, v_o(0) + A_2 \, \Delta v_i\\\\ & \Delta v_i & = & v_i(\Delta t) - v_i(0)\\\\ & \Delta t & = & \frac{1}{Sample\ Rate}\\\\ & A_0 & = & \frac{-1}{C\,s}\\\\ & A_1 & = & \frac{-1}{C\,s\,R_A}-\frac{r}{s}\\\\ & A_2 & = & \frac{1}{s\,\Delta t}\\\\ \color{Violet}\left(Eq\ 10b\right)\color{Black}\qquad & B & = & v_o(0) \\\\ \end{array} $$

Output Forms: $$ v_{o1}(t)=A\,e^{r_1\,t}\,sin\left(s_1\,t\right)+B\,e^{r_1\,t}\,cos\left(s_1\,t\right) $$

$$ \begin{array}{rcll} v_{o2}(t) & = && U_{2,1}\,e^{r_1\,t}\,sin\left(s_1\,t\right) + V_{2,1}\,e^{r_1\,t}\,cos\left(s_1\,t\right)\\ && + & U_{2,2}\,e^{r_2\,t}\,sin\left(s_2\,t\right) + V_{2,2}\,e^{r_2\,t}\,cos\left(s_2\,t\right)\\\\ \end{array} $$

$$ \begin{array}{rcll} v_{oN}(t) & = && U_{N,1}\,e^{r_1\,t}\,sin\left(s_1\,t\right) + V_{N,1}\,e^{r_1\,t}\,cos\left(s_1\,t\right)\\ && + & U_{N,2}\,e^{r_2\,t}\,sin\left(s_2\,t\right) + V_{N,2}\,e^{r_2\,t}\,cos\left(s_2\,t\right)\\ && + & U_{N,3}\,e^{r_2\,t}\,sin\left(s_3\,t\right) + V_{N,2}\,e^{r_3\,t}\,cos\left(s_3\,t\right)\\ && + & \cdots\\ && + & U_{N,N}\,e^{r_N\,t}\,sin\left(s_N\,t\right) + V_{N,N}\,e^{r_N\,t}\,cos\left(s_N\,t\right) \end{array} $$

$$ \begin{array}{lrcl} \color{WildStrawberry}\left(Eq\ 11\right)\color{Black}\qquad & i_1(t) & = & J_0 \, \Delta v_i + J_1 \, A + J_2 \, B\\\\ & J_0 & = & \frac{C}{\Delta t}\\\\ & J_1 & = & \left(\frac{-1}{R_A}-C\,r\right)e^{r\,t}\,sin\left(s\,t\right) - C\,s\,e^{r\,t}\,cos\left(s\,t\right)\\\\ & J_2 & = & \left(\frac{-1}{R_A}-C\,r\right)e^{r\,t}\,cos\left(s\,t\right) + C\,s\,e^{r\,t}\,sin\left(s\,t\right)\\\\

\end{array} $$