4

$\DeclareMathOperator\sgn{sgn}$Trying an finite duration Ansatz to solve $y''=-kg\,\sgn(y')-\gamma y'$, Does it formally solve the problem?

The original Ansatz of \eqref{Eq. 2} ended to be wrong as noted by @Nicolas' answer, so I keep the same question now for the Ansatz of \eqref{Eq. 11}.

Intro

I am trying to understand differential equations of finite duration by making simple examples, on previous questions here MSE 1 and here MSE 2 I think I have found some, but in the last one I found something weird from the physics interpretation of their results so I made a question here PSE, but maybe the problem is not the math but instead I missed some missing term so I move forward and included the air resistance.

Main section

Following this Wikipedia for friction under Coulomb damping | Illustration I should formulate Newton's 2nd law for a brick moving on an horizontal plane as (for positive constants $\{k,\ g,\ m\}$): $$my'' = -F-\sgn(y')kmg \label{Eq. 1}\tag{Eq. 1}$$ Considering $F=by'$ the air resistance as Stoke's drag and calling $\gamma = \frac{b}{m}$ by simplifying the mass I will get: $$y''=-kg\,\sgn(y')-\gamma y' \label{Eq. 2}\tag{Eq. 2}$$

By looking at something I now I tried to use the solution to: $y'' = \pm kg-\gamma y'$ which Wolfram-Alpha found to be $y(t) = c_2+c_1\dfrac{e^{-\gamma t}}{\gamma}\pm\dfrac{kg}{\gamma}t$, so making something similar to what I done on the previous questions I tried an Ansatz $y(t)= A+\sgn(y'_0)\theta(T-t)\left[Be^{-\gamma t}+Ct\right]$ and I tried to match the constants $\{A,\ B,\ C,\ T\}$ assuming it is posible to find a finite extinction time $T>0$ since I don't know beforehand if it is posible, and $\theta(t)$ is the Heaviside step function and $\text{sgn}(t)$ is the Signum function.

Question

After a lot of mistakes I found the following solution:

$$y(t)= y_0+\frac{\sgn(y'_0)}{\gamma}\left(|y'_0|+\frac{kg}{\gamma}\right)-\sgn(y'_0)\left[\frac{1}{\gamma}\left(|y'_0|+\frac{kg}{\gamma}\right)e^{-\gamma t}+\frac{kg}{\gamma}t\right]\cdot\theta\!\left(\frac{1}{\gamma}\ln\left(1+\frac{\gamma |y'_0|}{kg}\right)-t\right)-\sgn(y'_0)\frac{kg}{\gamma^2}\left(1+\ln\left(1+\frac{\gamma |y'_0|}{kg}\right)\right)\cdot\theta\!\left(t-\frac{1}{\gamma}\ln\left(1+\frac{\gamma |y'_0|}{kg}\right)\right) \label{Eq. 3}\tag{Eq. 3}$$

which I am looking to understand if it is indeed solving the equation formally. Here $y_0 := y(0)$ and $y'_0:=y'(0)$.

By calling the (supposedly) finite extinction time: $$T = \frac{1}{\gamma}\ln\left(1+\frac{\gamma |y'_0|}{kg}\right)\label{Eq. 4}\tag{Eq. 4}$$ and the constant term for the time variable: $$g(\require{cancel}\cancel{t}) = \sgn(y'_0)\frac{kg}{\gamma^2}\left(1+\ln\left(1+\frac{\gamma |y'_0|}{kg}\right)\right)\label{Eq. 5}\tag{Eq. 5}$$ I will have that \eqref{Eq. 3} takes a friendlier form: $$y(t)= y_0+\frac{\sgn(y'_0)}{\gamma}\left(|y'_0|+\frac{kg}{\gamma}\right)-\sgn(y'_0)\left[\frac{1}{\gamma}\left(|y'_0|+\frac{kg}{\gamma}\right)e^{-\gamma t}+\frac{kg}{\gamma}t\right]\cdot\theta\!\left(T-t\right)-g(\cancel{t})\cdot\theta\!\left(t-T\right) \label{Eq. 6}\tag{Eq. 6}$$

Here there is some issues that makes think maybe the solution is mistaken:

  1. I found first the solution without the term $g(\cancel{t})$, but after plotting the solution in Desmos I found the solution at time $t=T$ makes a huge jump, differently from the previous solutions I found on the mentioned questions, so maybe here I made a poor choose of some constants. I hope it could be improved since the term $g(\cancel{t})\cdot\theta\!\left(t-T\right)$ introduces a Dirac's Delta function on the derivative which shouldn't exists in principle, I mean, assuming $g(\cancel{t})\cdot\theta\!\left(t-T\right)\equiv 0$ do solves already the differential equation on $t\leq T$, and since the trivial zero functions also solves \eqref{Eq. 2} it should be possible to find a solutions keeps static after $T>t$ without having these discontinuities.
  2. I am not fully sure if I do found a solution of finite duration, or if instead, I just sliced a function at half way its trajectory. Assuming $g(\cancel{t})\cdot\theta\!\left(t-T\right)=0$ and looking at $t\to T^-$ what I did is taking $y'(t)$ such $\theta(T^- -t)=1$ but the argument of the function became zero such it stops moving, so I took $T$ by making $\left(|y'_0|+\frac{kg}{\gamma}\right)e^{-\gamma T}-\frac{kg}{\gamma}=0$.

If I didn't messed it up, the distance traveled before the brick stop moving by itself will be: $$\Delta y:=|y(T)-y(0)|=\left|\frac{|y'_0|}{\gamma}-\frac{kg}{\gamma^2}\ln\left(1+\frac{\gamma|y'_0|}{kg}\right)\right| \label{Eq. 7}\tag{Eq. 7}$$ Does it match with the classic ways of solving this problem? (would be a benchmark to see if the solution is right or not).

By the way, I left here the Desmos I used, at least in principle it looks the differential equation is fulfilled by positive and negative initial speeds.

Desmos of the solution founded


Added later

After the amazing answer by @Nicolas I realized the answer of equation \eqref{Eq. 3} could be improved as he says, but it still has the issue of the jump, but then I tried the following: let match a constant $M$ such as: $$y(t)=y_0+\sgn(y'_0)M-\sgn(y'_0)\left[\frac{1}{\gamma}\left(|y'_0|+\frac{kg}{\gamma}\right)\left(e^{-\gamma t}-1\right)+\frac{kg}{\gamma}t+M\right]\theta(T-t) \label{Eq. 8}\tag{Eq. 8}$$ still using $T$ as defined in \eqref{Eq. 4} and that $\left(|y'_0|+\frac{kg}{\gamma}\right) = \frac{kg}{\gamma}e^{\gamma T}$ (I kept them like this since were easier for me to follow the initial conditions), and noticing that at $t<T$ both $M$ terms cancel each other I could use them to tune the discontinuity by letting it to match: $$ y(T^+):= y_0+\sgn(y'_0)\left(y(T)-y_0\right) \label{Eq. 9}\tag{Eq. 9}$$

implying that: $$ M = \frac{|y'_0|}{\gamma}-\frac{kg}{\gamma^2}\ln\left(1+\frac{\gamma |y'_0|}{kg}\right)\label{Eq. 10}\tag{Eq. 10}$$

with this, keeping it as short as possible (as @Nicolas did) and using $T$ as defined in \eqref{Eq. 4} I can postulate the following solution to the diff. eqn. of \eqref{Eq. 2}:

$$y(t) = y_0+\sgn(y'_0)\left(\frac{|y'_0|}{\gamma}-\frac{kg}{\gamma^2}\ln\left(1+\frac{\gamma |y'_0|}{kg}\right)\right)-\sgn(y'_0)\left[\frac{kg}{\gamma^2}e^{\gamma T}\left(e^{-\gamma t}-1\right)+\frac{kg}{\gamma}t+\frac{|y'_0|}{\gamma}-\frac{kg}{\gamma^2}\ln\left(1+\frac{\gamma |y'_0|}{kg}\right)\right] \cdot \theta\!\left(T-t\right)\label{Eq. 11}\tag{Eq. 11}$$

which should, by construction, fulfill as solution to \eqref{Eq. 2} for whole time (it is still tied to the same issues of the solutions on the previous question), but at least the constant terms, jumps, and the introduced Dirac's delta function of \eqref{Eq. 3} should have been solved, at least, is what could be seen on Desmos 2 (even it show to work for some $\gamma <0$ but looks there exist some $\gamma_{\text{min}}(y'_0,k,g) < 0$ where it stops working).

Last update

After an interesting discussion with @Nicolas belowe his answer, I believe $y(t)$ as depicted by \eqref{Eq. 11} is do solving \eqref{Eq. 2}. Differently from the previous questions, here it is not posible to use the argument $x^n\delta(x)=0$ to avoid the rise of Dirac's Delta functions on the derivatives of $\theta(T-t)$, but here, as a happy accident, what is attached to the delta functions becomes zero at $t=T$ so they get canceled.

Also, as a free gift @Nicolas noticed that $z(t)=y'(t)$ solves the differential equation $z'=-kg\sgn(z)-\gamma z$, making another example of a finite duration differential equation.

Unfortunately I don't have anymore the time to transcript the demostration since I come back to work, but I left a picture of my notebook.

notebook demostration

Joako
  • 1,957

2 Answers2

2

Your solution looks very complicated. Here I propose something quite simpler. For the sake of definiteness, I will suppose that $\gamma,k,g>0$.

Let us set: $$z(t):=y'(t).$$ Then $($Eq. $2)$ becomes: $$z'(t)=-kg\,\mathrm{sign}(z(t))-\gamma z(t).$$ The troublesome term $\mathrm{sign}(z(t))$ is in fact nothing but the constant $\pm 1$ where $\pm z>0$. At that moment of the study, it is hard to determine the sign of a solution (if any exists), so let us try the following: We look for $z:\mathbb{R}\to\mathbb{R}$ satisfying the following system: \begin{align} \begin{cases} z'(t)=-kg-\gamma z(t)&\forall t\in\bigcup_{n\in\mathbb{N}}(t_{0,n}^+,t_{1,n}^+),\\ z'(t)=+kg-\gamma z(t)&\forall t\in\bigcup_{n\in\mathbb{N}}(t_{0,n}^-,t_{1,n}^-),\\ z(0)=v_0. \end{cases} \end{align} The existence of the interval $(t_{0,n}^\pm,t_{1,n}^\pm)$ of constant sign is a pure guess: We try to find a reasonable solution.

The standard theory of Ordinary Differential Equations applied on each interval $(t_{0,n}^\pm,t_{1,n}^\pm)$ implies that there exist $C_n^\pm\in\mathbb{R}$ such that: $$z(t)=C_n^\pm e^{-\gamma t}\mp\frac{kg}{\gamma}\qquad\forall t\in(t_{0,n}^\pm,t_{1,n}^\pm).$$ The fact that we must have $\pm z(t)>0$ on $(t_{0,n}^\pm,t_{1,n}^\pm)$ imposes a constraint on the constants $C_n^\pm$, namely: $$\begin{cases} C_n^+>\frac{kg}{\gamma}e^{\gamma t_{1,n}^+},\\ C_n^-<-\frac{kg}{\gamma}e^{\gamma t_{1,n}^-}. \end{cases}$$ Let $T_n^\pm>t_{1,n}^\pm$ and set $C_n^\pm:=\pm\frac{kg}{\gamma}e^{\gamma T}$ to eventually get: $$z(t)=\pm\frac{kg}{\gamma}(e^{\gamma(T_n^\pm-t)}-1)\qquad\forall t\in(t_{0,n}^\pm,t_{1,n}^\pm).$$

Now we use the initial conditions for $y$:

  • If $z(0)=v_0>0$ (initial speed is positive), then we choose $(t_{0,0}^+,t_{1,0}^+):=(-\infty,T)$ with $T=\frac{1}{\gamma}\ln\left(1+\frac{\gamma v_0}{kg}\right)>0$ so that: $$z(t)=\frac{kg}{\gamma}(e^{\gamma(T-t)}-1)>0\qquad\forall t\in(-\infty, T).$$
  • If $z(0)=v_0<0$ (initial speed is negative), then we choose $(t_{0,0}^-,t_{1,0}^-):=(-\infty,T)$ with $T=-\frac{1}{\gamma}\ln\left(1-\frac{\gamma|v_0|}{kg}\right)>0$ so that: $$z(t)=-\frac{kg}{\gamma}(e^{\gamma(T-t)}-1)<0\qquad\forall t\in(-\infty, T).$$
  • If $z(0)=v_0=0$ (null initial speed), then we choose $z(t)=0$ for all $t\in\mathbb{R}$ (that is, $(t_{0,n}^\pm,t_{1,n}^\pm)=\emptyset$).

Finally, back to the original function $y$ with $y(0)=y_0$, we must have (with our choices above): $$y(t)=y_0+\mathrm{sign}(v_0)\frac{kg}{\gamma^2}e^{\gamma T}(1-e^{-\gamma t})-\mathrm{sign}(v_0)\frac{kg}{\gamma}t\qquad\forall t\in(-\infty, T),\ T=\frac{\mathrm{sign}(v_0)}{\gamma}\ln\left(1+\mathrm{sign}(v_0)\frac{\gamma|v_0|}{kg}\right).$$

Now the research of a possible solution has been successfully carried out, we define $y$ as above. We can check that it is the unique solution (by standard theory of ODE) of the following Cauchy problem: \begin{align} \begin{cases} y''(t)&=-kg\,\mathrm{sign}(y'(t))-\gamma y'(t)\qquad\forall t\in\left(-\infty,\frac{\mathrm{sign}(v_0)}{\gamma}\ln\left(1+\mathrm{sign}(v_0)\frac{\gamma|v_0|}{kg}\right)\right),\\ y(0)&=y_0,\\ y'(0)&=v_0. \end{cases} \end{align} The standard theory of ODE applies there as $\mathrm{sign}(y'(t))=\mathrm{sign}(v_0)$ by construction. This choice allowed us to easily solve the equation until an extinction time $T>0$ at which the speed $y'$ cancels for the first time.

What happens for $t>T$ can not be uniquely determined by mathematical arguments, but is physically irrelevant as nothing can happen once the mass stopped without any additional force in the equation.

Nicolas
  • 3,949
  • Thanks for the interesting answer. I tried your solution on Desmos and I still see the jump after $t>T$, It is unavoidable without a term $\propto \theta(t-T)$? – Joako Apr 19 '25 at 15:08
  • @Joako Mutiplying by the term $\theta(T-t)$ is exactly choosing the only continuous solution on $\mathbb{R}$. If you want to have $y'(t)\neq0$ for $t>T$ then you have to accept that the derivative $y'$ is discontinuous indeed. Not really physical... – Nicolas Apr 19 '25 at 15:12
  • using your answer I was able to do produce a solution that don't show any jumps, I hope you could review it too. – Joako Apr 19 '25 at 16:26
  • @Joako Well I am not sure if what you proposed works, but what is sure is that you can set $w(t):=(y(t)-y(T))\theta(T-t)+y(T)$. As the equation does only depend on $y'$ and $y''$, adding the constants $\pm y(T)$ does not change anything ($w$ is still a solution such that $w(0)=y(0)$ and $w'(0)=y'(0)$) but at the extinction time $T$, where we get a Dirac term in the derivative; However, you can indeed choose the constant so that the Dirac term $(y(t)-y(T))\delta(T-t)$ vanishes, very clever! On the other hand, note that $w''(T)$ is not defined and $w$ does not solve the equation at $t=T$. – Nicolas Apr 19 '25 at 17:01
  • I don't get what you said about $w''$ since it should match $y''$, that is why I think it do solve the differential equation since by inspection it should be zero for $t\geq T$ (this is exactly why I am asking on the previous question for a slightly different eqn. but if that is fine this one will follow as well) – Joako Apr 19 '25 at 17:14
  • 1
    @Joako Both $w''$ and $y''$ does match OUTSIDE ${t=T}$. The term $\theta(T-t)$ adds a Dirac term that can be removed from $w'$ by a clever choice of constants, but not from $w''$. – Nicolas Apr 19 '25 at 17:17
  • mmm you are right... I still thinking I am cancelling $x^n\delta(x)=0$ as in the previous question, obviously here it would not work since the section attached to the $\theta$ function is always non-negative., I don't think I could avoid it: Shouldn't it work that $y(T)$ is already zero, so $y'(T)=y''(T)=0$ so the differential eqn. is trivially fulfilled there as $0 = -kg\text{sgn}(0)-\gamma 0 = 0$? – Joako Apr 19 '25 at 17:32
  • @Joako If $y(t)=0$ on $(T-\delta,T)$ for any small $\delta>0$ then the standard theory of ODE shows that $y=0$ everywhere on $(-\infty,T)$, so there is no way to cancel $y'$ and $y''$ unless maybe for a very special choice of $y(0)$ and $y'(0)$. But is that physically relevant? I mean, we shall allow any initial condition, right? – Nicolas Apr 19 '25 at 17:36
  • I don't get why $y(t\to T^-)=0$ should imply that $y(t)=0,\ \forall t$, that implies that a body at the origin of the coordinate system cannot stop moving if I introduce an initial speed $|y'_0|>0$ which is not true... neither I got were are going with that tbh. Are you sure that argument is valid for Non-Lipschitz ODEs? here uniqueness is not granted – Joako Apr 19 '25 at 17:44
  • 1
    @Joako The ODE is Lipschitz before the first singularity (where $y'$ sign changes), so you can apply the aforementioned result. If you only have $y(t)\to0$ when $t\to T^-$, then you can not guarantee that $y'(t),y''(t)\to0$ as well. – Nicolas Apr 19 '25 at 17:54
  • At least in the scenario of the solution of $\text{Eq. 11}$, what is attached to $\theta(T-t)$ looks like becomes exactly zero at $t=T$ (at least in Desmos), so I think in this case it will cancel the Dirac's delta function $0\cdot\delta(T-t)|_{t=T}=0$ – Joako Apr 19 '25 at 19:19
  • What I meant, if you look the 2nd derivative of $y(t)$ as in $\text{Eq.11}$ in Wolfram-Alpha, the arguments that are attached to both terms with Dirac's Deltas functions ($\delta(T-t)$ and $\delta'(T-t)$), become zero at $t=T$ like a happy accident. $y''(T)\neq 0$ as it matches the differential equation (there is a jump, but happen at both sides of the ODE) – Joako Apr 20 '25 at 04:27
  • @Joako The term in front of $\delta'(T-t)$ in the Wolfram Alpha link does not vanish at $t=T$, doesn't it? – Nicolas Apr 20 '25 at 06:55
  • I believe it does. The term attached to $\delta'$ becomes $(-\Delta y+\Delta y)=0$ at $t=T$ by construction (so $y(T)=y_0+\Delta y$), and the term next to $\delta$ also becomes zero $\left(e^{\gamma(T-t)}-1\right)|_{t=T}=0$ – Joako Apr 20 '25 at 13:11
  • I uploaded a demonstration now. – Joako Apr 20 '25 at 18:40
-1

I’m sorry if this is not what you want, but to me your solution looks incredibly complicated. So here I will show how I would approach the ode. The step here are formal, meaning that they make sense “in some” region, most notably, if I’m right, then the solution may never get to 0, or have trouble with initial value y’(0)=0. First we get rid of the second derivative by a change of variable, y’ replace with y. We get: $$y'=-g sng(y)-γy$$ Now we get rid of the sng function, we multiply by $sng(y)$. And $|y|$ is just the absolute value $$sng(y) y'=-g-γ|y|$$ In addition, notice that I have denoted $kg$ dy $g$, this is just a notation, nothing more. Now we multiply and divid by $y$ on the left hand term. $$(sng(y) y' y)/y=-g-γ|y|⇒(y'y)/|y| =-g-γ|y|⇒y'y=-g|y|-γ|y|^2$$ Now we use the fact that: $y' y=1/2 (y^2)'$ And set $|y|^2=y^2=v$ to get a Bernoulli ODE $$1/2 v'=-g\sqrt v-γv$$ And this is easy to solve, so consider you know v to get your function just set: $$y=c+∫ \sqrt v dt$$