noneuclideandreamer, German
@noneuclideandreamer@mathstodon.xyz avatar

So I'm trying to solve the heat equation numerically. (Here with 2 sources)
But why doesn't it spread in a circle?

I basically do

f(x,y,t+1) = f(x,y,t)+c(f(x+1,y,t)+f(x-1,y,t)-2f(x,y,t))
+c(f(x,y+1,t)+f(x,y-1,t)-2f(x,y,t))

which is the numerical heat equation, right? Do I just need to finetune the c? Or maybe it's not actually a problem and my coloring takes small changes too seriously, after a while it looks nice...
(I already fixed the central horizontal distortion?)

video/mp4

noneuclideandreamer,
@noneuclideandreamer@mathstodon.xyz avatar

Ahh, thanks for all your great suggestions! I was actually just nostalically retooting what I was up to a year ago. 😅

4raylee,
@4raylee@mathstodon.xyz avatar

@noneuclideandreamer ah, oops. Now I have to reset the sign: “[0] days since I’ve given unsolicited advice“

BTW thanks for adding a bit of art into my day!

noneuclideandreamer,
@noneuclideandreamer@mathstodon.xyz avatar

@4raylee 🤗

tslumley,
@tslumley@fediscience.org avatar

@noneuclideandreamer is it that it's the heat equation for a space where (1,1) is two units from (0,0) rather than sqrt(2) units?

noneuclideandreamer,
@noneuclideandreamer@mathstodon.xyz avatar

@tslumley nope I used L2-metric.

davidphys1,

@noneuclideandreamer Do you have the stability conditions satisfied? von Neumann stability analysis says you need (c\leq\frac{1}{4}). In normal units this is (\Delta t\leq \frac{\Delta x^2}{4\mu}) with \mu being the diffusion coefficient. If that is satisfied then it should work!

darkling,
@darkling@mstdn.social avatar

@noneuclideandreamer It's the +/-1 in the f(x+1,y,t) terms that makes it diamond-shaped -- you're running on Manhattan distance. I'm not sure how to fix that behaviour in a CA-like model (where state is quantised to a grid and effects between cells are purely local to the neighbours).

noneuclideandreamer,
@noneuclideandreamer@mathstodon.xyz avatar

@darkling yeah but that is exactly what the heat equation wants.

d^2 f/dx^2+ d^2f/dy^2=df/dt

4raylee, (edited )
@4raylee@mathstodon.xyz avatar

@noneuclideandreamer not exactly. Compare with the Laplacian in polar coordinates. Or written in a more coordinate-free way as the divergence of the gradient. Mathematically the same, but a way different naive conversion to code. You left out influences from the diagonal neighbors so of course you get a diamond pattern.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • physics
  • kavyap
  • thenastyranch
  • GTA5RPClips
  • tester
  • InstantRegret
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • everett
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • cisconetworking
  • JUstTest
  • khanakhh
  • normalnudes
  • osvaldo12
  • tacticalgear
  • anitta
  • Durango
  • ethstaker
  • modclub
  • Leos
  • provamag3
  • cubers
  • megavids
  • lostlight
  • All magazines