Community RSS Feed https://community.wolfram.com RSS Feed for Wolfram Community showing any discussions in tag Physics sorted by active [GIF] Gravity wave visualization https://community.wolfram.com/groups/-/m/t/790989 ![enter image description here] With all of the rumors and excitement about the gravity wave press release tomorrow, I was reminded of this code I&#039;ve had lying around for years for creating a gravity wave visualization (seen above) for illustrative purposes. You can find also a [video here]. It was inspired by an interaction I had years ago (unfortunately I can&#039;t find the interaction in my email) with someone on the [LISA] project wanting to use Mathematica to re-create a visualization they had. This code was the result of that interaction. First, the primary goal was to generate a &#034;space-time&#034; surface and mesh that had a double-armed spiral wave on it. The following code generates that. Its dependent on a rotation angle Theta which is not specified here: Plot3D[(60 Cos[ 2 ArcTan[y/(x + 0.00001)] - \[Theta] + 0.544331 Sqrt[x^2 + y^2]])/( 20 + Sqrt[x^2 + y^2]), {x, -45, 45}, {y, -45, 45}, PlotPoints -&gt; 100, Mesh -&gt; 20, MeshStyle -&gt; {RGBColor[.5, .5, .5, .5]}, Boxed -&gt; False, BoxRatios -&gt; Automatic, Axes -&gt; False, PlotStyle -&gt; {RGBColor[.3, .3, .8]}, ImageSize -&gt; {1024, 768}, Lighting -&gt; {{&#034;Directional&#034;, White, ImageScaled[{0, 0, 2.}]}}, ViewPoint -&gt; {-0.011, -3.043, 1.479}, Background -&gt; Black, BoundaryStyle -&gt; RGBColor[.5, .5, .5, .5]] I wanted to overlay 2 stars or black holes on top of the surface. Combining the above with this overlay and giving a value to the angle Theta we get: With[{\[Theta] = 0}, Show[Plot3D[( 60 Cos[2 ArcTan[y/(x + 0.00001)] - \[Theta] + 0.544331 Sqrt[x^2 + y^2]])/( 20 + Sqrt[x^2 + y^2]), {x, -45, 45}, {y, -45, 45}, PlotPoints -&gt; 100, Mesh -&gt; 20, MeshStyle -&gt; {RGBColor[.5, .5, .5, .5]}, Boxed -&gt; False, BoxRatios -&gt; Automatic, Axes -&gt; False, PlotStyle -&gt; {RGBColor[.3, .3, .8]}, ImageSize -&gt; {1024, 768}, Lighting -&gt; {{&#034;Directional&#034;, White, ImageScaled[{0, 0, 2.}]}}, ViewPoint -&gt; {-0.011, -3.043, 1.479}, Background -&gt; Black, BoundaryStyle -&gt; RGBColor[.5, .5, .5, .5]], Graphics3D[{Directive[Hue[.58, 0, 1], Lighting -&gt; Join[{{&#034;Ambient&#034;, Black}}, Table[{&#034;Directional&#034;, Hue[.58, .5, 1], ImageScaled[{Sin[x], Cos[x], -.5}]}, {x, 0, 2 Pi - 2 Pi/8, 2 Pi/8}]]], Sphere[{2 Cos[\[Theta] - \[Pi]/2], 2 Sin[\[Theta] - \[Pi]/2], 3}, 1], Sphere[{Cos[\[Theta] + \[Pi]/2], Sin[\[Theta] + \[Pi]/2], 3}, 1]}], PlotRange -&gt; All]] ![enter image description here] Next, I wanted to animate this to give the effect that the spiral arms are rotating outwards. That&#039;s done by incrementing the angle Theta and generating a list of frames that can then be exported. anim = Table[ Rasterize[ Show[Plot3D[( 60 Cos[2 ArcTan[y/(x + 0.00001)] - \[Theta] + 0.544331 Sqrt[x^2 + y^2]])/( 20 + Sqrt[x^2 + y^2]), {x, -45, 45}, {y, -45, 45}, PlotPoints -&gt; 100, Mesh -&gt; 20, MeshStyle -&gt; {RGBColor[.5, .5, .5, .5]}, Boxed -&gt; False, BoxRatios -&gt; Automatic, Axes -&gt; False, PlotStyle -&gt; {RGBColor[.3, .3, .8]}, ImageSize -&gt; {800, 450}, Lighting -&gt; {{White, ImageScaled[{0, 0, 2.}]}}, ViewPoint -&gt; {-0.011, -3.043, 1.479}, Background -&gt; RGBColor[0, 0, 0], BoundaryStyle -&gt; Gray], Graphics3D[{Directive[Hue[.58, 0, 1], Lighting -&gt; Join[{{&#034;Ambient&#034;, Black}}, Table[{&#034;Directional&#034;, Hue[.58, .5, 1], ImageScaled[{Sin[x], Cos[x], -.5}]}, {x, 0, 2 Pi - 2 Pi/8, 2 Pi/8}]]], Sphere[{2 Cos[\[Theta] - \[Pi]/2], 2 Sin[\[Theta] - \[Pi]/2], 3}, 1], Sphere[{Cos[\[Theta] + \[Pi]/2], Sin[\[Theta] + \[Pi]/2], 3}, 1]}], PlotRange -&gt; All]], {\[Theta], 0, 2 \[Pi], .1}]; And then to export it to an animated GIF: Export[&#034;GravityWave.gif&#034;, anim] The result is the animation at the top of this post. : http://community.wolfram.com//c/portal/getImageAttachment?filename=ezgif.com-optimize%283%29.gif&amp;userId=20103 : https://www.youtube.com/watch?v=WiNKulqt0SE : http://lisa.nasa.gov/ : http://community.wolfram.com//c/portal/getImageAttachment?filename=gravitywave60.png&amp;userId=25355 : http://community.wolfram.com//c/portal/getImageAttachment?filename=GravityWave.gif&amp;userId=25355 Jeff Bryant 2016-02-10T19:35:05Z