How do i calculate capacitor in a RC circuit ?

MrAl

Joined Jun 17, 2014
13,724
Hi,

Well let's see...

Vc=Vs(1-e^-t/Rc)
Vc/Vs=1-e^(-t/RC)
Vc/Vs-1=-e^(-t/RC)
1-Vc/Vs=e^(-t/RC)
ln(1-Vc/Vs)=-t/RC
R*ln(1-Vc/Vs)=-t/C
(-R/t)*ln(1-Vc/Vs)=1/C
1/[(-R/t)*ln(1-Vc/Vs)]=C
-t/[R*ln(1-Vc/Vs)]=C
C=-t/[R*ln(1-Vc/Vs)]

So it looks like you have it right now, if we assume you have parens in the denominator of the right side of your last expression.

One more small simplification results (we get rid of the leading minus sign) using a log identity and we get:
C=t/[R*ln(Vs/(Vs-Vc))]

although that's not really a necessity.
 

WBahn

Joined Mar 31, 2012
32,944
Word of caution: You need to be more careful about order of operations in your equations.

When you write:

Vc=Vs(1-e^-t/Rc)

most humans will understand what you meant (usually without thinking about it), but what you meant is NOT what you wrote.

The fact that humans are very good at extracting the correct intent in situations like this actually works to our disadvantage because it trains us to be sloppy and, invariably, we continue those same sloppy practices even when it's a computer and not a human that must interpret what we write.

Properly applying (the pretty much universal) order of operations to the above equation yields

\(V_c \; = \; V_s \left( 1 \; - \; \frac{e^{-t}}{R} c \right) \)

What you should have written was

Vc=Vs(1-e^(-t/(Rc)))

None of those parentheses are optional -- they MUST be there to override the order of operations.

You really need to get in the habit of writing equations correctly, otherwise you WILL type them in incorrectly into a program or a spreadsheet or a calculator and then spend forever wondering why the computer is doing it wrong -- and you will likely become convinced that it is the computer that is wrong and not you, because YOU are seeing what you MEANT to write instead of what you ACTUALLY wrote.

I've seen it over and over (and, like most people, have fallen victim to it myself).
 
Last edited:
why is my answer to this 2.67 haha im also trying to learn this and seriously struggling! I understand the natural response and how to isolate the C but im struggling to apply it
 

WBahn

Joined Mar 31, 2012
32,944
why is my answer to this 2.67 haha im also trying to learn this and seriously struggling! I understand the natural response and how to isolate the C but im struggling to apply it
How can we possibly tell WHY your answer is 2.67 (in some unstated unit of measure) unless you show us HOW you got that answer?
 
How can we possibly tell WHY your answer is 2.67 (in some unstated unit of measure) unless you show us HOW you got that answer?
My answer is so wrong im not even going to try and justify it Haha
Back to the beginning I suppose lol
I just just t (4) divided by 1 (ohm) times vs (5) divided by vs (5) minus vc (2) and ended up with 2.67 Haha God kill me
 

WBahn

Joined Mar 31, 2012
32,944
My answer is so wrong im not even going to try and justify it Haha
Back to the beginning I suppose lol
I just just t (4) divided by 1 (ohm) times vs (5) divided by vs (5) minus vc (2) and ended up with 2.67 Haha God kill me
That actually doesn't help a whole lot.

Using the normal rules of precedence and associativity:

t (4) divided by 1 (ohm) => (4 s) / (1 Ω) = 4 s/Ω
times vs (5) => (4 s/Ω)(5 V) = 20 Vs/Ω
divided by vs (5) => (20 V·s/Ω) / (5 V) = 4 s/Ω
minus vc (2) => (4 s/Ω) - (2 V) = can't be done because you can't subtract two things that are dimensionally incompatible.

So now we either have to try to get you to be more precise with your description or reverse engineer what you wrote to try to figure out what you meant to write.

Since 2.67 * 3 = 8, that's at least an integer and argues that you meant divide by (Vs-Vc). But I don't see how to get 8. I can get 0.8 s/(V·Ω) by dividing t by (R·Vs).

Looking back at the original problem, I see that Vs was 12 V and R was 1 MΩ.

So much for reverse guessing.

If you can't solve the equation

\(V_c \; = \; V_s \left( 1 \; - \; e^{\frac{-t}{RC}} \right) \)

for C given all of the other parameters, then you can always do so numerically.

Pick a value of C and plug it in along with t = 4 s, R = 1 MΩ, and Vs = 12 V. Make a note of what you get, primarily whether it is too big or too small compared to Vc = 2 V.

For instance, pick C = 1 μF.

\(V_c \; = \; 12\,V \left( 1 \; - \; e^{\frac{-4 s}{1 M\Omega \; 1 \mu F}} \right) \; = \; 11.78 \, V\)

So this capacitor is too small because it is nearly completely charged after 4 s. So make it 10x larger and redo it.

\(V_c \; = \; 12\,V \left( 1 \; - \; e^{\frac{-4 s}{1 M\Omega \; 10 \mu F}} \right) \; = \; 3.96 \, V\)

That's off by just a factor of two, so make C larger by a factor of 2 and try again.

\(V_c \; = \; 12\,V \left( 1 \; - \; e^{\frac{-4 s}{1 M\Omega \; 20 \mu F}} \right) \; = \; 2.18 \, V\)

Now we are within 10%, but still too small, so make C larger by 10% and try again.

\(V_c \; = \; 12\,V \left( 1 \; - \; e^{\frac{-4 s}{1 M\Omega \; 22 \mu F}} \right) \; = \; 1.995 \, V\)

That's probably plenty close enough, so C ≈ 22 μF.

If we solve for C directly, we get C = 21.9 μF (to three sig figs).
 
That actually doesn't help a whole lot.

Using the normal rules of precedence and associativity:

t (4) divided by 1 (ohm) => (4 s) / (1 Ω) = 4 s/Ω
times vs (5) => (4 s/Ω)(5 V) = 20 Vs/Ω
divided by vs (5) => (20 V·s/Ω) / (5 V) = 4 s/Ω
minus vc (2) => (4 s/Ω) - (2 V) = can't be done because you can't subtract two things that are dimensionally incompatible.

So now we either have to try to get you to be more precise with your description or reverse engineer what you wrote to try to figure out what you meant to write.

Since 2.67 * 3 = 8, that's at least an integer and argues that you meant divide by (Vs-Vc). But I don't see how to get 8. I can get 0.8 s/(V·Ω) by dividing t by (R·Vs).

Looking back at the original problem, I see that Vs was 12 V and R was 1 MΩ.

So much for reverse guessing.

If you can't solve the equation

\(V_c \; = \; V_s \left( 1 \; - \; e^{\frac{-t}{RC}} \right) \)

for C given all of the other parameters, then you can always do so numerically.

Pick a value of C and plug it in along with t = 4 s, R = 1 MΩ, and Vs = 12 V. Make a note of what you get, primarily whether it is too big or too small compared to Vc = 2 V.

For instance, pick C = 1 μF.

\(V_c \; = \; 12\,V \left( 1 \; - \; e^{\frac{-4 s}{1 M\Omega \; 1 \mu F}} \right) \; = \; 11.78 \, V\)

So this capacitor is too small because it is nearly completely charged after 4 s. So make it 10x larger and redo it.

\(V_c \; = \; 12\,V \left( 1 \; - \; e^{\frac{-4 s}{1 M\Omega \; 10 \mu F}} \right) \; = \; 3.96 \, V\)

That's off by just a factor of two, so make C larger by a factor of 2 and try again.

\(V_c \; = \; 12\,V \left( 1 \; - \; e^{\frac{-4 s}{1 M\Omega \; 20 \mu F}} \right) \; = \; 2.18 \, V\)

Now we are within 10%, but still too small, so make C larger by 10% and try again.

\(V_c \; = \; 12\,V \left( 1 \; - \; e^{\frac{-4 s}{1 M\Omega \; 22 \mu F}} \right) \; = \; 1.995 \, V\)

That's probably plenty close enough, so C ≈ 22 μF.

If we solve for C directly, we get C = 21.9 μF (to three sig figs).
Dude thankyou. You've really helped me understand this! Was really struggling with it. Il definitely be using the value and plug for my homework thank you!
 

WBahn

Joined Mar 31, 2012
32,944
Dude thankyou. You've really helped me understand this! Was really struggling with it. Il definitely be using the value and plug for my homework thank you!
You will far, far better served by strengthening your math skills so that you can just solve for the desired quantity. If you don't, your struggles are only going to get worse.
 
You will far, far better served by strengthening your math skills so that you can just solve for the desired quantity. If you don't, your struggles are only going to get worse.
I just cant wrap my head around it on here. I need face to face maths lessons but cant find anywhere locally sadly. Ive spent 2 hours after work for 3 nights trying to work through that and understand it.
 

WBahn

Joined Mar 31, 2012
32,944
I just cant wrap my head around it on here. I need face to face maths lessons but cant find anywhere locally sadly. Ive spent 2 hours after work for 3 nights trying to work through that and understand it.
The key is to develop very strong algebra skills -- that's probably the single most important math skill that you need, if for no other reason than your ability to manipulate equations algebraically is fundamental to working with nearly every other are of mathematics.

Take:

\(V_c \; = \; V_s \left( 1 \; - \; e^{\frac{-t}{RC}} \right) \)

We want to solve this equation for C. The key is to progressively get everything else over to the other side by performing the same operation on both sides at each step.

So start with dividing both sides by Vs:

\(\frac{V_c}{V_s} \; = \; 1 \; - \; e^{\frac{-t}{RC}} \)

Now add the exponential term to both sides:

\(\frac{V_c}{V_s} \; + \; e^{\frac{-t}{RC}} \; = \; 1\)

Now subtract the ratio of the two voltages from both sides:

\(e^{\frac{-t}{RC}} \; = \; 1 \; - \; \frac{V_c}{V_s} \)

Now take the natural logarithm of both sides:

\(\frac{-t}{RC} \; = \; \ln{ \left( 1 \; - \; \frac{V_c}{V_s} \right)} \)

Now multiply both sides by C:

\(\frac{-t}{R} \; = \; C \, \ln{ \left( 1 \; - \; \frac{V_c}{V_s} \right)} \)

Now divide both sides by the logarithmic portion:

\(\frac{-t}{R \, \ln{ \left( 1 \; - \; \frac{V_c}{V_s} \right)}} \; = \; C \)
 
The key is to develop very strong algebra skills -- that's probably the single most important math skill that you need, if for no other reason than your ability to manipulate equations algebraically is fundamental to working with nearly every other are of mathematics.

Take:

\(V_c \; = \; V_s \left( 1 \; - \; e^{\frac{-t}{RC}} \right) \)

We want to solve this equation for C. The key is to progressively get everything else over to the other side by performing the same operation on both sides at each step.

So start with dividing both sides by Vs:

\(\frac{V_c}{V_s} \; = \; 1 \; - \; e^{\frac{-t}{RC}} \)

Now add the exponential term to both sides:

\(\frac{V_c}{V_s} \; + \; e^{\frac{-t}{RC}} \; = \; 1\)

Now subtract the ratio of the two voltages from both sides:

\(e^{\frac{-t}{RC}} \; = \; 1 \; - \; \frac{V_c}{V_s} \)

Now take the natural logarithm of both sides:

\(\frac{-t}{RC} \; = \; \ln{ \left( 1 \; - \; \frac{V_c}{V_s} \right)} \)

Now multiply both sides by C:

\(\frac{-t}{R} \; = \; C \, \ln{ \left( 1 \; - \; \frac{V_c}{V_s} \right)} \)

Now divide both sides by the logarithmic portion:

\(\frac{-t}{R \, \ln{ \left( 1 \; - \; \frac{V_c}{V_s} \right)}} \; = \; C \)
I understand that, but using the given values to actually work out an answer for C I'm struggling with. Are you a tutor? You're great at explanations.
 

WBahn

Joined Mar 31, 2012
32,944
I understand that, but using the given values to actually work out an answer for C I'm struggling with. Are you a tutor? You're great at explanations.
If you understand the above, then just plug in the given values and evaluate the expression:

\( \frac{-t}{R \, \ln{ \left( 1 \; - \; \frac{V_c}{V_s} \right)}} \; = \; C \)

Vs = 12 V
Vc = 2 V
R = 1 MΩ
t = 4 s

\( C \; = \; \frac{-4 \, s}{10 \, M \Omega \, \ln{ \left( 1 \; - \; \frac{2 \, V}{12 \, V} \right)}} \)

Now just evaluate it.

\( C \; = \; \frac{-4 \, s}{10 \, M \Omega \, \ln{ \left( 0.83333 \right)}} \)

\( C \; = \; \frac{-4 \, s}{10 \, M \Omega \, \left( -0.18232 \right)} \)

\( C \; = \; \frac{4 \, s}{ 1.8232 \, M \Omega} \)

\( C \; = \; \frac{4 \, s}{ 1.8232 \, M \Omega} \)

\( C \; = \; 2.1939 \, \frac{s}{M \Omega} \)

Next we can deal with the scaling prefix:

\( C \; = \; 2.1939 \, \frac{s}{M \Omega} \left( \frac{M}{10^{6}} \right) \left( \frac{\mu}{10^{-6}} \right) \; = \; 2.1939 \, \frac{\mu s}{\Omega} \)

Now just deal with the units.

From V = IR we can see that 1 Ω = 1 V/A

\( C \; = \; 2.1939 \, \frac{\mu s}{\Omega} \left( \frac{\Omega}{\left( \frac{V}{A} \right)} \right) \; = \; 2.1939 \, \frac{\mu As}{V} \)

and we know that 1 ampere = 1 columb/s, so 1 A·s = 1 C

\( C \; = \; 2.1939 \, \frac{\mu As}{V} \left( \frac{C}{As} \right) \; = \; 2.1939 \, \frac{\mu C}{V}\)

From Q = CV we can see that 1 F = 1 C/V.

\( C \; = \; 2.1939 \, \frac{\mu C}{V} \left( \frac{F}{\left( \frac{C}{V} \right)} \right) = \; 2.1939 \, \mu F \)

To three significant figures this is then

C = 2.19 μF
 

WBahn

Joined Mar 31, 2012
32,944
You need to be more careful.

What you meant is Vc/Vs = 1-e^(-t/(RC)).
Addressed 3.5 years ago

Easy to miss in such an old thread.

You should learn how to use latex (as should everyone else posting equations): \( \frac{V_C}{V_S} = 1-e^{-\frac{t}{RC}} \)
Note that the \ ( and \ ) tags (I had to add a space to keep them from being interpreted as something else, even when using the PLAIN BB-code tags) no longer work (at least with some browsers). It appears that \left( and \right) work consistently (AFAIK).
 

Nww

Joined Oct 21, 2020
2
If you understand the above, then just plug in the given values and evaluate the expression:

\( \frac{-t}{R \, \ln{ \left( 1 \; - \; \frac{V_c}{V_s} \right)}} \; = \; C \)

Vs = 12 V
Vc = 2 V
R = 1 MΩ
t = 4 s

\( C \; = \; \frac{-4 \, s}{10 \, M \Omega \, \ln{ \left( 1 \; - \; \frac{2 \, V}{12 \, V} \right)}} \)

Now just evaluate it.

\( C \; = \; \frac{-4 \, s}{10 \, M \Omega \, \ln{ \left( 0.83333 \right)}} \)

\( C \; = \; \frac{-4 \, s}{10 \, M \Omega \, \left( -0.18232 \right)} \)

\( C \; = \; \frac{4 \, s}{ 1.8232 \, M \Omega} \)

\( C \; = \; \frac{4 \, s}{ 1.8232 \, M \Omega} \)

\( C \; = \; 2.1939 \, \frac{s}{M \Omega} \)


Why do you suddenly go from 1MOhm to 10MOhm??
 
Top