# Fun Animations

**URL:** https://discourse.julialang.org/t/fun-animations/45542
**Category:** Visualization
**Created:** [August 26, 2020, 1:30am UTC](https://discourse.julialang.org/t/fun-animations/45542 "2020-08-26T01:30:58Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)
#### Post date: [August 26, 2020, 1:30am UTC](https://discourse.julialang.org/t/fun-animations/45542/1 "2020-08-26T01:30:58Z")

</div>

Figured I’d try out another weird thread idea. The idea is: if you have a fun animation share it below. Discussions about animations welcome, but being a jerk is not. Doesn’t need to be cream of the crop highly polished, the epitome of scientific visualizations, just if you did something fun, share it.

Here’s a goofy 2-D simulation of a water hose. Each circle represents a ‘packet’ of liquid. Physics involved are not real-world, fun only.  
 ![firehose](https://global.discourse-cdn.com/julialang/original/3X/1/2/120161040c007997537ac906ab6c8794570f5666.gif)

---

<div class="post-metadata">

### Author: ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)
#### Post date: [September 6, 2020, 2:06pm UTC](https://discourse.julialang.org/t/fun-animations/45542/2 "2020-09-06T14:06:49Z")

</div>

What happens if we put a wing-like shape (foil) into the stream of cartoon viscous liquid packets?

[https://i.postimg.cc/QdsszSP9/anim-opt2.gif(image larger than 4 MB)](https://i.postimg.cc/QdsszSP9/anim-opt2.gif)

You can get something like “drag” and “lift” forces. Think I’m done with this project for now but it was a lot of fun.

---

<div class="post-metadata">

### Author: ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)
#### Post date: [September 6, 2020, 2:20pm UTC](https://discourse.julialang.org/t/fun-animations/45542/3 "2020-09-06T14:20:31Z")

</div>

Uh-oh can we not share remotely hosted images that exceed 4096kb or have I goofed something up?

---

<div class="post-metadata">

### Author: ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)
#### Post date: [September 6, 2020, 2:38pm UTC](https://discourse.julialang.org/t/fun-animations/45542/4 "2020-09-06T14:38:29Z")

</div>

I can see the remote image.

What I don’t see is the Julia code!

---

<div class="post-metadata">

### Author: ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)
#### Post date: [September 6, 2020, 2:55pm UTC](https://discourse.julialang.org/t/fun-animations/45542/5 "2020-09-06T14:55:08Z")

</div>

Glad to hear you can see it. 🙂

I’d post the code, but it’s a little sloppy, and cleaning it up wouldn’t provide a good RoI right now. I’m looking for work, and this project won’t help me land a job even if it was cleaned up and made SOTA. It’s very undergrad even if taken a few steps further (IE: calibrated not `toon physics, ML for performance, optimizing the shape/angle for lift, etc). Think nowadays that kind of stuff is like 2nd-year undergrad pet project level? So I have to focus on some other more impactful projects, probably something in python involving very different subject matter… Eventually, I’ll clean some of it up and cut a package but someone else will likely beat me to it by then :).

---

<div class="post-metadata">

### Author: ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)
#### Post date: [September 6, 2020, 2:57pm UTC](https://discourse.julialang.org/t/fun-animations/45542/6 "2020-09-06T14:57:50Z")

</div>

I personally would prefer to see sloppy Julia code than no Julia code in a Julia forum.

---

<div class="post-metadata">

### Author: ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)
#### Post date: [September 6, 2020, 3:23pm UTC](https://discourse.julialang.org/t/fun-animations/45542/7 "2020-09-06T15:23:47Z")

</div>

It is likely that later I’ll share some of it. But, I used only `Plots, CSV, DataFrames, SparseArrays`. Didn’t use QuadTrees.jl, any of the geometry packages, etc because it was easier not too. So that might upset a lot of people… Basically all this is, is:

- Basic SPH simulator(leapfrog integrator, pressure, viscosity, gravity turned off)
- Nonadaptive Quadtree (simple ID buckets in a dict, particles fall into buckets by modulo operator on dimensions)
- NN Search based on SPH interaction parameter and quad tree cell size
- Airfoil parametric Eqn (from literature + affine rotation)
- Kindergarten collision detection (point in box, segment-segment intersections, the nearest point on line segment, reflection from a line, etc)
- Boundary conditions S.T. if a particle leaves the bounds it can be recycled
- Force on foil has 2 modes (negative depth of crossing line segment before reflection, and SPH pressure attributed to the nearest point on foil for each particle)

Stuff anyone on here could do in a few days tops. Took me 5-7 afternoons… I’m not proud of it, just think it looks kind of cool, and wanted to share it. Not “Makie cool” but my GPU is offline right now and can’t pump money into an E-GPU right now. If it ended up on my Github an employer might think this is like a “crowning achievement” or something (struggling with this now). The caveat is that I can’t make a pseudonym GitHub/discourse, or my current employer can terminate me for violating social media rules. So animations seemed apt for sharing. Again I can share the code later but for now I need to prioritize I guess…

---

<div class="post-metadata">

### Author: ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)
#### Post date: [September 6, 2020, 6:49pm UTC](https://discourse.julialang.org/t/fun-animations/45542/8 "2020-09-06T18:49:57Z")

</div>

That sounds like a cool combination of different packages that people would be interested in.

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [November 24, 2020, 2:34pm UTC](https://discourse.julialang.org/t/fun-animations/45542/9 "2020-11-24T14:34:20Z")

</div>

> [@Seven Lines of Julia (examples sought)](https://discourse.julialang.org/t/seven-lines-of-julia-examples-sought/50416/42):
>
> With 15 lines I could write a code to perform a particle simulation with periodic boundary conditions, a langevin thermostat, and a quadratic potential between the particles, and produce an animation: using Plots ; ENV["GKSwstype"]="nul" const N, τ, Δt, λ, T, k = 100, 1000, 0.01, 1e-3, 0.26, 1e-6 const x, v, f = -0.5 .+ rand(3,N), -0.01 .+ 0.02\*randn(3,N), zeros(3,N) wrap(x,y) = (x-y) \> 0.5 ? (x-y)-1 : ( (x-y) \< -0.5 ? (x-y)+1 : (x-y) ) anim = @animate for t in 1:τ f .= 0 for i in 1:N-1, j…
