Exponential decay: I need an expression for N at time t

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
6 replies · 2K views
Jehannum
Messages
102
Reaction score
26
I have a large quantity N, which starts off equal to a determinable value N0.

Over a short time ∆t, the value of N changes by -∆t*(B*N - C)

where B and C are determinable constants. Am I correct in thinking I can turn this into:

dN/dt = -(B*N - C)

How do I get this into a formula for N at time t? The 'extra' constant C seems to be making it more difficult than the examples of exponential decay I've found on the net.
 
Physics news on Phys.org
There are various ways to solve the differential equation, but the easiest is to "guess" the answer: an exponential function plus a constant. You can then find the parameters of this ansatz.
 
Jehannum said:
I have a large quantity N, which starts off equal to a determinable value N0.

Over a short time ∆t, the value of N changes by -∆t*(B*N - C)

where B and C are determinable constants. Am I correct in thinking I can turn this into:

dN/dt = -(B*N - C)

How do I get this into a formula for N at time t? The 'extra' constant C seems to be making it more difficult than the examples of exponential decay I've found on the net.

You can solve the equation in two steps:
1) Solve the homogeneous equation: ##dN_h/dt=-B*N_h(t)##
2) Then, you need to find a particular solution satisfying the full equation. In this case we can guess ##N_p(t)=A##, where ##A## is to be determined.
3) The most general solution is ##N(t)=N_h(t)+N_p(t)##
 
Unfortunately, my maths isn't yet advanced enough to do that.

I've been using a computer program to iterate the value of N over shorter and shorter dt intervals:

Num0 = 8.98249E+23 'Num0 = start value of N
B = 1.3831E-3
C = 1.21989E+21​

Numleft = Num0 'Numleft is the value of N as it decreases through the iterations

For time = 0 To (120 / dt) Step dt
Numleft = Numleft - dt * (B * Numleft - C)
Next time

As I try smaller and smaller values of dt, the final value of Numleft converges to 8.82E23

B and C will change in different situations. I'd like a non-iterative equation to find Numleft for any B and C (these will always be positive, if that helps).

PS. I notice that the constant C is not multiplied by Numleft, so the calculation in the loop could be written as: Numleft = Numleft - dt * B * Numleft + dt * C

Does this mean that dt * C can be ignored as dt -> 0?​
 
Jehannum said:
Unfortunately, my maths isn't yet advanced enough to do that.
That is more complicated than finding the exact solution.
 
I don't know what your background in Mathematics is. How to solve that differential equation is taught in a first course in differential equations, already in high school. Anyway, I can give some advice regarding how to solve it numerically. I don't know if you can find a non-iterative equation unless you solve it analytically.
However, I think you have misunderstood the way it should be solved. To do this numerically the simplest way is to discretize the equation. That is,
##dN \rightarrow N_{k+1}-N_{k)}, dt\rightarrow\Delta_t=t_{k+1}-t_{k}##, where ##N_{k+1}=N(t_{k+1}), N_{k}=N(t_{k})##. Here, ##t_k=k*\Delta##, assuming a equidistant mesh in time.
Then, you have
##N_{k+1}=N_{k}-(BN_k-C)##, where ##N_0=Num0##
In this way you can compute ##N(t)## by starting from ##t=0## and use the aforementioned relation. This is the so-called Euler method, see e.g. https://en.wikipedia.org/wiki/Euler_method
 
mfb said:
That is more complicated than finding the exact solution.
Yes, I completely agree with you.