flannelhead's comments

flannelhead | 8 years ago | on: How to draw oscilloscope lines with WebGL

Works really well even on my old-ish smartphone (2014). WebGL is really interesting, too bad I still have yet to find the time to get a grasp of it. But blog posts like this are very inspiring!

flannelhead | 8 years ago | on: Fedora 26 released

Congratulations Fedora!

Everyone is praising the GNOME (default) edition. Does anyone use the KDE spin? Also, how are Fedora version upgrades nowadays? I'm trying to decide between KDE neon and Fedora.

flannelhead | 10 years ago | on: Show HN: Rendering black holes with Haskell

At least there's a simple equation [0] for the deflection of light rays caused by a black hole. If your background is a UV map (for example), then it should be easy to compute the distortion effect. rantonels (whose raytracer was the source of inspiration for mine) has done a realtime version [1] -- I believe this should be close to what you're talking about.

[0] https://en.wikipedia.org/wiki/Gravitational_lens#Explanation... [1] http://spiro.fisica.unipd.it/~antonell/schwarzschild/

flannelhead | 10 years ago | on: Show HN: Rendering black holes with Haskell

That statement is indeed a bit vague. Let me elaborate:

In the process of deriving the said equations, an equation for the radial coordinate of the photon was achieved. This was identified with a classical, Newtonian system of one particle with unity mass. As the real, massless photon lives in four-dimensional spacetime and the said massive "test particle" lives in three-dimensional space, these systems just can't be dynamically the same (in spacetime, the massive particle would take a timelike curve).

To reword the statement, the derived "equation of motion" will yield the same trajectory in the spacelike components (x, y, z), but possibly with a different parametrization - in the classical system, we're integrating the equations of motion with respect to the time. However, this has nothing to do with the "coordinate time" of the four-vectors nor the proper time of the particle (for the photon, proper time doesn't even make sense).

Hope this helps! You could also see [0] for an alternative take on this derivation. I will try and clarify my article a bit as well.

[0] http://rantonels.github.io/starless/

flannelhead | 10 years ago | on: Show HN: Rendering black holes with Haskell

Hello HN!

I thought I would share this little writeup on a project I'm quite proud of. The code can be found on GitHub [0]. This article is mostly about the implementation of the simulation in Haskell. I've also written another article [1] on the physics of the simulation. It should be approachable even for those without any general relativity background.

[0] https://github.com/flannelhead/blackstar

[1] https://flannelhead.github.io/posts/2016-03-06-photons-and-b...

flannelhead | 10 years ago | on: Neovim public release 0.1.0

Are you using neomake by any chance? I might switch from syntastic as neomake seems to support the linters I need (mainly eslint and hlint).

flannelhead | 11 years ago | on: Learn Physics by Programming in Haskell [pdf]

I'm a physics sophomore, and I would be very glad to see more programming, especially FP, integrated to physics courses. During my studies, I've programmed some simulations related to the physics courses I've taken. My main purpose has been to gain a deeper, more practical insight on the subject which would've otherwise remained quite theoretical and distant.

For example, I made a little rollercoaster simulation to demonstrate the power of Lagrangian mechanics and generalized coordinates to myself. On the electrodynamics course I programmed a solver for Poisson's equation using the finite difference method to see a little more than the few simple geometries we calculated by hand. That kind of voluntary activities have greatly motivated me and helped me to understand various concepts.

On some courses we already have some simulation work and numerics in homework problems. Maybe deeper integration of programming into teaching requires time and, more importantly, a driving force and resources behind it. Then, of course, not everyone would be happy to see that kind of integration – I'm sure some would feel like they're forced to learn to program. And, as it has been seen on our entry level numerical physics course, learning programming, numerics and physics the same time is really quite hard.

Given those shortcomings, I still feel this is the way to go for future physics education. A gentle introduction and slowly teaching programming alongside physics would be the key, I think.

flannelhead | 11 years ago | on: Double Pendulum in fewer than 100 lines of JavaScript

First mass counting from which end? The masses are accelerated by each other as there are rigid rods between them.

The lack of friction and the perfectly rigid coupling between the joints might be what makes it seem lacking reality. If we'd extend the chain with more links, the motion of the outermost mass would become more and more unpredictable due to extreme acceleration.

Of course I might have made a mistake somewhere, but I checked that energy is conserved between the frames of the animation (excluding minor energy drift due to the numerical integration).

flannelhead | 11 years ago | on: Double Pendulum in fewer than 100 lines of JavaScript

Very nice simulation you've got there! I also did a triple pendulum in JS a while ago. Quite a lot more than 100 lines of code, though. The equations of motion alone take up lots and again lots of space. (Imagine typing them in! I don't even dare to think about adding a fourth degree of freedom) http://users.jyu.fi/~samakapa/triplependulum/

My dynamics course teacher actually showed that the double pendulum can be linearized by some approximations (throwing out some negligible terms, small angle approximations etc.), and that way two modes of oscillation could be found: antisymmetric and symmetric oscillation. Just try with small initial angles with OP's script and you'll see.

page 1