2
\$\begingroup\$

I have a long RC line, e.g.:

schematic

simulate this circuit – Schematic created using CircuitLab

Is there a good way to obtain the voltages on nodes V1, ..., Vn (possibly approximated) at a specific time \$t\$ when the input is a voltage step -- without firing up a circuit simulator?

Note that with R1=R2=Rn and C1=C2=Cn this becomes way more tractable (=transmission line without LG) but this is not the case for me. Typical n values are around 100.

My idea was to use MATLAB and to iteratively solve for the impedance at each node

$$ Z_i = \frac{1}{s C_i + \frac{1}{R_{i+1}+Z_{i+1}}} \\ Z_{n+1} = \infty $$

then use the voltage divider recursively:

$$ V_1 = \frac{V_0}{s} \\ V_{i+1} = V_i \frac{Z_i}{R_i + Z_i} $$

and finally use step function of \$V_i/V1\$ to get the time domain sample:

s = tf('s');
Z = cell(n+1,1);
Z{n+1} = inf;
V = cell(n+1,1);
V{1} = 1;
for i=n:-1:1
    Z{i} = 1/(s*C(i) + 1/(R(i+1) + Z{i+1}));
end
for i=2:n+1
    V{n} = V{i-1} * Z{i-1}/(R(i-1) + Z{i-1});
    Vs(i) = step(V{n}, t);
end

This actually works well but only for very small orders (n<10); otherwise I run into numerical issues. Using zpk improves the situation a bit but not much. And ss is way too slow.

\$\endgroup\$
4
  • \$\begingroup\$ It is not, unfortunately (see details in my question); all R and C are different \$\endgroup\$
    – divB
    Commented Jul 7, 2022 at 10:10
  • \$\begingroup\$ @Chu You're right, there is. \$\endgroup\$ Commented Jul 7, 2022 at 19:50
  • \$\begingroup\$ @aconcernedcitizen The link is for the buffered stages case. The OP doesn't have buffers between sections. \$\endgroup\$
    – Chu
    Commented Jul 7, 2022 at 21:43
  • \$\begingroup\$ @Chu You haven't read everything, have you? ;-) While OP (on codidact) doesn't say if it's buffered or not, my answer deals with both cases. \$\endgroup\$ Commented Jul 8, 2022 at 18:55

2 Answers 2

1
\$\begingroup\$

Since this is an unbuffered RC ladder, every stage will be influenced both by the previous, and the next stage, which means what you want to do is not exactly precise; it's an approximation, at best. it might get more accurate if the input stage has an output impedance, seen by the next stage's input impedance, much cgeater (10x or more), but it's unpractical.

For 100 stages or so, you may as well forget about solving this symbolically, but you could do it numerically. In doing so, you should get all the intermediary transfer functions, and then you should be able to get their impulse responses.

For example, a 3-stage RC ladder with no load (for simplicity) can be solved like this (I'll use wxMaxima since I am more familiar with it):

n:3$                        /* number of stages */
v:makelist('V[k],k,1,n+1)$  /* voltage placeholders */
r:makelist('R[k],k,1,n)$    /* resistors */
c:makelist('C[k],k,1,n)$    /* capacitors */
/* construct the equations */
eq:makelist(v[k+1]*(s*c[k]+1/r[k]+(if k<n then 1/r[k+1] else 0))
    =v[k]/r[k]+(if k<n then v[k+2]/r[k+1] else 0),k,1,n);

 [V[2]*(C[1]*s+1/R[2]+1/R[1])=V[3]/R[2]+V[1]/R[1],V[3]*(C[2]*s+1/R[3]+1/R[2])=V[4]/R[3]+V[2]/R[2],V[4]*(C[3]*s+1/R[3])=V[3]/R[3]]

solve(eq,rest(v))[1][n]/v[1];

 [V[2]/V[1]=(C[2]*R[2]*C[3]*R[3]*s^2+(C[3]*R[3]+R[2]*(C[3]+C[2]))*s+1)/(C[1]*R[1]*C[2]*R[2]*C[3]*R[3]*s^3+(R[1]*(C[2]*C[3]*R[3]+C[1]*C[3]*R[3])+R[2]*(C[2]*C[3]*R[3]+C[1]*R[1]*(C[3]+C[2])))*s^2+(C[3]*R[3]+R[1]*(C[3]+C[2]+C[1])+R[2]*(C[3]+C[2]))*s+1),
  V[3]/V[1]=(C[3]*R[3]*s+1)/(C[1]*R[1]*C[2]*R[2]*C[3]*R[3]*s^3+(R[1]*(C[2]*C[3]*R[3]+C[1]*C[3]*R[3])+R[2]*(C[2]*C[3]*R[3]+C[1]*R[1]*(C[3]+C[2])))*s^2+(C[3]*R[3]+R[1]*(C[3]+C[2]+C[1])+R[2]*(C[3]+C[2]))*s+1),
  V[4]/V[1]=1/(C[1]*R[1]*C[2]*R[2]*C[3]*R[3]*s^3+(R[1]*(C[2]*C[3]*R[3]+C[1]*C[3]*R[3])+R[2]*(C[2]*C[3]*R[3]+C[1]*R[1]*(C[3]+C[2])))*s^2+(C[3]*R[3]+R[1]*(C[3]+C[2]+C[1])+R[2]*(C[3]+C[2]))*s+1)]    

subst(flatten(makelist([r[k]=R,c[k]=C],k,1,n)),%);

 [V[2]/V[1]=(C^2*R^2*s^2+3*C*R*s+1)/(C^3*R^3*s^3+5*C^2*R^2*s^2+6*C*R*s+1),
  V[3]/V[1]=(C*R*s+1)/(C^3*R^3*s^3+5*C^2*R^2*s^2+6*C*R*s+1),
  V[4]/V[1]=1/(C^3*R^3*s^3+5*C^2*R^2*s^2+6*C*R*s+1)]

subst([R=1,C=1],%);

 [V[2]/V[1]=(s^2+3*s+1)/(s^3+5*s^2+6*s+1),
  V[3]/V[1]=(s+1)/(s^3+5*s^2+6*s+1),
  V[4]/V[1]=1/(s^3+5*s^2+6*s+1)]

V[1] is the input and V[n] (=V[4] here) is the output. The last two subst() are only there for comparison: the first to show simplifications when all resistors are R and all capacitors are C, and the second when R=1, C=1.

For 100 stages, the symbolic solver will, no doubt, both take a lot of time (if it will even have memory), and take a very large display, which means that, prior to running solve() you will need numeric substitution. it's still not guaranteed you'll be able to solve it, given the exponentially increase in numerical errors (see the Wilkinson's polynomial, for example).

The same goes for finding out the impulse response, since it relies on partial fraction expansion (you said you don't want to use a simulator) to find out the poles and the residues, after which the formula would be:

$$h(t)=\sum_{k=1}^N{\text{e}^{\Re(p_k)t}[\Re(r_k)\cos(\Im(p_k)t)-\Im(r_k)\sin(\Im(p_k)t)]}$$

Since it's an RC network, the poles will all be real, so the root finding algorithms should have less of a hassle.

\$\endgroup\$
0
\$\begingroup\$

Well, we have the following (general) circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

It is not hard to see, when using the voltage divider formula, that:

$$\text{v}_\text{n}=\text{v}_\text{i}\times\frac{\text{R}_2}{\text{R}_2+\text{R}_1}\times\frac{\text{R}_4}{\text{R}_4+\text{R}_3}\times\dots\times\frac{\text{R}_{\text{n}+1}}{\text{R}_{\text{n}+1}+\text{R}_\text{n}}=\text{v}_\text{i}\prod_{\text{k}\space=\space1}^\text{n}\frac{\text{R}_{2\text{k}}}{\text{R}_{2\text{k}}+\text{R}_{2\text{k}-1}}\tag1$$

Now, we apply Laplace transform in order to write:

$$\text{V}_\text{n}\left(\text{s}\right)=\text{V}_\text{i}\left(\text{s}\right)\prod_{\text{k}\space=\space1}^\text{n}\frac{\frac{1}{\text{sC}_\text{k}}}{\frac{1}{\text{sC}_\text{k}}+\text{R}_{2\text{k}-1}}=\text{V}_\text{i}\left(\text{s}\right)\prod_{\text{k}\space=\space1}^\text{n}\frac{1}{1+\text{sC}_\text{k}\text{R}_{2\text{k}-1}}\tag2$$

Using the convolution theorem of the Laplace transform, we can write:

$$\text{v}_\text{n}\left(t\right)=\int_0^t\text{v}_\text{i}\left(\tau\right)\cdot\mathscr{L}_\text{s}^{-1}\left[\prod_{\text{k}\space=\space1}^\text{n}\frac{1}{1+\text{sC}_\text{k}\text{R}_{2\text{k}-1}}\right]_{\left(t-\tau\right)}\space\text{d}\tau\tag3$$


EDIT: we can see that (when solving a practical example):

$$\text{P}_\text{n}\left(\text{s}\right):=\prod_{\text{k}\space=\space1}^\text{n}\frac{1}{1+\text{sC}_\text{k}\text{R}_{2\text{k}-1}}=\frac{1}{1+\text{sC}_1\text{R}_1}\prod_{\text{k}\space=\space2}^\text{n}\frac{1}{1+\text{sC}_\text{k}\text{R}_{2\text{k}-1}}\tag4$$

Using the convolution theorem of the Laplace transform, we can write:

$$\mathscr{L}_\text{s}^{-1}\left[\text{P}_\text{n}\left(\text{s}\right)\right]_{\left(t\right)}=\frac{1}{\text{C}_1\text{R}_1}\int_0^t\exp\left(-\frac{\sigma}{\text{C}_1\text{R}_1}\right)\cdot\mathscr{L}_\text{s}^{-1}\left[\prod_{\text{k}\space=\space2}^\text{n}\frac{1}{1+\text{sC}_\text{k}\text{R}_{2\text{k}-1}}\right]_{\left(t-\sigma\right)}\space\text{d}\sigma\tag5$$

So, we can see:

$$\displaystyle\text{v}_\text{n}\left(t\right)=\int_0^t\text{v}_\text{i}\left(\tau\right)\cdot\left\{\frac{1}{\text{C}_1\text{R}_1}\int_0^t\exp\left(-\frac{\sigma}{\text{C}_1\text{R}_1}\right)\cdot\mathscr{L}_\text{s}^{-1}\left[\prod_{\text{k}\space=\space2}^\text{n}\frac{1}{1+\text{sC}_\text{k}\text{R}_{2\text{k}-1}}\right]_{\left(t-\sigma\right)}\space\text{d}\sigma\right\}\space\text{d}\tau$$ $$=\frac{1}{\text{C}_1\text{R}_1}\int_0^t\int_0^t\text{v}_\text{i}\left(\tau\right)\exp\left(-\frac{\sigma}{\text{C}_1\text{R}_1}\right)\cdot\mathscr{L}_\text{s}^{-1}\left[\prod_{\text{k}\space=\space2}^\text{n}\frac{1}{1+\text{sC}_\text{k}\text{R}_{2\text{k}-1}}\right]_{\left(t-\sigma\right)}\space\text{d}\sigma\space\text{d}\tau\tag6$$

\$\endgroup\$
3
  • \$\begingroup\$ I didn't downvote, but I'd guess it's because of this: "Note that with R1=R2=Rn and C1=C2=Cn this becomes way more tractable (=transmission line without LG) but this is not the case for me.". \$\endgroup\$ Commented Jul 11, 2022 at 12:40
  • \$\begingroup\$ @aconcernedcitizen Sorry, read the question wrong. I edit it know. \$\endgroup\$ Commented Jul 11, 2022 at 13:44
  • 1
    \$\begingroup\$ Equation (1) does not hold because in the first R term, R2 is not R2, but R2 || <rest of the ladder to the right>, then R4 is R4 || <rest of the ladder to the right>, and so on. You can easily verify this. The expression for V(x) is the result of KVL/KCL (consider the values as the indices of the resistors, as they appear in the ladder). \$\endgroup\$ Commented Jul 13, 2022 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.