This project is based on a project by Brian Winkel. https://www.simiode.org/resources/625
$a(t)=$ number of iPhones "needed" at time $t$ ($t=0$ is the date of the first iPhone)
$f(t)=$ the fraction of iPhones that were operating at $t=t_*$ that are still operating at time $t=t_*+t$
$r(t)=$ the number of replacement iPhones on the interval $[0,t]$ so that there are always $a(t)$ iPhones in servise
Goal: Given the function $a(t)$, find the replacement plan function $r(t)$
Some assumptions:
Thinking about the problem:
Notice $r(t)$ is the total number of replacement phones on the interval $[0,t]$.
Approximate the number of phones replaced during a subinterval: $[t_k, t_{k+1}]$ where $0 \leq t_k \leq t_{k+1} < t$.
Picture $t_{k+1}-t_k$ being not too big.
number of phones replaced on the subinterval $[t_k, t_{k+1}]$ is about $$r^\prime(t_{k+1})\cdot (t_{k+1}-t_k)$$
Now, "fix" a time $t$. How many phones in service at $t=0$ are still in service at time $t$?
$a(0)\cdot f(t)$
Subdivide the interval $[0,t]$:
$$0 < \tau_1 < \tau_2 < \tau_3 \dots <\tau_{n-1} < \tau_n=t$$(the reason we use $\tau$ instead of $t$ will become clear later)
Harder:
How many phones introduced during the interval $(0, \tau_1)$ are still in service at time $t$?
this will be an approximation
How many phones introduced during $(\tau_1, \tau_2)$ are still in service at time $t$?
Write down the number of phones in service at time $t$ as a function of $f(t)$ and $r(t)$.
We want this expression to equal $a(t)$:
$$a(t)=a(0)f(t)+\sum_{k=1}^{n-1}f(t-\tau_k)\cdot r^\prime(\tau_k)\Delta \tau$$Let $$\Delta \tau \rightarrow 0$$
We want to solve for $r(t)$.
Strategy:
New problem: finding the Laplace transform of the integral term.
We'll solve it in a more general setting. Find the Laplace transform of $$\int_0^t f(t-\tau)g(\tau)d\tau$$ for any functions $f$ and $g$.
We'll write this as:
$$\mathscr{L}(f \star g)=F\cdot G.$$has Laplace transform:
$$A(s)=a(0)F(s)+F(s)\cdot \mathscr{L}(r^\prime(t))$$$$A(s)=a(0)F(s)+F(s)\cdot(-r(0)+sR(s))$$assume $r(0)=0$ and solve for $R(s)$:
$$R(s)=\frac{A(s)-a(0)F(s)}{sF(s)}$$Before we continue with the iPhone example, let's see how this new tool provides an alternative way to analyze circuits if we have a transfer function. From the circuit in exercise one we have $$i(t)=\frac{v_c}{R}+C\frac{dv_c}{dt}.$$ The Laplace transform is then $$I=\frac{1}{R}V+sCV$$ or $$V=\frac{1}{\frac{1}{R}+sC}I.$$ So the transfer function is $$T(s)=\frac{1}{\frac{1}{R}+sC}$$ which we'll write in a form that makes it easy to see what the inverse transfrom is: $$T=\frac{1}{C}\cdot \frac{1}{s+\frac{1}{RC}}.$$ We have, in the $s$-domain: $$V=T\cdot I$$ and from the above discusion:
$$v_c(t)=\mathscr{L}^{-1}(T) \star i(t).$$The important thing to notice is that the inverse transform of the transfer function, $T(s)$ is easy to find and we avoid the need to find the transform of $i(t)$ or (more critically) the inverse transform of $T\cdot I$ which could be difficult.
Below is the matlab implementation of this convolution approach.
syms s omega R C T(s) V_c(s) I(s) alpha(t) t i(t) tau
T(s)=(1/C)*(1/(1/(C*R)+s))
alpha(t)=ilaplace(T(s), s, t)
i(t)=exp(-t)*cos(omega*t)
v_c(t)=int(i(tau)*alpha(t-tau), tau, 0, t)
%i(tau)*alpha(t-tau)
v_cplot=subs(v_c(t),[R,C,omega],[200,1/100, 25])
fplot(v_cplot)
xlim([0 10])
ylim([-1 1])
Below is the approach without the convolution technique. Matlab is able to do both, but compare the expressions for solnplot below to v_cplot above. The graphs indicate they are the same but the one below involves imaginary numbers. So, it's always nice to have more than one way to solve a problem.
I(s)=laplace(i(t),t,s)
V_c(s)=T(s)*I(s)
soln(t)=ilaplace(V_c(s),s,t)
solnplot=subs(soln(t),[R,C,omega],[200,1/100, 25])
fplot(solnplot)
xlim([0 10])
ylim([-1 1])
Homework:
Trench section 8.6:
1b) d) f)
3b) d) f)
4b) d) f)