How to find the derivative of a function in a differential equation

78 Views Asked by At

$w(u)$ satisfies $$ w(u)=\frac{1}{u} \ \ \textrm{ for }1\leq u \leq 2, $$ $$ (uw(u))'=w(u-1) \ \ \textrm{ for }u>2. $$

I would like find numerical solutions for $w(u)'$. The derivative doesn't exist at 2 but does at all over values of $u\geq1$ I believe.

For $1 \leq u < 2$ we know $w(u)' = \frac{-1}{u^2}$.

How can I compute $w(u)'$ accurately for all other values?

1

There are 1 best solutions below

5
On BEST ANSWER

Let us change a bit the notation and consider the following delay-differential equation

$$\dot{w}(t)=\dfrac{1}{t}(-w(t)+w(t-1)),t>2$$

with the initial condition $w(s)=1/s$, $s\in[1,2]$. This equivalent to the problem stated in the question where I have applied the chain rule and reorganized the terms to obtain an explicit delay-differential equation.

Now, the OP is right in saying that there is a discontinuity at for the derivative at $t=2$ since $$\lim_{t\to 2^-}\dot{w}(t)=-1/4$$ while $$\lim_{t\to 2^+}\dot{w}(t)=1/4.$$

In fact, this is a well-known phenomenon in delay-differential equations.

To solve for $\dot{w}(t)$, we need first to solve for $w(t)$ and this can be done by the propagation method, where we solve successively the delay-differential equation over the intervals, $[k, k+1]$ for $k\in\mathbb{Z}_{>0}$. The procedure is as follows:

  • Start with the interval $[2,3]$ and solve the differential equation using any numerical method (i.e. Runge-Kutta) with "input" $w(t-1)$ equal to $1/(u-1)$. Let us call this portion $w_{2,3}$.
  • Then solve for $w_{2,4}$ using $w_{2,3}$ as initial condition, etc.
  • Numerically differentiate the solution to get the derivative.

It is also possible to obtain some analytical results. Over the interval $[k, k+1]$, the solution is expressed as

$$w(t)=\Psi(t,k)w(k)+\int_k^t\dfrac{1}{s}\Psi(t,s)w(s-1)ds,t\in[k,k+1]$$

where $$\Psi(t,s)=\exp\left(\int_s^{t}-\dfrac{1}{t}dt\right)=\dfrac{s}{t}.$$

This yields

$$w(t)=\dfrac{k}{t}w(k)+\dfrac{1}{t}\int_k^tw(s-1)ds,t\in[k,k+1].$$

Now, it is possible to numerically and successively integrate as

$$w(t)=\dfrac{2}{t}w(2)+\dfrac{1}{t}\log(t-1),\ t\in[2,3],$$

and this goes for all the next intervals. The issue here is that the integral may become more difficult to evaluate over time, but it can still be numerically evaluated.