# What is the equation for when a project will end given this formula for how fast work is done?

I want to calculate the rate at which work gets done on a project.

On each week some work is done and some new work is generated. The new work generated is directly proportional to the amount of work remaining in the project.

Work done on project

$dW = (cW - R) dt$

W = work remaining
R = rate of work
c = constant representing churn rate


How do I calculate when the project ends?

EDIT

Edited to remove original sign error where I had: $dW = (R - cW) dt$

-
Why the downvote? Except for the sign issue, this seems like an OK question. –  joriki Jan 6 '12 at 11:41
Sorry, there was an error in the calculation; I've corrected the answer. –  joriki Jan 6 '12 at 12:20

The general solution of this ordinary linear differential equation is

$$W=\frac Rc+a\mathrm e^{ct}\;.$$

Thus, if the initial workload is above $R/c$, work will pile up exponentially ($a\gt0$), whereas if the initial workload is below $R/c$, it will decrease exponentially ($a\lt0$), but the rate won't exceed $R$ before the work becomes $0$. The time $T$ to finish as a function of the initial workload is given by

$$W_0=W(t=0)=\frac Rc+a\;,$$

$$a=W_0-\frac Rc\;,$$

$$0=W(t=T)=\frac Rc+a\mathrm e^{cT}=\frac Rc+\left(W_0-\frac Rc\right)\mathrm e^{cT}\;,$$

$$\left(\frac Rc-W_0\right)\mathrm e^{cT}=\frac Rc\;,$$

$$\mathrm e^{cT}=\frac{\frac Rc}{\frac Rc-W_0}=\frac{1}{1-\frac{cW_0}R}\;,$$

$$cT=\log\frac{1}{1-\frac{cW_0}R}=-\log\left(1-\frac{cW_0}R\right)\;,$$

$$T=-\frac{\log\left(1-\frac{cW_0}R\right)}c\;,$$

where $\log$ denotes the natural logarithm.

-
This looks great thank you - it behaves as I expected and also reminded me how to do an integration of $dy/dx = y$. I have one question though which is when I was working it through I initially made the same sign error at the end as you did. Your version is right but I can't see where the negatives come from in my workings –  Peter Nixey Jan 6 '12 at 12:58
@Peter: I've written out the steps in more detail. The penultimate line uses $\log(1/x)=-\log x$. –  joriki Jan 6 '12 at 14:33
Ahh yes, I see now - thanks very much btw, this was my first question on math.stackexchange and you made it incredibly fulfilling - even reignited my enthusiasm more maths (my degree was in physics). Much appreciated –  Peter Nixey Jan 6 '12 at 14:49
@Peter: You're very welcome. My degree was in physics, too :-) –  joriki Jan 6 '12 at 15:01