Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: [Phys-L] Mathematica question; stiff differential equation

On 12/8/20 10:22 AM, Francois Primeau via Phys-l wrote:

The problem is that Mathematica knows mathematics but not physics.


As stated, your problem is ill posed because you start it off at a
point at which the derivative does not exist.


Perhaps there is a way in Mathematica to start off your problem at
y=100-epsilon for epsilon>0 and then take the limit as epsilon
approaches zero.
Yes, that's one possibility.


an easy way to avoid the fact that the derivative of the square root
function does not exist at zero is to convert your equation into the
system y’=v and v’=g.
That's even better.


FP's answer is correct and concise. Perhaps I can fill in a couple of
details. For starters, let's be clear: Do not confuse the statement:
y'' = -g for all time (which is true)

with the statement:
y'' = -g for all y (which is not true).

Beware: y simply does not exist for y>100.
Similarly: y is not twice differentiable for y>=100.

In more detail:
h = 100 - y # by fiat; new convenient variable
h' = -y' # by differentiating
h' = √(2 g h) for all h>=0 # from conservation
h'' = ½ √(2 g h)¯¹ ⋅ 2 g h' for all h>0 (not including h=0)
= g for all h>0

Mathematica knows mathematics but not physics

Mathematica has no reason to compute h'', and would be unable to compute
it even if it wanted to. So (h,h') = (0,0) is a fixed point.

This is a huge problem, because h'' is important to the physics, and is
presumably deeply built into your intuition. Alas it is not built into
this equation.

This corresponds to Zeno's paradox in reverse. It takes an infinite number
of steps to get away from the fixed point.

Here's another bit of jargon that may help: This is a /stiff/ differential
equation. Pretty much worst-case stiff.

Useful practical rule of thumb: Avoid(*) using differential equations that
bump up against the boundaries of the domain where the variables are defined.

(*) I was going to say "avoid like sin" or "avoid like the plague"
but we need to find better similes. It turns out people aren't very
good at avoiding those things.

convert your equation into the system y’=v and v’=g.

That would be my recommendation.
That is better math-wise as well as physics-wise.

Among other things, that sets you up to use a symplectic integrator, which
will probably outperform anything else rather spectacularly.