# Homework Help: Deriving Q (t)=Qmax (1-e^(-t/tau)). Stuck. Please help.

Tags:
1. Mar 27, 2016

### kamhogo

1. The problem statement, all variables and given/known data
I am trying to derive the equation for the charge of a capacitor as a function of time: Q (t) = Qmax (1-e^(-t/tau).

2. Relevant equations
Kirchhoff's loop law
I (t) = dQ(t)/dt
Delta Vbat= Epsilon
Delta Vresistor= -I*R = [-dQ(t)/dt]*R
Delta Vcapacitor= Q/C
Qmax = C*Epsilon
Tau = R*C

3. The attempt at a solution
Kirchhoff's loop law
Epsilon - I*R - (Q/C) = 0
Epsilon - [dQ(t)/dt]*R -(Q/C) =0
[dQ(t)/dt] = [Epsilon -(Q/C) ]/R
= (C*Epsilon -Q)/RC
= (Qmax -Q) / tau

Multiply both sides by dt and divide by Q
dQ(t)/Q = [{(Qmax/Q) - 1}*{1/tau}]dt

Integrate both sides
lnQ(t) ={(Qmax/Q) - 1}*{1/tau}

Take the inverse natural logarithm on both sides
Q(t) = e^[(Qmax/Q) - 1}*{1/tau}]

Voilà. What am I doing wrong. I've been trying to get the right equation for hours. Is what I found equivalent to the equation in the post title? Thanks in advance for any help.

2. Mar 27, 2016

### TSny

You didn't integrate the right side correctly. Note that Q on the right hand side is a function of t.

Hint: Go back where you divided both sides by Q and divide both sides by Qmax - Q instead.

3. Mar 27, 2016

### kamhogo

Si I did as you suggested and got:

[dQ(t)]/(Qmax - Q(t)) = (1/tau)dt
([dQ(t)]/Qmax) - ([dQ(t)]/Q(t)) = (1/tau)dt

Integrate both sides
(Q(t)/Qmax) - lnQ(t) = 1/tau
Q(t) = [lnQ(t) + (1/tau)]*Qmax

And then I'm stuck again...:(

4. Mar 27, 2016

### TSny

The second line does not follow from the first line.
Note that $\frac{a}{b-c} \neq \frac{a}{b} - \frac{a}{c}$. For example $\frac{1}{3-1} \neq \frac{1}{3} - \frac{1}{1}$

You should be able to integrate dQ(t)]/(Qmax - Q(t)) directly. If you need to, make the substitution u = Qmax - Q(t)

5. Mar 27, 2016

### kamhogo

I see. Sorry, my math skills are lacking...
So the integral of dx/(a-x) is ln (a-x), hence the integral of dQ(t) / (Qmax - Q(t)) is ln ( Qmax - Q(t). (Right?)

Thus Qmax - Q(t) = e^(1/tau)
Q(t)= Qmax - e^(1/tau) --- which is incorrect....another hint please?

6. Mar 28, 2016

### cnh1995

It is -ln(a-x)..
KVL equation becomes
R(dq/dt)+q/C=V
∴Rdq/dt=(CV-q)/C
dq/(Qmax-q)=dt/RC
(CV=Qmax)..
Integrate this equation using proper limits and you'll get the answer.

7. Mar 28, 2016

### TSny

As cnh1995 pointed out, when you integrated the left side of your equation, you missed a negative sign.

Also, $\int \frac{dt}{\tau} \neq \frac{1}{\tau}$. Recall that $\int dx = x + k$, where $k$ is an arbitrary constant of integration. The constant of integration will be important.

8. Mar 28, 2016

### kamhogo

Almost there......

dQ(t) /( Qmax - Q(t)) = (1/tau) dt

Integrate both sides ( indefinite integral for the right side; upper limit = Q ( t ) & lower limit = 0 for the left side )

This gives:
-ln (|Q(t) - Qmax | ) + ln ( | 0 - Qmax | ) = t / tau

Multiply both sides by -1
ln (Q(t) - Qmax ) - ln ( Qmax ) = -t/tau

ln(a) - ln(b) = ln(a/b) so...
ln [{Q(t) -Qmax }/Qmax ] = -t/tau

ln(x) = y ==> x = e^y
(Q(t)/Qmax) - (Qmax/Qmax) = e^(-t/tau)
Q(t) = [(e^(-t/tau)) + 1]*Qmax

Still not correct. I don't know why I get +1 instead of -1 in the equation. ....

9. Mar 28, 2016

### TSny

Careful with removing the absolute value. Recall |x| = x if x ≥ 0 and |x| = -x if x < 0.

10. Mar 28, 2016

### kamhogo

Really? I thought an absolute value is always positive......

11. Mar 28, 2016

### TSny

Yes, that's absolutely true, except for |0|.

So, consider |x| when x = -2. Does |x| = x or does |x| = -x?

Last edited: Mar 28, 2016
12. Mar 29, 2016

### kamhogo

Ok, I shall not give up!

-ln (|Q(t) - Qmax | ) + ln ( | 0 - Qmax | ) = t / tau
-ln ( | -(-Q (t) + Qmax) |) + ln ( Qmax ) = t/tau
ln ( Qmax ) - ln ( Qmax -Q (t)) = t/tau
Qmax/(Qmax - Q (t)) = e^(1/tau)
Qmax - Q (t) = Qmax/(e^(1/tau))
- Q (t) = Qmax*(e^(-1/tau)) - Qmax

Multiply both sides by -1
Q(t) = Qmax -Qmax*(e^(-1/tau))

Q (t) = Qmax * ( 1 - e^(-1/tau))

Is it too soon to celebrate?

13. Mar 29, 2016

### TSny

I believe that's correct. Good work!

14. Mar 29, 2016

### kamhogo

Thank you all so much! Hard, collaborative work does pay off!

15. Mar 29, 2016

### kamhogo

Sorry, distraction error. Please replace all e^(-1/tau) with e^(-t/tau).