News for hackers. Stuff that matters.
Re:Accelerate Python code by importing Taichi by jesuslop on Thursday September 08, 2022 @01:23PM (#32768682)
I now get that Reaction-Diffusion business.

1) "Diffussion" is species vs time equals species spatial laplacian.

2) The "reaction" equations are non-painfully derived from Baez stochastic Petri nets/chemical reaction networks in [1] (species vs time = multivariate polynomial in species, "space dependant rate equation")

So Reaction-Diffusion is just adding up. Species vs time = species spatial laplacian plus multivariate polynomial in species. One more for the toolbox!

[1] https://arxiv.org/abs/1209.3632

Re:Accelerate Python code by importing Taichi by 127 on Thursday September 08, 2022 @11:05PM (#32774824)
It's just alternating between sharpen and smoothen. Sharpen hallucinates new information. Smoothen diffuses and erases information. Thus there is this interplay with constant hallucinations that take place over previous ones.

Mathematicians and biologists have a hammer, so everything looks like a nail.

Re:Accelerate Python code by importing Taichi by astroalex on Thursday September 08, 2022 @07:01PM (#32773212)
I'm interested in understanding this comment but I don't know where to start. I love the way Reaction Diffusion simulations look and I've coded it up a few times. But I don't understand what you mean by "species vs time". (Some of the other technical language seems more Google-able, but "species vs time" isn't turning up anything obvious.)
Re:Accelerate Python code by importing Taichi by soVeryTired on Thursday September 08, 2022 @07:18PM (#32773351)
I think GP is referring to the heat equation. "species" is the concentration of the "stuff" that you're describing mathematically. Call that u(x), where is a spatial coordinate and u is a real valued function.

Then the diffusive part says

du(x, t)/dt = \nabla_x u(x, t).

The \nabla term is the laplacian: a multivariate form of the second derivative.

The equation says that a short time from now, u(x, t) will change in proportion to the average value of u, calculated over a small ball surrounding the point x, minus the value of u at the point x itself.

If there's less "stuff" in the points that neighbour x than at x itself, the function will decrease over time. Similarly if there's more stuff at the neighbours of x, u(x, t) will increase. This is the basis of diffusive behaviour.

(Edit: I think the equation in the article is wrong, unless I've misunderstood something: they have a delta (first derivative) when they should have a nabla (laplacian))

Re:Accelerate Python code by importing Taichi by xkevio on Thursday September 08, 2022 @08:15PM (#32773788)
I think you might have gotten your symbols mixed up a litte.

From what I understand, just \nabla(f) describes the gradient of a function f -- meaning all the first order partial derivatives (of a certain point) in a vector.

\nabla * f describes the divergence of the function f -- meaning a scalar field of the quantity of the vector field's sources at each point.

\nabla * \nabla(f), divergence of gradient, then describes the Laplace operator. Also written as \nabla^2(f) or \Delta(f) -- note that it's an uppercase delta.

Re:Accelerate Python code by importing Taichi by soVeryTired on Friday September 09, 2022 @05:37AM (#32777253)
You’re absolutely right - how embarrassing! It’s been a few years since I’ve touched this stuff.
Re:Accelerate Python code by importing Taichi by jesuslop on Friday September 09, 2022 @08:26AM (#32778282)
Glitch apart, thanks for expanding, that was what I meant.
Re:Accelerate Python code by importing Taichi by qorrect on Friday September 09, 2022 @09:26AM (#32778928)
How can I get these \nabla s to render, is there a plugin or something ?
Re:Accelerate Python code by importing Taichi by xkevio on Friday September 09, 2022 @06:31PM (#32785683)
HN doesn't support LaTeX in comments sadly, so I am just writing it out as you would before rendering it with LaTeX.

Maybe there are add-ons that detect valid LaTeX math symbols and convert them whenever possible but as-is you can't get it to render within the comments.

Re:Accelerate Python code by importing Taichi by soVeryTired on Friday September 09, 2022 @07:31PM (#32786122)
Yeah, it’s a brain-render unfortunately. Once you’ve written enough latex you work pretty comfortably with just the text for communication.