The unreasonable effectiveness of mathematics
blog.rongarret.info
blog.rongarret.info
For example, I once made a wave animation just like the one in this post (in 2D but otherwise the same), thusly:
1. Make an array of height values initialized to zero
2. Run a tick() function that applies a spring force between neighboring values, then updates their position/velocity
3. Perturb the middle value by a large amount
Not exactly real fluid mechanics but convincing enough. Perhaps best of all, fine-tuning is easy because the model matches your intuition - if you want the fluid to look more viscous you don't need to guess what to tweak, you just dampen the velocities, etc.
I remember trying to code a basic platformer at a young age in BASIC or something similar. Moving around the character and jumping are the most basic, essential functions.
I tried to reason it out. Ok, so start off slow, after the character has been moving for a bit speed him up. For jumping, add some positive velocity and reverse it after a bit.
It took forever to fine tune and still didn't really work that well. I gave up in the end. We didn't have the Internet then and I didn't really think about asking the librarian or similar 'how can i make a character jump about'.
Fast forward a few years and my schoolteacher introduced the concept of Newtonian mechanics. Acceleration as a rate of change of velocity; the idea of a ballistic trajectory as a quadratic.
Suddenly the problem becomes trivial! That eureka moment I can probably point to as the defining thing that made me choose to study higher level physics.
(Part of it was probably being young and not having the reasoning skills I do now - but I also often think about how access to information is so different now. What would the ten year old me have done with access to Wikipedia? Mind boggling.)
With that said, you've reminded me of an example of this. Years ago I was making a "UFO catcher" crane game in Flash, where the user moves a thingy left and right, and an attached crane arm swings freely like a pendulum. At first I thought: this isn't a damned physics simulation, I'll just hack something up. Then I spent probably a whole day trying to get it to not feel so wrong. Then finally I break down and get the formula for pendulum motion off wikipedia, and 15 minutes later it works perfectly - with maybe three lines of physics code. :D
Wave phenomena are a curious intersection of functional and imperative paradigms in real life. Of course the real atoms find their positions by stateful interactions over time, but the behavior should approach the pure mathematical definition of the wave functions.
Sure, except there isn't any known closed-form expression that can model water waves in cases like the author is aiming for. (In the steady state water waves are roughly trochoidal, not sinusoidal, if you're interested.)
What happened in this article was that the author started with a mental image of what a water drop looks like, then hammered on a sin function until there was a resemblance. That's fine in and of itself, but he might as well have drawn a picture! Whatever resemblance he did or didn't achieve to actual water was a function of how good his mental image was and how long he spent working on the similarity, not a byproduct of the math involved.
What's nice about my awful stateful approach is that the physicality arises unbidden. If you code it up it will behave like water all on its own - you won't have to randomly fiddle with it like the article's author.
Also, with my version you don't have to start out knowing what water waves look like. It will show you. ;)
One approach to avoiding the whole question of abs(x) would be to use cosine instead of sine, since cosine is symmetric across x = 0.
I don't think that this would work, since the division by an odd function would just make it odd again (that is, `sin(x)/x` is even precisely because `sin` is odd). Note, however, that blaming `abs` for discontinuity (or non-differentiability) is a bit of a red herring; any even function on the real line, no matter how smooth, can be written as a composition with `abs`.
My point was simply that the "spike" the article goes on about (which I earlier called a discontinuity, oops) shows up because the author is reflecting his plot around the Y axis. The article makes it sound like the spike was some physically significant feature of the function being graphed.
My point was more that there's nothing inherently 'spiky' about even functions; as your own example of cosine shows, they can be just as smooth (or spiky) as any other function.
I think that you mean they are graphs of x ↦ f(abs(x)), not just f; and that this causes a point of non-differentiability, not necessarily a discontinuity. Of course, the even extension x ↦ f(abs(x)) of any continuous function `f` on the non-negative real numbers is again continuous (because `abs` is).
In particular, the statement "because of inertia and the fact that water is not compresible, it has to keep moving" is false.
The fact that water is not compressible means that the water moving in one direction is capable of exerting an extremely large force on the water moving in the other direction when they run into each other, which would bring the water to a halt as the hole closes. The interesting question is: why doesn't this happen?
One possibility is that the free surface at the bottom of the hole travels upward due to what amounts to a buoyancy force (think of the hole as a bubble with no top). The water pressure at the bottom of the hole is the same as it is everywhere at that depth, and so the bottom move upwards, and this pressure force creates upward momentum that is not met by any opposing force when the bottom of the hole reaches the water's surface, and therefore creates an upward-moving column of water.
One way of testing this would be by inserting an empty pipe into the water against a flat disk of the same diameter, and then rapidly pulling the pipe out. The flat disk would impede water from moving upward into the hole, which would--on my account--dramatically reduce the size of the spike.
As to the "unreasonable effectiveness of mathematics", the argument is bogus: http://www.tjradcliffe.com/?p=381 Our mathematical descriptions of reality almost all admit of extraneous solutions that have to be discarded based on physical--not mathematical--considerations. This is what you would expect if mathematics was a human-made tool for describing reality. It is not at all what you would expect if mathematics was somehow the pre-existing armature upon which physical reality was constructed.
Maybe we (humans) have tendencies to put math into the role we often evict mainstream religion from.
You make a good point, that mathematics is often designed and invented to describe reality. You need to take into account the fact that a lot of what you "get out" of mathematics has already been "put in". But it is my opinion that even accounting for this, it is quite frequent that you "get out" more than you "put in" to mathematics.
I think a strong set of examples of this sort of behavior is when attempts to address one problem in a mathematical theory often end up addressing other seemingly unrelated problem. The introduction of quantized energy states to explain the blackbody radiation distribution then goes on to explain the photoelectric effect. (I'm not too familiar with what physical phenomena were observed before QM but needed QM to explain them to give more examples).
Now you might say "well of course this theory solves both issues, because they are essentially the same phenomenon, and so there's nothing surprising about your theory explaining what it was designed to explain". But that's precisely the point, that mathematics gives us the tools to see relations between things that on the face of them are different. And that there's no reason that this /has/ to be true (without appealing to mathematics), makes the fact that it is true seem surprising.
Of course, being surprising, or unreasonably effective, etc is a relative statement. Certainly to someone who expected the universe to be described mathematically to precisely the degree that it is in reality, nothing would be surprising. But I think to most people who haven't been introduced to mathematics (kids), the power it gives you certainly is surprising.
The fact that water is not compressible means that the water moving in one direction is capable of exerting an extremely large force on the water moving in the other direction when they run into each other, which would bring the water to a halt as the hole closes. The interesting question is: why doesn't this happen?
Why would you expect that to happen? The hole in the water is an area of low pressure that the water is going to rush in to fill. Now that water has a lot of kinetic energy and momentum. Why would it suddenly lose that momentum? And how does water's incompressible nature help that? Surely, if anything, this contributes to the difference in resistance between the water and the air and help explain the spike that you initially see.In its present form, it is more like modeling how an infinitely long cylinder is hitting the surface of the water.
Anyway, the function's being described isn't really the way water waves actually work, is it? Surely, dropping a stone in water does not start out disturbing every portion of the water immediately like "sin(x)/x", but rather, the disturbance only emanates out over time from the origin, with at any moment only so much water disturbed. (Then again, I'm not a physicist, so what do I know?)
I've never heard that before! Is there any place that I can read about it?
That's exactly right. In fact, that is one of the interesting features of math: you can often get the right answer even when the math is completely unjustified! This actually happens more than you might think. Quantum mechanics was essentially discovered this way. Even the classical mechanics literature is chock-full of wrong math that happens to give the right answer. See:
http://mitpress.mit.edu/sites/default/files/titles/content/s...
As a mild nitpick, I would say that this is a feature of mathematical physics. A mathematician on his or her own would not be satisfied with getting the 'right' answer by wrong methods—in fact, would have no way to judge what is 'right' except by appealing to right methods (there being no outside arbiter who can decide the matter independently, as is the universe itself in mathematical physics).
No relation at all. They just look similar insofar as all smooth wave functions look sort of similar at small enough amplitudes.
But yeah, the sinusoidal equation doesn't show the initial perturbation, since it's not modeling a perturbation at all.