<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel rdf:about="https://community.wolfram.com">
    <title>Community RSS Feed</title>
    <link>https://community.wolfram.com</link>
    <description>RSS Feed for Wolfram Community showing any discussions tagged with Equation Solving sorted by most likes.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1557676" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2399430" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1063480" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2975371" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2085563" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1610701" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/515162" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1330785" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/127970" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2922562" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1034626" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1313605" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/355110" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3137899" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/932742" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3499774" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2466894" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2153362" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/815125" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3604903" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1557676">
    <title>Anamorphic Reflections in a Christmas Ball</title>
    <link>https://community.wolfram.com/groups/-/m/t/1557676</link>
    <description>**[Open in Cloud][1] | Download to Desktop via Attachments Below**&#xD;
 &#xD;
![Forgot to add the end result][111]&#xD;
&#xD;
&#xD;
&#xD;
I recently got inspired by a sculpture sold on [Saatchi Art][2] featuring anamorphic deformation by reflection in a spherical mirror. &#xD;
Being curious and interested in anamorphic transformations, I wanted to build something similar and find the math behind it using Mathematica...&#xD;
&#xD;
![Saatchi art][3]&#xD;
&#xD;
A plain, undecorated Christmas ball can serve as a perfect convex spherical mirror to test some of our physics and coding skills.&#xD;
I used a 7 cm XMas ball now dumped in stores for Euro1.75 a sixpack!&#xD;
 In a nutshell: I wanted to see how a deformed text should look like in order to show up undeformed when reflected in a ball shaped mirror.&#xD;
![Xmass ballls][4]&#xD;
&#xD;
The graphics below show a spherical mirror centered at C:(0,0,0), our eye at viewpoint V: (xv,0,zv) and a reflected point S on the base plane beneath the ball. One of the reflected light rays leaving S will meet the mirror at Q such that its reflection meets the eye at V.  But the eye at V will now perceive the point S at I. &#xD;
![complete view pane][5]&#xD;
&#xD;
I is a perceived image point inside the view disk perpendicular to VC.  According to the law of reflection, the lines VQI and SRQ will form equal angles with the normal n to the sphere in Q.&#xD;
All image points will be restricted to a disk that is the base of the view cone with the line CV as axis and an opening angle of tan^-1(zv/xv). This image disk is at an offset 1/xv from C and has a radius of Sqrt[1-(1/xv)^2].&#xD;
![view cone][6]&#xD;
&#xD;
The point Q (q1, q2, q3) is the intersection of the view line VI and the mirror sphere. It can be computed by solving this equation:&#xD;
&#xD;
    solQ = NSolve[&#xD;
       Element[{x, y, z}, HalfLine[{imagePointI, viewPointV}]] &amp;amp;&amp;amp; &#xD;
        Element[{x, y, z}, Sphere[]], {x, y, z}];&#xD;
    pointQ = First[{x, y, z} /. solQ]; {q1, q2, q3} = pointQ;&#xD;
The points C, Q, I, V and S are all in the same plane. We have R, the projection of V to the normal n.&#xD;
&#xD;
    projectionPlane = InfinitePlane[pointQ, {pointQ, viewPointV}];&#xD;
    reflectionPt = 2 Projection[viewPointV, pointQ] - viewPointV;&#xD;
The point S is now the intersection of of the line QR with the base plane. It can be computed by solving this equation:&#xD;
&#xD;
    solS = NSolve[{{x, y, z} \[Element] &#xD;
          HalfLine[{{q1, q2, q3}, reflectionPt}] &amp;amp;&amp;amp; {x, y, z} \[Element] &#xD;
          InfinitePlane[{{0, 0, -1}, {0, 1, -1}, {0, -1, -1}}]}, {x, y, &#xD;
        z}];&#xD;
After simplification, we can write the following function that maps the perceived image point I to the reflected point R :&#xD;
&#xD;
    xmasBallMap[iPt : {yi_, zi_}, vPt : {xv_, zv_}] :=&#xD;
     &#xD;
     Module[{imagePtRotated, solQ, q1, q2, q3},&#xD;
      (*image point in real (rotated) pane*)&#xD;
      imagePtRotated = {(1 - zi zv)/Norm@vPt, &#xD;
        yi, (xv^2 zi + zv)/xv/Norm@vPt};&#xD;
      (*intersection viewline-sphere: Q*)&#xD;
      solQ = NSolve[&#xD;
        Element[{x, y, z}, HalfLine[{imagePtRotated, {xv, 0, zv}}]] &amp;amp;&amp;amp; &#xD;
         Element[{x, y, z}, Sphere[]], {x, y, z}];&#xD;
      {q1, q2, q3} = First[{x, y, z} /. solQ]; &#xD;
      Join[{-(1 + q3) (q2^2 + q3^2) xv + q1^2 (xv - q3 xv) + &#xD;
          q1^3 (-1 + zv) + q1 q2^2 (-1 + zv) + &#xD;
          q1 q3 (q3 (-1 + zv) + 2 zv), &#xD;
         q2 (2 q1 xv + q1^2 (-1 + zv) + q2^2 (-1 + zv) + &#xD;
            q3 (q3 (-1 + zv) + 2 zv))}/(-2 q1 q3 xv + q3^2 (q3 - zv) + &#xD;
          q1^2 (q3 + zv) + q2^2 (q3 + zv)), {-1}]]&#xD;
All possible image points have to fit inside the lower half-disk. This is a grid of image points inside the view disk:&#xD;
&#xD;
    pts = Table[&#xD;
       Table[{x, y}, {x, -Floor[Sqrt[1 - y^2], .1] + .1, &#xD;
         Floor[Sqrt[1 - y^2], .1] - .1, .025}], {y, 0, -.9, -.025}];&#xD;
    viewDisk = Graphics[{Circle[{0, 0}, 1, {\[Pi], 2. \[Pi]}],&#xD;
       {AbsolutePointSize[2], Point /@ pts}}, Axes -&amp;gt; True, &#xD;
      AxesOrigin -&amp;gt; {-1, -1}, AxesStyle -&amp;gt; Directive[Thin, Red]]&#xD;
![all points in view disk][7]&#xD;
&#xD;
This is the reflected spherical anamorphic map of these points:&#xD;
&#xD;
![all anamorphic points][8]&#xD;
&#xD;
We can see that there is a large magnification between the perceived image inside the ball and it reflected image. Getting a point too close to the rim of the view disk will project its reflection far away.&#xD;
This GIF shows the function in action. The image point I follows a circle in the perceived image disk while its reflection S follows the closed curve of its map xmasBallmap(I, v) in the base plane.&#xD;
![reflected image gif][9]&#xD;
&#xD;
We can now further test our function with some text e.g.: &amp;#034;\[MathematicaIcon]Mathematica\[MathematicaIcon]&amp;#034;.&#xD;
&#xD;
    ma = First[First[&#xD;
         ImportString[&#xD;
          ExportString[&#xD;
           Style[&amp;#034;\[MathematicaIcon]Mathematica\[MathematicaIcon]&amp;#034;, &#xD;
            FontFamily -&amp;gt; &amp;#034;Times&amp;#034;, FontSize -&amp;gt; 72], &amp;#034;PDF&amp;#034;], &#xD;
          &amp;#034;TextMode&amp;#034; -&amp;gt; &amp;#034;Outlines&amp;#034;]]] /. FilledCurve :&amp;gt; JoinedCurve;&#xD;
The text image needs to be rescaled and centered to fit inside the ball.&#xD;
&#xD;
    maCenteredScaled = &#xD;
      ma /. {x_?NumericQ, y_?NumericQ} :&amp;gt; {x, y}*.005 /. {x_?NumericQ, &#xD;
         y_?NumericQ} :&amp;gt; {x - .93, y - .45};&#xD;
&#xD;
This shows the text as should be perceived in the lower half of the mirror sphere:&#xD;
&#xD;
![Mathematica in view disk][10]&#xD;
&#xD;
This is the code for a 3D view of the complete setup: the spherical mirror, the perceived text in the disk inside the sphere and the deformed, anamorphic image on the base plane.&#xD;
&#xD;
    Quiet@Module[{xv = 10., zv = 3., \[Phi], rotationTF, pointA, viewPt, &#xD;
       mathPts, rotatedMathPts, reflectedPts},&#xD;
      (*view angle*)\[Phi] = ArcTan[xv, zv];&#xD;
      rotationTF = RotationTransform[-\[Phi], {0, 1, 0}, {0, 0, 0}];&#xD;
      (*view pane rotation anchor*)&#xD;
      pointA = {(0 - .01) Cos[\[Phi]], 0, (0 - .01) Sin[\[Phi]]};&#xD;
      (*point coordinates in y-z plane*)&#xD;
      mathPts = maCenteredScaled[[-1, 1, All, -1]];&#xD;
      rotatedMathPts = &#xD;
       Map[rotationTF, &#xD;
        mathPts /. {y_?NumericQ, z_?NumericQ} :&amp;gt; {0, y, z}, {3}];&#xD;
      reflectedPts = Map[xmasBallMap[#, {xv, zv}] &amp;amp;, mathPts, {3}];&#xD;
      Graphics3D[{&#xD;
        (*reflected image plane (floor)*){Opacity[.45], LightBlue, &#xD;
         InfinitePlane[{{0, 0, -1}, {1, 0, -1}, {-1, .5, -1}}]},&#xD;
        (*mirror sphere*){Opacity[.35], Sphere[]},&#xD;
        (*center of sphere*){Black, Sphere[{0, 0, 0}, .03]},&#xD;
        (*percieved image pane*){Opacity[.35], &#xD;
         Cylinder[{{0, 0, 0}, pointA}, 1]},&#xD;
        (*perceived image*){Red, Line /@ rotatedMathPts},&#xD;
        (*reflected image*){Red, AbsoluteThickness[3], &#xD;
         Line /@ reflectedPts}},&#xD;
       Boxed -&amp;gt; False]]&#xD;
&#xD;
![full 3D view][11]&#xD;
&#xD;
Time to try the real thing. This shows a 7cm diameter XMas ball mirror with the text reflected in it.&#xD;
![Xmass ball real][12]&#xD;
&#xD;
Get yourself a nice reflecting Christmas ball and  this is a pdf for you to printout and try it! (see attached pdf file for printing)&#xD;
&#xD;
![enter image description here][13]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/objects/wolfram-community/Anamorphic-Reflections-in-a-Christmas-Ball-by-Erik-Mathieu&#xD;
  [2]: https://www.saatchiart.com/art/Sculpture-All-is-in-One-Anamorphosis-2018-604-1-20/779925/4007113/view&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=saatchismall.png&amp;amp;userId=68637&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=love-balls-resize.gif&amp;amp;userId=68637&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=defaultviewpane.png&amp;amp;userId=68637&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1450view-cone.png&amp;amp;userId=68637&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=allimagepts.png&amp;amp;userId=68637&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=allanamopts.png&amp;amp;userId=68637&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=reflected-circle.gif&amp;amp;userId=68637&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=mathematicainsphere.png&amp;amp;userId=68637&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=mathematica-code.png&amp;amp;userId=68637&#xD;
  [12]: https://community.wolfram.com//c/portal/getImageAttachment?filename=mathematicaXmsBall.png&amp;amp;userId=68637&#xD;
  [13]: https://community.wolfram.com//c/portal/getImageAttachment?filename=printout.png&amp;amp;userId=68637&#xD;
  [111]: https://community.wolfram.com//c/portal/getImageAttachment?filename=LoveYouXmsBall-1.jpg&amp;amp;userId=68637</description>
    <dc:creator>Erik Mahieu</dc:creator>
    <dc:date>2018-11-22T15:55:11Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2399430">
    <title>Rogue wave: stable fluids algorithm for air/water interface simulation</title>
    <link>https://community.wolfram.com/groups/-/m/t/2399430</link>
    <description>*SUPPLEMENTARY WOLFRAM MATERIALS for the ARTICLE:*&#xD;
&amp;gt; Sergio Manzetti, Alexander Trounev (2021).&#xD;
&#xD;
&amp;gt; A Navier-Stokes model for Rogue wave simulation.&#xD;
&#xD;
&amp;gt; ResearchGate, Technical Report. https://www.researchgate.net/publication/354527324&#xD;
&#xD;
&#xD;
------&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
ABSTRACT&#xD;
--------------------------------------&#xD;
&#xD;
Rogue waves are anomalous phenomena occurring over large sea bodies, where they are said appear out of nowhere and disappear without a trace. Simulations of rogue waves have been carried over the last 40 years, with several models published. In this paper we investigate the formation of rogue waves by two models: I. the Navier-Stokes equation where we take into account density and viscosity gradient on the air-water interface due to diffusion and II. a Korteveg de Vries-type model for quantum jumps which we developed earlier. We derive also a stable fluids algorithm which we use to compute nonlinear waves interaction produced by the wind. The results are discussed and compared.&#xD;
&#xD;
This code solves problem of viscous incompressible flow with gravitational force in a rectangle with periodic boundary condition on the left and right side and with Dirichlet condition on the top and bottom side. &#xD;
In the initial condition fluid velocity is periodic wave, and density has unit step like distribution on the air/water interface. &#xD;
Some other application of this code has been discussed on https://mathematica.stackexchange.com/questions/246091/stable-fluids-code-for-electromagnetic-mixture-application&#xD;
&#xD;
This model has been discussed in our report  [A Navier-Stokes model for Rogue wave simulation][2]&#xD;
&#xD;
Two phase model of air-water interface&#xD;
--------------------------------------&#xD;
&#xD;
Let us consider the system of equations describing nonlinear waves on the air-water interface. As it well known the air and the water can be considered as viscous incompressible fluids with density $\rho_a, \rho_w$,  and dynamical viscosity $\mu_a, \mu_w$ consequently. Taking into account the gravity force and diffusion on the air-water interface, we have &#xD;
$$\nabla.\bf{u}=0\\&#xD;
 \frac{\partial \mathbf{u}}{\partial t}+(\mathbf{u}.\nabla)\mathbf{u}+\frac{\nabla P}{\rho_i}=\nu_i\nabla ^2\mathbf{u}+\mathbf{f}\\\&#xD;
 \frac{\partial \phi}{\partial t} +(\mathbf{u}.\nabla)\phi=\frac{\nu_i}{Sc_i}\nabla ^2\phi\\ &#xD;
$$&#xD;
Here it is indicated $\rho_i, i=a,w $ - air and water density, $\mathbf{u}=(u_x,u_y)$ - flow velocity,  $P$ - pressure; $\bf{f}$ - force acting on the volume of the air-water mixture; $\phi$ - the interface function describing the averaged density of the air-water mixture; $Sc_i$ - analog of the Schmidt number characterized water diffusion in the air and air diffusion in the water. Note that we considered averaged effect of mass transfer on the air-water interface including drops and bubbles. &#xD;
Let us define the Cartesian coordinate system so that the $y$ axis is directed against the direction of the gravitational acceleration vector and the $x$ axis is parallel to horizon. Let suppose that the water surface relief is described by the equation $y=r(t,x,y)$ - Figure 1.&#xD;
![Figure 1. Flow geometry on the air-water interface with waves of small (left) and large (right) amplitude][3]&#xD;
&#xD;
We set the boundary conditions for the flow parameters on the top and bottom part of the boundary layer and periodic boundary conditions by coordinate $x$ as follows:&#xD;
&#xD;
$$ y=0: \mathbf{u}=0,\phi=\rho_w\\&#xD;
 y=H: \mathbf{u}=(U_0,0), \phi=\rho_a\\&#xD;
 \mathbf{u}(t,0,y)=\mathbf{u}(t,L,y)\\&#xD;
 \phi(t,0,y)=\phi(t,L,y).&#xD;
$$&#xD;
Here $H$ is the height of the boundary layer,$U_0$ is the wind velocity, $L$ is the period of the wave tray.&#xD;
We assume that at the initial time the flow velocity and interface function are given by&#xD;
&#xD;
$$ t=0, y&amp;lt;H/2:u_x = 0, u_y=V_0 \sin(2 \pi n x/L), \phi =\rho_w\\ &#xD;
 t=0, y\ge H/2: u_x=U_0, u_y=V_0\sin (2 \pi n x/L), \phi =\rho_a\\&#xD;
 $$&#xD;
This problem can be solved with using numerical methods and an appropriate turbulence model. &#xD;
We have used stable fluids algorithm (Stam1999, Stam 2000) to solve 2D Navier-Stokes equations and to simulate nonlinear waves interaction on the air-water interface with a given wind velocity on the top of the boundary layer. While in the standard gravity wave theory the air-water interface is considered mainly as a potential flow, in our approach we take into account velocity, viscosity and density gradients on the interface. Since air/water density ratio is about $10^{-3}$ we have some challenging numerical problem. To solve this problem we made some simplifications in the basic Navier-Stokes equations. First, we suppose that velocity is a continues field at $t&amp;gt;0$ so that flow in the water and flow in the air is an united flow continuously distributed from the bottom to the top and the periodic one in the $x$ direction. We neglect by the surface tension due to large scale of the waves.  Therefore we don&amp;#039;t need any boundary condition on the air-water interface. Second, at $t&amp;gt;0$ we introduce continues density as $\rho=\phi$ to compute velocity field on every step. Third, we use stable fluid algorithm in time in the very specific order described below.&#xD;
&#xD;
&#xD;
Stable fluids algorithm&#xD;
-----------------------&#xD;
&#xD;
&#xD;
&#xD;
1) Solve advection equation with using boundary conditions, initial data from the previous step, and an implicit algorithm&#xD;
&#xD;
$$ \frac{\partial \mathbf{u}_1}{\partial t}+(\mathbf{u}_1.\nabla) \bf{u}_1=0 $$&#xD;
&#xD;
2) Solve diffusion equation with $\nu_i=\nu_i(\phi)$, initial data $\mathbf{u}_1$, boundary conditions  and with using, for example, Gauss-Seidel relaxation algorithm  &#xD;
&#xD;
$$ \frac{\partial \mathbf {u}_2}{\partial t}-\nu_i \nabla^2 \mathbf{u}_2=0$$&#xD;
&#xD;
here $$\nu_i(\phi)=\nu_w \phi ^k, k=-0.4029$$ for the air temperature of 20C.&#xD;
&#xD;
3)  Add force to the velocity field from the previous step as follows&#xD;
&#xD;
$$&#xD;
\mathbf{u}_3=\mathbf{u}_2+\mathbf{f} dt\\&#xD;
$$&#xD;
&#xD;
To simulate force acting on the volume of air-water mixture we used approximation &#xD;
$$ f_y=-\frac{(\rho_w-\phi)(\phi-\rho_w/2)(\phi-\rho_a)}{\rho_w^2(\rho_w-\rho_a)Fr^2}&#xD;
 $$&#xD;
4) Make projection step. Here we can use two models. First model is standard projection (Stam 1999)  by solving Poison equation&#xD;
$$ t&amp;gt;0, \nabla^2 q=\nabla . \bf{u}_3\\&#xD;
 \bf{u}_4=\bf{u}_3-\nabla q&#xD;
  $$&#xD;
Note, that this step  allows us to define divergent free velocity field. &#xD;
   &#xD;
5) Update velocity field $\bf{u}_4\longrightarrow \bf{u}_5$ with using boundary conditions.&#xD;
&#xD;
6) Make diffusion step with interface function by solving diffusion equation with initial condition from the previous step, with boundary conditions, and with $\nu=\nu_i(\phi)/Sc$ as follows  &#xD;
$$ \frac{\partial \phi_1}{\partial t}-\nu \nabla^2 \phi_1=0&#xD;
$$&#xD;
7) Make advection step by solving advection equation with initial data from step 6 with boundary conditions using  an implicit algorithm (from step 1, for example),  &#xD;
$$ \frac{\partial \phi_2}{\partial t}+(\bf{u}_5.\nabla) \phi_2=0&#xD;
 $$&#xD;
8) Update interface function with boundary conditions.&#xD;
&#xD;
9) Return to step 1 with updated velocity and interface function.&#xD;
&#xD;
This algorithm can be also used in some different order, for example, in the beginning we can compute step 3 (Stam1999). Also we can make steps 6-8 first, and then compute velocity field with steps 1-5. The question about stability of the stable fluids algorithm not really solved yet. From our experience, we can&amp;#039;t do arbitrary time step, but $dt$ is limiting by the grid size as usual for more precise computation. In our computations we have used $dt=2/N$ for $N\times N$ grid. In general case the numerical solution depends on the Froude number $Fr=\frac{U_0}{\sqrt{g L}}$, Reynolds number $Re=\frac{U_0 L}{\nu_w}$, Schmidt number and number of waves in the initial data. In our computations we fixed the Froude number, so that we can put $H=L=1$. We also fixed the Reynolds number, therefore we can put $U_0=1.5, V_0=0.5$. The algorithm 1-9 has been implemented with FDM  and compiled to C with using Mathematica 12.3.  &#xD;
&#xD;
Code to simulate air/water interface with $Re=10^4, Fr=1$&#xD;
----&#xD;
&#xD;
    rhoWater20C = 1.027; nuW20C = 0.01007; rhoAir20C = 0.001204; nuA20C = 0.151;dif = 1/10000; pec = .1; U0 = 1.5; V0 = .5; dn0 = 0.997658; dn1 = 0.514102; kap = 1; n = 81; Fr = 1; F0 = 1; n1 = n + 1; sm = 600; r = 20; den = &#xD;
     ConstantArray[dn1 (1 + dn0 Tanh[-kap Range[-n1/2, n1/2]]), n1];u0 = ConstantArray[0, {n1, n1}]; Do[&#xD;
      u0[[i, j]] = U0 (1 + Tanh[kap (j - n1/2)])/2;, {i, n1}, {j, n1}];&#xD;
     v0 = ConstantArray[0., {n1, n1}]; Do[&#xD;
      v0[[i, j]] = V0 Sin[10 Pi (i - 1)/n];, {i, n1}, {j, n1}];periodic[n_, up_, ud_, ub_] := &#xD;
        Module[{bd = ub}, Do[bd[[1, i]] = .5 (bd[[n, i]] + bd[[2, i]]);&#xD;
          bd[[n + 1, i]] = bd[[1, i]]; bd[[i, 1]] = ud;&#xD;
          bd[[i, n + 1]] = up;, {i, 2, n}];&#xD;
         bd[[1, 1]] = .5 (bd[[2, 1]] + bd[[1, 2]]);&#xD;
         bd[[n + 1, n + 1]] = .5 (bd[[n, n + 1]] + bd[[n + 1, n]]);&#xD;
         bd[[n + 1, 1]] = .5 (bd[[n, 1]] + bd[[n + 1, 2]]);&#xD;
         bd[[1, n + 1]] = .5 (bd[[1, n]] + bd[[2, n + 1]]); bd];&#xD;
      &#xD;
      diffuse[n_, r_, a_, c_, c0_] := &#xD;
        Module[{c1 = c}, &#xD;
         Do[Do[Do[&#xD;
             c1[[i, j]] = (c0[[i, &#xD;
                   j]] + (a/den[[i, j]]^.4029) (c1[[i - 1, j]] + &#xD;
                     c1[[i + 1, j]] + c1[[i, j - 1]] + &#xD;
                     c1[[i, j + 1]]))/(1 + 4 a/den[[i, j]]^.4029);, {j, 2, &#xD;
              n}];, {i, 2, n}];&#xD;
          Do[c1[[1, i]] = c1[[n, i]]; c1[[n + 1, i]] = c1[[2, i]];&#xD;
           c1[[i, 1]] = c0[[i, 1]];&#xD;
           c1[[i, n + 1]] = c0[[i, n + 1]];, {i, 2, n}];&#xD;
          c1[[1, 1]] = .5 (c1[[2, 1]] + c1[[1, 2]]);&#xD;
          c1[[n + 1, n + 1]] = .5 (c1[[n, n + 1]] + c1[[n + 1, n]]);&#xD;
          c1[[n + 1, 1]] = .5 (c1[[n, 1]] + c1[[n + 1, 2]]);&#xD;
          c1[[1, n + 1]] = .5 (c1[[1, n]] + c1[[2, n + 1]]);, {k, 0, r}];&#xD;
         c1];&#xD;
      &#xD;
      advect[n_, d0_, u_, v_, dt_] := &#xD;
        Module[{x, y, d1, dt0, i0, i1, j0, j1, s0, s1, t0, t1}, &#xD;
         d1 = ConstantArray[0, {n + 1, n + 1}]; dt0 = dt n;&#xD;
         Do[Do[x = i - dt0 u[[i, j]]; y = j - dt0 v[[i, j]];&#xD;
            i0 = Which[x &amp;lt;= 1, 1, 1 &amp;lt; x &amp;lt; n, Floor[x], True, n];&#xD;
            i1 = i0 + 1;&#xD;
            j0 = Which[y &amp;lt;= 1, 1, 1 &amp;lt; y &amp;lt; n, Floor[y], True, n];&#xD;
            j1 = j0 + 1; s1 = x - i0; s0 = 1 - s1; t1 = y - j0; t0 = 1 - t1;&#xD;
            d1[[i, j]] = &#xD;
             s0 (t0 d0[[i0, j0]] + t1 d0[[i0, j1]]) + &#xD;
              s1 (t0 d0[[i1, j0]] + t1 d0[[i1, j1]]);, {j, 1, n + 1}];, {i, &#xD;
           1, n + 1}]; d1];&#xD;
      &#xD;
      project[n_, r_, u0_, v0_, u_, v_] := &#xD;
        Module[{ux = u, vy = v, div, p}, &#xD;
         p = ConstantArray[0, {n + 1, n + 1}];&#xD;
         div = ConstantArray[0, {n + 1, n + 1}];&#xD;
         ux = ConstantArray[0, {n + 1, n + 1}];&#xD;
         vy = ConstantArray[0, {n + 1, n + 1}];&#xD;
         Do[div[[i, &#xD;
             j]] = -.5/&#xD;
              n (u0[[i + 1, j]] - u0[[i - 1, j]] + v0[[i, 1 + j]] - &#xD;
               v0[[i, j - 1]]);, {i, 2, n}, {j, 2, n}];&#xD;
         Do[Do[Do[&#xD;
             p[[i, j]] = (div[[i, &#xD;
                   j]] + (p[[i - 1, j]] + p[[i + 1, j]] + p[[i, j - 1]] + &#xD;
                    p[[i, j + 1]]))/4;, {j, 2, n}], {i, 2, n}];, {k, 0, r}];&#xD;
         Do[ux[[i, j]] = u0[[i, j]] - .5 n (p[[i + 1, j]] - p[[i - 1, j]]);&#xD;
          vy[[i, j]] = &#xD;
           v0[[i, j]] - .5 n (p[[i, j + 1]] - p[[i, j - 1]]);, {i, 2, &#xD;
           n}, {j, 2, n}]; {ux, vy}];&#xD;
      &#xD;
      Fx[t_, x_, y_] := 0;&#xD;
      Fy[t_, x_, y_] := -1/Fr^2;&#xD;
      &#xD;
      onestep[n_, step_, r_, a_, uin_, vin_, dt_, c_] := &#xD;
       Module[{u1, v1, f1, f2, u, v, u0, v0}, &#xD;
        f1 = ConstantArray[0, {n + 1, n + 1}];&#xD;
        f2 = ConstantArray[0., {n + 1, n + 1}];&#xD;
        u0 = ConstantArray[0., {n + 1, n + 1}];&#xD;
        v0 = ConstantArray[0., {n + 1, n + 1}];&#xD;
        u = ConstantArray[0., {n + 1, n + 1}];&#xD;
        v = ConstantArray[0., {n + 1, n + 1}];&#xD;
        u1 = ConstantArray[0., {n + 1, n + 1}];&#xD;
        v1 = ConstantArray[0., {n + 1, n + 1}]; u0 = uin; v0 = vin; Do[&#xD;
         f2[[i, j]] = &#xD;
           1/Fr^2 (den[[i, j]] - rhoWater20C/2) (rhoWater20C - &#xD;
              den[[i, j]]) (den[[i, j]] - rhoAir20C)/(rhoWater20C - &#xD;
                rhoAir20C)/rhoWater20C^2;, {i, 2, n}, {j, 2, n}];&#xD;
        v0 += f2 dt;&#xD;
        u0 = advect[n, u0, u0, v0, dt]; v0 = advect[n, v0, u0, v0, dt]; &#xD;
        mnV = 0;&#xD;
        u0 = periodic[n, U0, 0, u0]; v0 = periodic[n, mnV, mnV, v0];&#xD;
        u0 = diffuse[n, r, a, c, u0]; v0 = diffuse[n, r, a, c, v0];&#xD;
        u0 = periodic[n, U0, 0, u0]; v0 = periodic[n, mnV, mnV, v0];&#xD;
        {u1, v1} = project[n, r, u0, v0, u, v];&#xD;
        u0 = periodic[n, U0, 0, u1]; &#xD;
        v0 = periodic[n, mnV, mnV, v1]; {u0, v0}]&#xD;
      &#xD;
      cf = With[{cg = Compile`GetElement, hp = HoldPattern, &#xD;
          dv = DownValues}, &#xD;
         Hold@Compile[{{u0argu, _Real, 2}, {v0argu, _Real, &#xD;
                   2}, {denargu, _Real, &#xD;
                   2}, {sm, _Integer}, {n, _Integer}, {r, _Integer}, dif, &#xD;
                  pec, F0}, &#xD;
                 Module[{u0 = u0argu, v0 = v0argu, uu, vv, dd, &#xD;
                   den = denargu, c = Table[0., {n + 1}, {n + 1}], &#xD;
                   dt = 40./n^2, a, dnup = den[[1, n + 1]], &#xD;
                   dnd = den[[1, 1]]}, a = dt dif n n;&#xD;
                  uu = vv = dd = Table[0., {sm + 1}, {n + 1}, {n + 1}];&#xD;
                  Do[&#xD;
                   &#xD;
                   den = advect[n, den, u0, v0, dt];&#xD;
                   den = periodic[n, dnup, dnd, den]; &#xD;
                   den = diffuse[n, r, a/pec, c, den];&#xD;
                   den = periodic[n, dnup, dnd, den];&#xD;
                   &#xD;
                   dd[[step + 1]] = den; {u0, v0} = &#xD;
                    onestep[n, step, r, a, u0, v0, dt, c];&#xD;
                   uu[[step + 1]] = u0;&#xD;
                   vv[[step + 1]] = v0;, {step, 0, sm}]; {uu, vv, dd}], &#xD;
                 CompilationTarget -&amp;gt; C, RuntimeOptions -&amp;gt; &amp;#034;Speed&amp;#034;] /. &#xD;
               dv@onestep /. &#xD;
              Flatten[dv /@ {Fx, Fy, advect, diffuse, periodic, project}] /. &#xD;
             hp@ConstantArray[c_, {i_, j_}] :&amp;gt; Table[0., {i}, {j}] /. &#xD;
            hp@Part[a__] :&amp;gt; cg[a] /. hp[cg[a__] = rhs_] :&amp;gt; (Part[a] = rhs) //&#xD;
           ReleaseHold];&#xD;
&#xD;
Visualization&#xD;
-------------&#xD;
&#xD;
    rst = cf[u0, v0, den, sm, n, r, dif, pec, F0];Do[lstu[k] = &#xD;
       Flatten[Table[{{(i - 1)/n, (j - 1)/n}, rst[[1, k, i, j]]}, {i, &#xD;
          n1}, {j, n1}], 1]; &#xD;
      lstv[k] = &#xD;
       Flatten[Table[{{(i - 1)/n, (j - 1)/n}, rst[[2, k, i, j]]}, {i, &#xD;
          n1}, {j, n1}], 1];, {k, sm}];&#xD;
    Do[Uvel[i] = Interpolation[lstu[i], InterpolationOrder -&amp;gt; 3];, {i, 1, &#xD;
       sm}];&#xD;
    Do[Vvel[i] = Interpolation[lstv[i], InterpolationOrder -&amp;gt; 3];, {i, 1, &#xD;
      sm}]; Do[lst4[k] = &#xD;
       Flatten[Table[{{(i - 1)/n, (j - 1)/n}, rst[[3, k, i, j]]}, {i, &#xD;
          n1}, {j, n1}], 1];, {k, sm}];&#xD;
    Do[rh[k] = Interpolation[lst4[k], InterpolationOrder -&amp;gt; 3];, {k, sm}];{ContourPlot[Uvel[10][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 15, ContourStyle -&amp;gt; Yellow, PlotLegends -&amp;gt; Automatic], &#xD;
     ContourPlot[Vvel[10][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 15, ContourStyle -&amp;gt; Yellow, PlotLegends -&amp;gt; Automatic], &#xD;
     ContourPlot[1 - rh[10][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 15, ContourStyle -&amp;gt; Yellow, PlotLegends -&amp;gt; Automatic], &#xD;
     ContourPlot[Uvel[sm][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 15, ContourStyle -&amp;gt; Yellow, PlotLegends -&amp;gt; Automatic], &#xD;
     ContourPlot[Vvel[sm][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 15, ContourStyle -&amp;gt; Yellow, PlotLegends -&amp;gt; Automatic], &#xD;
     ContourPlot[1 - rh[sm][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 8, ContourStyle -&amp;gt; Yellow, PlotLegends -&amp;gt; Automatic]}&#xD;
In this Figure are shown velocity components $u_x$ (left), $u_y$ (middle) and 1- density (right) on step 10 (upper line) and on final step $sm=600$&#xD;
![Figure 2][4]  &#xD;
&#xD;
UPDATE&#xD;
----------&#xD;
&#xD;
Next step is to animate wave transformation using interface function. We can show velocity field over density as follows&#xD;
&#xD;
    Show[ContourPlot[1 - rh[sm][x, y]/rhoWater20C, {x, 0, 1}, {y, 0, 1}, &#xD;
      PlotRange -&amp;gt; All, ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Contours -&amp;gt; 8,&#xD;
       ContourStyle -&amp;gt; Yellow, Frame -&amp;gt; False, PlotLegends -&amp;gt; Automatic], &#xD;
     StreamPlot[{Uvel[sm][x, y], Vvel[sm][x, y]}, {x, 0, 1}, {y, 0, 1}, &#xD;
      PlotRange -&amp;gt; All, StreamColorFunction -&amp;gt; None, VectorPoints -&amp;gt; Fine,&#xD;
       VectorColorFunction -&amp;gt; Hue, PlotLegends -&amp;gt; Automatic, &#xD;
      StreamColorFunctionScaling -&amp;gt; True, StreamStyle -&amp;gt; LightGray]]&#xD;
![Figure 3][5]&#xD;
&#xD;
We can also compute frames for animation with using interface function  &#xD;
&#xD;
    frames=Table[ContourPlot[1 - rh[i][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 8, ContourStyle -&amp;gt; Yellow, PlotLabel -&amp;gt; i], {i, 20, sm, &#xD;
      20}]; Animate[frames]&#xD;
![Figure 4][6]&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
References&#xD;
----------&#xD;
Jos Stam. Stable fluids. In Computer Graphics Proceedings Annual Conference Series, Los Angeles, Aug. 3&amp;#x2013;8, 199.&#xD;
&#xD;
Jos Stam. Interacting with smoke and fire in real time. Communications&#xD;
of the ACM, 43(7):77&amp;#x2013;83, July 2000.&#xD;
      &#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=RogueWave.gif&amp;amp;userId=11733&#xD;
  [2]: https://www.researchgate.net/publication/354527324_A_Navier-Stokes_model_for_Rogue_wave_simulation&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Figure1.jpg&amp;amp;userId=1218692&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Figure2.jpg&amp;amp;userId=1218692&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Figure3.jpg&amp;amp;userId=1218692&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Fr3v3.AW1300Q5.gif&amp;amp;userId=1218692</description>
    <dc:creator>Alexander Trounev</dc:creator>
    <dc:date>2021-11-03T06:49:53Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1063480">
    <title>Formula for computing sqrt(2) of binary numbers</title>
    <link>https://community.wolfram.com/groups/-/m/t/1063480</link>
    <description>&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/373ccb1d-e97f-40ec-aa0a-0d3001c4728d</description>
    <dc:creator>Mariusz Iwaniuk</dc:creator>
    <dc:date>2017-04-16T22:38:51Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2975371">
    <title>[WSG23] Daily Study Group: Solving ODEs and PDEs</title>
    <link>https://community.wolfram.com/groups/-/m/t/2975371</link>
    <description>A Wolfram U Daily Study Group on &amp;#034;Solving ODEs and PDEs&amp;#034; begins on Monday, August 8, 2023.&#xD;
&#xD;
Join me and a cohort of fellow enthusiasts to learn about the techniques for solving ordinary differential equations (ODEs) and partial differential equations (PDEs) using Wolfram Language. Learn how to use the DSolve (for symbolic solutions) and the NDSolve (a general numerical differential equation solver) functions. Topics covered include the numerical method of lines, the finite element method (FEM), the use and construction of meshes, boundary value problems and eigenvalue problems.&#xD;
&#xD;
Participate in live Q&amp;amp;A and review your understanding through interactive in-session polls. Complete quizzes at the end of the study group to get your certificate of program completion.&#xD;
&#xD;
August 7-11, 2023, 11am-12pm CT (4-5pm GMT)&#xD;
&#xD;
&amp;gt; [**REGISTER HERE**][1]&#xD;
&#xD;
Please feel free to use this thread to collaborate and share ideas, materials and links to other resources with fellow learners.&#xD;
&#xD;
I look forward to seeing you online!&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
&#xD;
  [1]: https://www.bigmarker.com/series/daily-study-group-wsg41&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=WolframUBanner.jpeg&amp;amp;userId=20103</description>
    <dc:creator>Luke Titus</dc:creator>
    <dc:date>2023-07-24T18:32:33Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2085563">
    <title>[GiF] Optimizing your Swing Ride</title>
    <link>https://community.wolfram.com/groups/-/m/t/2085563</link>
    <description>![enter image description here][1]&#xD;
&#xD;
In a previous Wolfram Demonstration [Pendulum with Varying Length or How to Improve Your Next Swing Ride][2], I modelled a swing and rider system as a pendulum with varying length. Inspired by the article &amp;#034;[Pumping a Playground Swing][3]&amp;#034; by Post et al.  I looked at an alternative strategy to &amp;#034;optimize my swing ride&amp;#034;.&#xD;
The swing-rider system can be modeled as a double pendulum. The regular, *unforced double pendulum* maintains a constant level of energy. Kinetic-and potential energy are merely converted into one another and their sum remains constant. In the case of a swing however, we have a *forced double pendulum* as the rider wants to go higher and &amp;#034;pump&amp;#034; his way up. This can only be achieved by increasing the total energy in the (swing and rider) system. &amp;#034;Energy insertion&amp;#034; can be done by someone pushing the rider or  by a properly synchronized change in the position  of the center of mass (CM) of the rider.&#xD;
In the mentioned demonstration, the CM change was limited to an up and down crouching of the rider. Here, I will analyse a more  general, circular or elliptic position change of the rider&amp;#039;s CM.&#xD;
&#xD;
**Geometry**&#xD;
&#xD;
Let us first look at the geometry of the swing-rider system: The swinging kid at P can introduce energy into the double pendulum by forcibly moving his center of gravity in an elliptic movement around a point Z on the rigid swing rods OS. \[Theta] is the angle of the swing movement and \[Phi] is the angle of the crouching movement (rotation). We need a &amp;#034;crouching function&amp;#034; linking the angles \[Phi] and \[Theta]: \[Phi] = \[Omega] \[Theta]+\[Phi]0. \[Omega] is the crouching frequency and \[Phi]0 is the crouching&amp;#039;s initial angular offset.&#xD;
&#xD;
    Animate[&#xD;
     With[{L = 10, r = 2., \[Omega] = 3., \[Phi]0 = 0, a = .62, b = 2},&#xD;
      Module[{pivot, \[Phi], trace, seatCenter, hipPivot, hip},&#xD;
       pivot = {0, 0}; \[Phi] = \[Omega] \[Theta] + \[Phi]0;&#xD;
       seatCenter = {L Sin[\[Theta]], -L Cos[\[Theta]]}; &#xD;
       hipPivot = (L - r) {Sin[\[Theta]], -Cos[\[Theta]]};&#xD;
       hip = {(L - r - a Cos[\[Phi]]) Sin[\[Theta]] + &#xD;
          b Cos[\[Theta]] Sin[\[Phi]], &#xD;
         Cos[\[Theta]] (-L + r + a Cos[\[Phi]]) + &#xD;
          b Sin[\[Theta]] Sin[\[Phi]]};&#xD;
       trace = Rotate[Circle[hipPivot, {b, a}], \[Theta]];&#xD;
       Graphics[{Line[{pivot, seatCenter}], Blue, Line[{hipPivot, hip}], &#xD;
         PointSize[.015], &#xD;
         Point[{pivot, hip, hipPivot, seatCenter}], {Red, trace}, {Dashed,&#xD;
           Line[{hip, pivot}]},&#xD;
         {Black, Text[Style[&amp;#034;O&amp;#034;, 12], pivot, {-1, -1}], &#xD;
          Text[Style[&amp;#034;Z&amp;#034;, 12], hipPivot, {1, 1}], &#xD;
          Text[Style[&amp;#034;P&amp;#034;, 12], hip, {-1, -1}], &#xD;
          Text[Style[&amp;#034;S&amp;#034;, 12], seatCenter, {-1, 1}]}}]]], {\[Theta], 0, &#xD;
      2 Pi}]&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
**Dynamic Model**&#xD;
&#xD;
We add the driver&amp;#039;s mass mk at P and consider the crouching as a periodic driving force. We use Newton&amp;#039;s laws to derive the equation of motion:&#xD;
&#xD;
    (*hip (CM) coordinate*)&#xD;
    xh[t_] := &#xD;
      b Cos[\[Theta][t]] Sin[\[Phi]0 + t \[Omega]] + (L - r - &#xD;
          a Cos[\[Phi]0 + t \[Omega]]) Sin[\[Theta][t]];&#xD;
    yh[t_] := (-L + r + a Cos[\[Phi]0 + t \[Omega]]) Cos[\[Theta][t]] + &#xD;
       b Sin[\[Phi]0 + t \[Omega]] Sin[\[Theta][t]];&#xD;
    (*effective swing length*)l = Sqrt[xh[t]^2 + yh[t]^2];&#xD;
    (*equilibrium of forces*) &#xD;
    deqns = {mk xh&amp;#039;&amp;#039;[t] == s[t] xh[t]/l, &#xD;
       mk yh&amp;#039;&amp;#039;[t] == s[t] yh[t]/l - mk g};&#xD;
    deqn = Eliminate[deqns, s[t]] // FullSimplify&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
This is an animation showing a solution of the differential equation. The evolution of the energy levels shows how the forced position changes in the rider&amp;#039;s CM is increasing the total energy in the system. Trying to reach a large energy increase in a short time is the goal of every swing rider. Here, a maximum energy level with a high swing is reached after a mere 1.5 full swings.&#xD;
&#xD;
    Animate[Module[{a = 1.75, &#xD;
       b = 1.5, \[Omega] = 1.9, \[Phi]0 = &#xD;
        0, \[Theta]0 = \[Pi]/4, \[Theta]00 = 0, V, T, mk = 50, g = 9.81, &#xD;
       L = 10, l, xh, yh, \[Theta]sol, seat, hip, hipPivot, trace, &#xD;
       tMax = 16, r = .75},&#xD;
      pivot = {0, 0};&#xD;
      (*crouch function*)\[Phi][t_] := \[Omega] t + \[Phi]0;&#xD;
      xh[t_] := &#xD;
       b Cos[\[Theta][t]] Sin[\[Phi]0 + t \[Omega]] + (L - r - &#xD;
           a Cos[\[Phi]0 + t \[Omega]]) Sin[\[Theta][t]];&#xD;
      yh[t_] := (-L + r + a Cos[\[Phi]0 + t \[Omega]]) Cos[\[Theta][t]] + &#xD;
        b Sin[\[Phi]0 + t \[Omega]] Sin[\[Theta][t]];&#xD;
      sol = First@&#xD;
        NDSolve[{deqn, \[Theta][0] == \[Theta]0, \[Theta]&amp;#039;[&#xD;
            0] == \[Theta]00}, \[Theta], {t, 0, tMax}];&#xD;
      hip = {xh[t], yh[t]} /. sol /. t -&amp;gt; time;&#xD;
      seat = L {Sin[\[Theta][time]], -Cos[\[Theta][time]]} /. sol;&#xD;
      hipPivot = (L - r) {Sin[\[Theta][time]], -Cos[\[Theta][time]]} /. &#xD;
        sol;&#xD;
      trace = Rotate[Circle[hipPivot, {b, a}], \[Theta][time]] /. sol;&#xD;
      (*kinetic energy*)&#xD;
      T[t_] := Evaluate[.5 mk (xh&amp;#039;[t]^2 + yh&amp;#039;[t]^2)] /. &#xD;
        sol;(*potential energy*)V[t_] := mk g yh[t] /. sol;&#xD;
      Column[{&#xD;
        Plot[Evaluate[{V[t], T[t] + V[t]}], {t, 0, tMax}, &#xD;
         Filling -&amp;gt; {2 -&amp;gt; {1}, 1 -&amp;gt; Bottom}, PlotLabel -&amp;gt; &amp;#034;Energy&amp;#034;, &#xD;
         PlotLegends -&amp;gt; Placed[{&amp;#034;Potential&amp;#034;, &amp;#034;Total&amp;#034;}, Bottom], &#xD;
         AxesLabel -&amp;gt; {&amp;#034;t&amp;#034;, &amp;#034;&amp;#034;}, &#xD;
         Epilog -&amp;gt; {AbsoluteThickness[.75], &#xD;
           Line[{{time, -10000}, {time, 10000}}]}],&#xD;
        Graphics[{(*support*){FaceForm[Yellow], EdgeForm[Black], &#xD;
           Triangle[{pivot, 10 {-.035, .045}, 10 {.035, .045}}], Red, &#xD;
           Disk[pivot, .01]},&#xD;
          (*floor*), {Brown, AbsoluteThickness[4], &#xD;
           Line[{{-10, -L - a}, {10, -L - a}}]}, &#xD;
          Point[{pivot, seat, hipPivot}], &#xD;
          Line[{pivot, hip}], {Directive[Blue, AbsoluteThickness[.5]], &#xD;
           trace}, {DotDashed, Line[{pivot, seat}]}, {Blue, &#xD;
           Line[{hipPivot, hip}]}, {Red, AbsolutePointSize[7], Point@hip, &#xD;
           White, Disk[hip, .025]}, &#xD;
          ParametricPlot[&#xD;
            Evaluate[{xh[t], yh[t]} /. sol], {t, 0, time + .001}, &#xD;
            PlotStyle -&amp;gt; Directive[Red, AbsoluteThickness[.75]]][[1]]}, &#xD;
         PlotRange -&amp;gt; 12, Axes -&amp;gt; True]}]], {time, 0, 15.5, .25}]&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
**Adding a rider**&#xD;
&#xD;
I designed a simplified rider figure with the hip position at the center of gravity and fixed points where the foot is on the seat and the grip of the hand is on the front rod. This figure can then simply be fitted into the previous code to make a working and more realistic  model.&#xD;
&#xD;
    kidNSwing[hip : {hx_, hy_}] :=&#xD;
     &#xD;
     With[{pivot = {0, 0}, L = 10, seat = .75, head = .45, grip = 2.5, &#xD;
       leg = 1.55, thigh = 1.4, trunk = 1.5, arm1 = 1.25, arm2 = 1.2}, &#xD;
      Module[{(*joints*)ptF, ptB, ptT, ptS, ptK, ptP, ptN, ptE, ptH, &#xD;
        ptD},&#xD;
       ptT = {-.2, -L}; ptS = {0, -L + .085}; ptF = {-seat, -L}; &#xD;
       ptB = {seat, -L}; ptK = findTop[ptS, hip, leg, thigh];&#xD;
       ptH = AngleVector[{(L - grip), -1.6458}];&#xD;
       ptN = First@&#xD;
         Nearest[{x, y} /. &#xD;
           Solve[{x, y} \[Element] Line[{ptS, pivot}] &amp;amp;&amp;amp; &#xD;
             EuclideanDistance[{x, y}, hip] == trunk + .1, {x, y}], pivot];&#xD;
       ptE = findTop[ptN, ptH, arm2, arm2];&#xD;
       ptD = First@&#xD;
         Nearest[{x, y} /. &#xD;
           Solve[{x, y} \[Element] Line[{ptN, pivot}] &amp;amp;&amp;amp; &#xD;
             EuclideanDistance[{x, y}, hip] == trunk + head + .175, {x, &#xD;
             y}], pivot];&#xD;
       {(*seat*){AbsoluteThickness[6], Gray, Line[{ptF, ptB}]},&#xD;
        (*rods*){AbsoluteThickness[.9], &#xD;
         Line[{ptF, {0, 0}, ptB}]}, {PointSize[.01], Point[hip]},&#xD;
        (*trunk &amp;amp; limbs*) {FaceForm[Lighter[Red, .8]], &#xD;
         EdgeForm[AbsoluteThickness[1]],&#xD;
         StadiumShape[#, .125] &amp;amp; /@ &#xD;
          Partition[{ptT, ptS, ptK, hip, ptN, ptE, ptH}, 2, 1] },&#xD;
        (*joints*){Disk[#, .12] &amp;amp; /@ {ptT, ptS, ptK,(*hip,*)ptN, ptE, &#xD;
           ptH}, White, &#xD;
         Disk[#, .065] &amp;amp; /@ {hip, ptT, ptS, ptK,(*hip,*)ptN, ptE, ptH}},&#xD;
        (*head*){Darker[Gray, .35], &#xD;
         Disk[ptD, head, {176 \[Degree], -154 \[Degree]}],(*eye*)White, &#xD;
         Disk[ptD, .075]}}]] &#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
**Full model to Optimize your Swing ride**&#xD;
&#xD;
The equation of motion is then introduced in a Manipulate. This lets the user experiment with a simple model of the swing and rider system to explore the conditions for an optimized swing ride . The parameters of the hip (CM) displacement and the initial conditions (angular position and speed) can be adjusted. The energy level graph on top lets the user see where the maximum energy level occurs and try do move this as much as possible to the start of the ride.&#xD;
&#xD;
    Manipulate[With[{mk = 50, g = 9.81, pivot = {0, 0}, L = 10},&#xD;
      Module[{deqn, crouch, xh, yh, sol, \[Phi], V, T, hipPivot, hip, &#xD;
        trace}, time = Min[tMax, time];&#xD;
       \[Phi][t_] := \[Omega] t + \[Phi]0; &#xD;
       crouch[t_] := {b Sin[\[Phi][t]], -L + r + a Cos[\[Phi][t]]};&#xD;
       xh[t_] := &#xD;
        b Cos[\[Theta][t]] Sin[\[Phi]0 + t \[Omega]] + (L - r - &#xD;
            a Cos[\[Phi]0 + t \[Omega]]) Sin[\[Theta][t]];&#xD;
       yh[t_] := (-L + r + a Cos[\[Phi]0 + t \[Omega]]) Cos[\[Theta][t]] +&#xD;
          b Sin[\[Phi]0 + t \[Omega]] Sin[\[Theta][t]];&#xD;
       deqn = &#xD;
        2 b ((-L + r) \[Omega]^2 + g Cos[\[Theta][t]]) Sin[\[Phi]0 + &#xD;
             t \[Omega]] + &#xD;
          4 \[Omega] (a (L - r) + (-a^2 + b^2) Cos[\[Phi]0 + &#xD;
                t \[Omega]]) Sin[\[Phi]0 + t \[Omega]] Derivative[&#xD;
            1][\[Theta]][&#xD;
            t] + (a^2 + b^2 + 2 (L - r)^2 + &#xD;
             4 a (-L + r) Cos[\[Phi]0 + t \[Omega]] + (a - b) (a + b) Cos[&#xD;
               2 (\[Phi]0 + t \[Omega])]) (\[Theta]^\[Prime]\[Prime])[&#xD;
            t] == 2 g (-L + r + a Cos[\[Phi]0 + t \[Omega]]) Sin[\[Theta][&#xD;
            t]];&#xD;
       sol = First@&#xD;
         NDSolve[{deqn, \[Theta][0] == \[Theta]0, \[Theta]&amp;#039;[&#xD;
             0] == \[Theta]00}, \[Theta], {t, 0, tMax}];&#xD;
       hip[t_] := {xh[t], yh[t]} /. sol;&#xD;
       hipPivot = (L - r) {Sin[\[Theta][time]], -Cos[\[Theta][time]]} /. &#xD;
         sol;&#xD;
       trace[t_] := Rotate[Circle[hipPivot, {b, a}], \[Theta][t]];&#xD;
       T[t_] := Evaluate[.5 mk (xh&amp;#039;[t]^2 + yh&amp;#039;[t]^2)] /. sol; &#xD;
       V[t_] := mk g yh[t] /. sol;&#xD;
       Column[{&#xD;
         Plot[Evaluate[{V[t], T[t] + V[t]}], {t, 0, tMax}, &#xD;
          Filling -&amp;gt; {2 -&amp;gt; {1}, 1 -&amp;gt; Bottom}, PlotLabel -&amp;gt; &amp;#034;Energy&amp;#034;, &#xD;
          PlotLegends -&amp;gt; Placed[{&amp;#034;Potential&amp;#034;, &amp;#034;Total&amp;#034;}, Bottom], &#xD;
          AxesLabel -&amp;gt; {&amp;#034;t&amp;#034;, &amp;#034;&amp;#034;}, AxesStyle -&amp;gt; 7, &#xD;
          Epilog -&amp;gt; {AbsoluteThickness[.75], &#xD;
            Line[{{time, -1*^6}, {time, 1*^6}}]}, ImageSize -&amp;gt; 400, &#xD;
          AspectRatio -&amp;gt; .3],&#xD;
         Graphics[{&#xD;
           {FaceForm[Yellow], EdgeForm[Black], &#xD;
            Triangle[{pivot, {-.35, .45}, {.35, .45}}], Red, &#xD;
            Disk[pivot, .15]},&#xD;
           (*floor*), {Brown, AbsoluteThickness[4], &#xD;
            Line[{{-20, -L - 1}, {20, -L - 1}}]},&#xD;
           ParametricPlot[&#xD;
             hip[t] /. sol, {t, 0, If[sdt, tMax, time + .01]}, &#xD;
             PerformanceGoal -&amp;gt; &amp;#034;Quality&amp;#034;, &#xD;
             PlotStyle -&amp;gt; Directive[AbsoluteThickness[.45], Red], &#xD;
             PlotPoints -&amp;gt; 10][[1]],&#xD;
           Rotate[kidNSwing[crouch[time]], \[Theta][time], pivot] /. sol,&#xD;
           If[&#xD;
            sht, {Directive[Dashed, Blue, AbsoluteThickness[1.5]], &#xD;
             trace[time] /. sol}, Nothing]},&#xD;
          Background -&amp;gt; Lighter[Gray, 0.8],&#xD;
          Axes -&amp;gt; True, Frame -&amp;gt; True, FrameTicks -&amp;gt; None, &#xD;
          PlotRange -&amp;gt; 1.1 {{-L, L}, {-L - .1, L}}, &#xD;
          ImageSize -&amp;gt; 400]}]]],&#xD;
     Style[&amp;#034;animation&amp;#034;, Bold, 10],&#xD;
     {{time, 0.}, 0., tMax, .001, ImageSize -&amp;gt; Tiny, &#xD;
      Appearance -&amp;gt; &amp;#034;Labeled&amp;#034;}, Delimiter,&#xD;
     Style[&amp;#034;swinging&amp;#034;, Bold, 10],&#xD;
     &amp;#034;initial angular position kid&amp;#034;, {{\[Theta]0, 1.31}, -1.57, &#xD;
      1.57, .001, ImageSize -&amp;gt; Tiny, Appearance -&amp;gt; &amp;#034;Labeled&amp;#034;},&#xD;
     &amp;#034;initial angular speed&amp;#034;,&#xD;
     {{\[Theta]00, 0}, -6, 6, .0001, ImageSize -&amp;gt; Tiny, &#xD;
      Appearance -&amp;gt; &amp;#034;Labeled&amp;#034;}, Delimiter,&#xD;
     Style[&amp;#034;crouching&amp;#034;, Bold, 10],&#xD;
     &amp;#034;major axis a (in line with swing rods)&amp;#034;, {{a, .75}, 0., 2, .001, &#xD;
      ImageSize -&amp;gt; Tiny, Appearance -&amp;gt; &amp;#034;Labeled&amp;#034;},&#xD;
     &amp;#034;minor axis b (perpendicular to swing rods)&amp;#034;, {{b, .274}, 0., &#xD;
      2, .001, ImageSize -&amp;gt; Tiny, Appearance -&amp;gt; &amp;#034;Labeled&amp;#034;},&#xD;
     &amp;#034;frequency&amp;#034;,&#xD;
     {{\[Omega], 1.904}, -5, 5, .001, ImageSize -&amp;gt; Tiny, &#xD;
      Appearance -&amp;gt; &amp;#034;Labeled&amp;#034;},&#xD;
     &amp;#034;angular offset&amp;#034;,&#xD;
     {{\[Phi]0, 0}, -1.57, 1.57, .0001, ImageSize -&amp;gt; Tiny, &#xD;
      Appearance -&amp;gt; &amp;#034;Labeled&amp;#034;}, Delimiter,&#xD;
     &amp;#034;hip vertical offset&amp;#034;,&#xD;
     {{r, 1.6722}, 0, 2.5, .0001, ImageSize -&amp;gt; Tiny, &#xD;
      Appearance -&amp;gt; &amp;#034;Labeled&amp;#034;}, Delimiter,&#xD;
     Row[{&amp;#034;show full dynamic trace&amp;#034;, &#xD;
       Control[{{sdt, False, &amp;#034;&amp;#034;}, {True, False}}]}],&#xD;
     Row[{&amp;#034;show static trace&amp;#034;, &#xD;
       Control[{{sht, False, &amp;#034;&amp;#034;}, {True, False}}]}],&#xD;
     {{tMax, 30, &amp;#034;total time&amp;#034;}, None}, TrackedSymbols :&amp;gt; True, &#xD;
     ControlPlacement -&amp;gt; Left]&#xD;
&#xD;
![enter image description here][8]&#xD;
&#xD;
After some experimenting, one can easily derive some conclusions:&#xD;
&#xD;
1. the most important effect is to synchronize the crouching (\[Phi]) with the swinging (\[Theta]). Best results are achieved if the crouching frequency (\[Omega]) is double the swing frequency.&#xD;
&#xD;
2. up and down crouching (a is the crouching path&amp;#039;s semimajor axis in line with swing rods) has more effect than forward- backward leaning (b is the crouching path&amp;#039;s semi-minor axis perpendicular to swing rods)&#xD;
&#xD;
**Some Favorite Rides**&#xD;
&#xD;
1. A start from absolute standstill and zero position. Only the hip movement is in action here and is enough to add energy to the system.&#xD;
&#xD;
        &amp;#034;zero start-1&amp;#034; :&amp;gt; {a = 0.75, b = 0.75, &#xD;
          r = 1.6722, \[Theta]00 = 0, \[Theta]0 = 0, \[Phi]0 = &#xD;
           0.253, \[Omega] = 1}&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
2. This example also has zero initial speed and position but the crouching is synchronized in a nearly optimal way (\[Omega]= approximately 2), resulting in a spectacular swing over the top (we have rigid rods, no ropes or chains!).&#xD;
&#xD;
        &amp;#034;zero start-2&amp;#034; :&amp;gt; {a = 1.2, b = 0, &#xD;
          r = 1.6722, \[Theta]00 = 0, \[Theta]0 = 0.785, \[Phi]0 = &#xD;
           0.4664, \[Omega] = 1.994}&#xD;
&#xD;
![enter image description here][10]&#xD;
&#xD;
3. Other relations of crouching to swinging can result in some nice periodic rides.&#xD;
&#xD;
        &amp;#034;oval track&amp;#034; :&amp;gt; {a = 0.75, b = 0, &#xD;
          r = 0.8, \[Theta]00 = 0.0714, \[Theta]0 = &#xD;
           1.265, \[Phi]0 = -0.2527, \[Omega] = 3.74}&#xD;
&#xD;
&#xD;
![enter image description here][11]&#xD;
&#xD;
Experiment freely with the previous Manipulate and get as much fun as I did with this simple model of something we are all familiar with.&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=zerostart-6.gif&amp;amp;userId=68637&#xD;
  [2]: https://demonstrations.wolfram.com/PendulumWithVaryingLengthOrHowToImproveYourNextSwingRide/&#xD;
  [3]: https://pdfs.semanticscholar.org/9b19/8d284aee700cc35c2faae5683ff5e6fba66d.pdf&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=5490dynamicgeometry.gif&amp;amp;userId=68637&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1981eqnofmotion.png&amp;amp;userId=68637&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2550modelwokid.gif&amp;amp;userId=68637&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=8117kidNswingcombi.gif&amp;amp;userId=68637&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ezgif.com-resize.png&amp;amp;userId=68637&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=8451zerostart-1.gif&amp;amp;userId=68637&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=zerostart-4.gif&amp;amp;userId=68637&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=zerostart-5.gif&amp;amp;userId=68637</description>
    <dc:creator>Erik Mahieu</dc:creator>
    <dc:date>2020-09-29T12:38:26Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1610701">
    <title>Amazing comparison (700+ pages!) of PDE solving. There&amp;#039;s a gap to be filled</title>
    <link>https://community.wolfram.com/groups/-/m/t/1610701</link>
    <description>On   February 11, Nasser M. Abbasi compiled a  [huge report][1] about PDE solving with&#xD;
[Mathematica 11.3 and a recent (2018 version) of another major CAS system][2] , listing some of the PDE  textbooks consulted (strangely no one among Evans, Farlow, Strauss, Sauvigny, Taylor is included).&#xD;
&#xD;
According to the [results][3] and to the [table of results][4] ,&#xD;
Mathematica is dramaticaly behind its competitor and the knowledge of PDE by both the system seem very limited, compared to results one can find in a textbook.&#xD;
&#xD;
To be noticed, if you look at his [page][5] , Abbasi seems to use more Mathematica than the competitor. &#xD;
&#xD;
Let&amp;#039;s hope that researchers at Wolfram will implement a **better knowledge of PDE into Mathematica**,   rather than spreading their efforts on all those (some of them kind of bizarre) fields : not just to fill the gap with its competitor, but **because PDE is a very crucial MATHEMATICAL topic**.&#xD;
&#xD;
&#xD;
  [1]: https://www.12000.org/my_notes/pde_in_CAS/pde_in_cas_legal.pdf&#xD;
  [2]: https://www.12000.org/my_notes/pde_in_CAS/pdse1.htm&#xD;
  [3]: https://www.12000.org/my_notes/pde_in_CAS/pdse2.htm&#xD;
  [4]: https://www.12000.org/my_notes/pde_in_CAS/pdse3.htm&#xD;
  [5]: https://www.12000.org/index.htm</description>
    <dc:creator>Camila Garcia</dc:creator>
    <dc:date>2019-02-11T19:48:19Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/515162">
    <title>[GiF] Flight of Badminton Shuttlecocks</title>
    <link>https://community.wolfram.com/groups/-/m/t/515162</link>
    <description>**See attached notebook for details**. A [shuttlecock][1] (previously called Shuttlecork) (also called a bird or birdie) is a high-drag projectile used in the sport of badminton. It has an open conical shape: the cone is formed from 16 or so overlapping feathers, usually goose or duck, embedded into a rounded cork base. The cork is covered with thin leather. The shuttlecock&amp;#039;s shape makes it extremely aerodynamically stable. Regardless of initial orientation, it will turn to fly cork first, and remain in the cork-first orientation. &#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
*Image courtesy of IOP Science*&#xD;
&#xD;
The name shuttlecock is frequently shortened to shuttle. The &amp;#034;shuttle&amp;#034; part of the name was probably derived from its back-and-forth motion during the game, resembling the shuttle of a loom; the &amp;#034;cock&amp;#034; part of the name was probably derived from the resemblance of the feathers to those on a cockerel.&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
**The code with NDSolveValue is attached**. Here is the resulting simulation of the flight of badminton shuttlecocks:&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][6]&#xD;
&#xD;
&amp;gt; [References][7]&#xD;
&#xD;
&#xD;
  [1]: https://en.wikipedia.org/?title=Shuttlecock&#xD;
  [2]: /c/portal/getImageAttachment?filename=sdf54wyehfgsd54qt.png&amp;amp;userId=11733&#xD;
  [3]: /c/portal/getImageAttachment?filename=sz.png&amp;amp;userId=476423&#xD;
  [4]: /c/portal/getImageAttachment?filename=ssdf3544ytjkjghd.gif&amp;amp;userId=11733&#xD;
  [5]: /c/portal/getImageAttachment?filename=1523Anim.gif&amp;amp;userId=476423&#xD;
  [6]: https://www.wolframcloud.com/obj/ff04670b-b2e3-4281-86a5-0cbb60e61592&#xD;
  [7]: http://iopscience.iop.org/1367-2630/17/6/063001/article</description>
    <dc:creator>Mariusz Iwaniuk</dc:creator>
    <dc:date>2015-06-18T14:56:37Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1330785">
    <title>Playing with Gilpin&amp;#039;s Proposal for Advection-based Cryptographic Hashing</title>
    <link>https://community.wolfram.com/groups/-/m/t/1330785</link>
    <description>*WOLFRAM MATERIALS for the ARTICLE:*&#xD;
&#xD;
&amp;gt; William Gilpin. *Cryptographic hashing using chaotic hydrodynamics*.&#xD;
&#xD;
&amp;gt; Proceedings of the National Academy of Sciences, 115 (19) (2018), pp. 4869-4874.&#xD;
&#xD;
&amp;gt; https://doi.org/10.1073/pnas.1721852115&#xD;
&#xD;
&amp;gt; [Full article in PDF][1]&#xD;
&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
##Introduction##&#xD;
&#xD;
Last week, William Gilpin published a fascinating paper suggesting a physics-based hashing mechanism in the Proceedings of the National Society: Cryptographic hashing using chaotic hydrodynamics: https://doi.org/10.1073/pnas.1721852115&#xD;
&#xD;
The paper discusses a hashing algorithm based on fluid mechanics: Particles are distributed in a 2D disk. The inside of the disk is filled with an idealized fluid and the fluid is now stirred with a single stirrer. The stirring process is modelled with two possible stirrer positions. A message (say made from 0s and 1s) can now be encoded through which of the two stirrer positions is active. If the bit from the message is 1, use stirrer position 1, if the bit of the message is 0, use stirrer position 2. After some bites are processed, and the fluid is stirred, this process mixes the particles. Dropping some of the information content of the actual particle positions, e.g. by taking only the x-positions of the particle positions allows to build a hash by using the particle indices after sorting the particles along the x-axis.&#xD;
&#xD;
The Methods section of the paper mentions that all calculations were carried out using Mathematica 11.0. Unfortunately no notebook supplement was given. So,  playing around with ideas of the paper, I re-implemented some of the computations of the paper.&#xD;
&#xD;
The paper is behind a paywall, but fortunately the author&amp;#039;s website has a downloadable copy of the paper [here][3].&#xD;
&#xD;
The potential importance of physics-based models for hashing, and so for cryptocurrencies was pointed out at various sites (e.g. [Stanford News][4], [btcmanager][5]).&#xD;
&#xD;
It is fun to play around with the model.&#xD;
&#xD;
##The chaotic advection model model##&#xD;
&#xD;
This classic model goes back to Hassan Aref  (whom I was fortunate to know personally) from his 1984 paper [Stirring by chaotic advection][6].&#xD;
&#xD;
The Hamiltonian for the movement of a particle with coordinates {ξ,η} in a circle of radius a under the influence of agitating vortex at {x,y} (possibly time-dependent) of strength Γ and its mirror vortex.&#xD;
&#xD;
        H[{ξ_, η_}, {x_, y_}] = &#xD;
          Γ/(2 π) Log[ComplexExpand[ Abs[((ξ + I η) - (x + I y))/((ξ + I η) - a^2/( x - I y))]] ]&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
 The resulting equations of motion:&#xD;
&#xD;
    odes = {ξ&amp;#039;[t] == -D[H[{ξ[t], η[t]}, {x[t], y[t]}], η[t]],&#xD;
                η&amp;#039;[ t] == +D[H[{ξ[t], η[t]}, {x[t], y[t]}], ξ[t]]} // Simplify&#xD;
![enter image description here][8]&#xD;
&#xD;
Solve the equations of motion for randomly selected parameters and plot the particle trajectory. For a position-independent and time-independent vortex, the particle moves in a circle.&#xD;
&#xD;
    nds = NDSolveValue[{&#xD;
       Block[{a = 1, Γ = 1, x = 0.5 &amp;amp;, y = 0 &amp;amp;}, odes],&#xD;
                     ξ[0] == 0.3, η[0] == -0.4}, {ξ[t], η[t]}, {t, 0, 10}]&#xD;
![enter image description here][9]&#xD;
&#xD;
    ParametricPlot[Evaluate[nds], {t, 0, 10}]&#xD;
&#xD;
![enter image description here][10]&#xD;
&#xD;
Here the vortex moves around in a periodic manner. The resulting particle trajectory has a high degree of symmetry.&#xD;
&#xD;
    nds2 = NDSolveValue[{&#xD;
       Block[{a = 1, Γ = 1, x = 0.8 Cos[2 Pi #/200] &amp;amp;, y = 0.8 Sin[2 Pi #/200] &amp;amp;}, odes],&#xD;
                     ξ[0] == 0.3, η[0] == -0.4}, {ξ[t], η[t]}, {t, 0, 400}]&#xD;
&#xD;
![enter image description here][11]&#xD;
&#xD;
    ParametricPlot[Evaluate[nds2], {t, 0, 400}, PlotPoints -&amp;gt; 400]&#xD;
&#xD;
![enter image description here][12]&#xD;
&#xD;
Letting the vortex move along  a random curve results in a chaotic movement of the particle. We color the particle&amp;#039;s trajectory with time.&#xD;
&#xD;
    (* vortex movement curve *)&#xD;
    randomCurve = BSplineFunction[RandomPoint[Disk[], {100}]]; &#xD;
    &#xD;
    X[t_Real] := randomCurve[t/100][[1]]&#xD;
    Y[t_Real] := randomCurve[t/100][[2]]&#xD;
&#xD;
    nds2 = NDSolveValue[{&#xD;
       Block[{a = 1, Γ = 10, x = X, y = Y}, odes],&#xD;
                     ξ[0] == 0.3, η[0] == -0.4}, {ξ[t], η[t]}, {t, 0, 100}]&#xD;
&#xD;
![enter image description here][13]&#xD;
&#xD;
    ParametricPlot[Evaluate[nds2], {t, 0, 100}, PlotPoints -&amp;gt; 1000, &#xD;
     ColorFunction -&amp;gt; Function[{x, y, u}, ColorData[&amp;#034;DarkRainbow&amp;#034;][u]]]&#xD;
&#xD;
![enter image description here][14]&#xD;
&#xD;
Having two possible positions of the vortex and switching periodically between them results in a particle trajectory that is made of piecewise circle arcs.&#xD;
&#xD;
    nds2 = NDSolveValue[{&#xD;
        Block[{a = 1, Γ = 10, x = Sign[Sin[Pi #]]/2 &amp;amp;, y = 0 &amp;amp;}, odes],&#xD;
                      ξ[0] == 2/3, η[0] == 0}, {ξ[t], η[t]}, {t, 0, 100}];&#xD;
    &#xD;
    ParametricPlot[Evaluate[nds2], {t, 0, 100}, PlotPoints -&amp;gt; 1000, &#xD;
     ColorFunction -&amp;gt; Function[{x, y, u}, ColorData[&amp;#034;DarkRainbow&amp;#034;][u]]]&#xD;
&#xD;
![enter image description here][15]&#xD;
&#xD;
Using initially 4320 points on a circle shows how the initial circle gets stretched and ripped apart and the points distribute chaotically over the disk.&#xD;
&#xD;
    nds2 = NDSolveValue[{&#xD;
        Block[{a = 1, Γ = 10, x = Sign[Sin[Pi #]]/2 &amp;amp;, y = 0 &amp;amp;}, odes],&#xD;
                      ξ[0] == Table[2/3 Cos[φ], {φ, 0, 2 Pi, 2 Pi/(12 360)}], &#xD;
                      η[0] == Table[2/3 Sin[φ], {φ, 0, 2 Pi, 2 Pi/(12 360)}]},&#xD;
       {ξ[t], η[t]}, {t, 0, 2}];&#xD;
    &#xD;
    GraphicsGrid[&#xD;
     Partition[Graphics[{LightGray, Disk[], Black, PointSize[0.005], &#xD;
          Point[Transpose[nds2 /. t -&amp;gt; #]]}, ImageSize -&amp;gt; 120] &amp;amp; /@Range[0, 2, 2/19] , 5]]&#xD;
![enter image description here][16]&#xD;
&#xD;
With time running upwards, here is a 3D image of this stirring process. The transition from using the right stirrer to using the left stirrer at time 1 is clearly visible.&#xD;
&#xD;
    trajectories3D = &#xD;
      Transpose[Table[ Append[#, N[τ]] &amp;amp; /@ Transpose[nds2 /. t -&amp;gt; τ], {τ, 0, 2, 2/100}]];&#xD;
    &#xD;
    Graphics3D[{Thickness[0.001], Opacity[0.2], &#xD;
      BSplineCurve /@ RandomSample[trajectories3D, 1600]},&#xD;
                              PlotRange -&amp;gt; All, Axes -&amp;gt; True, BoxRatios -&amp;gt; {1, 1, 2}]&#xD;
&#xD;
![enter image description here][17]&#xD;
&#xD;
Here is the corresponding interactive demonstration.&#xD;
&#xD;
    Manipulate[&#xD;
    Graphics[{LightGray, Disk[], Black, PointSize[0.005], Point[Transpose[nds2 /. t -&amp;gt; τ]]}], &#xD;
    {τ, 0, 2, Appearance -&amp;gt; &amp;#034;Labeled&amp;#034;}]&#xD;
&#xD;
![enter image description here][18]&#xD;
&#xD;
The x-position of the particles will be used later. Here is a plot of the x-positions of 540 points initially on a circle over time.One observes many crossing of these x-trajectories.&#xD;
&#xD;
    nds2B = NDSolveValue[{&#xD;
        Block[{a = 1, Γ = 4, x = Sign[Sin[Pi #]]/2 &amp;amp;, y = 0 &amp;amp;}, odes],&#xD;
                      ξ[0] == Table[2/3 Cos[φ], {φ, 0, 2 Pi, 2 Pi/540}], &#xD;
                      η[0] == Table[2/3 Sin[φ], {φ, 0, 2 Pi, 2 Pi/540}]},&#xD;
       {ξ[t], η[t]}, {t, 0, 12}];&#xD;
    &#xD;
    ListLinePlot[Transpose[Table[{t, #} &amp;amp; /@ nds2B[[1]], {t, 0., 4, 4/200}] ], &#xD;
     PlotStyle -&amp;gt; Table[Directive[Opacity[0.4], Thickness[0.001], ColorData[&amp;#034;DarkRainbow&amp;#034;][j/541]], {j, 541}],&#xD;
     Frame -&amp;gt; True, Axes -&amp;gt; False, FrameLabel -&amp;gt; {t, x}]&#xD;
&#xD;
![enter image description here][19]&#xD;
&#xD;
Using a Dynamic[particleGraphics] we can easily model many more particles in real time without having to store large interpolating functions. We solve the the equations of motion over small time increments and the graphic updates dynamically.&#xD;
&#xD;
    rPoints = Select[Flatten[Table[N[{x, y}], {x, -1, 1, 2/101}, {y, -1, 1, 2/101}], 1], Norm[#] &amp;lt; 1 &amp;amp;]; &#xD;
    &#xD;
    Dynamic[Graphics[{LightGray, Disk[], Black, PointSize[0.001], Point[rPoints]}]]&#xD;
&#xD;
![enter image description here][20]&#xD;
&#xD;
    rhsξ[X_, ξ_List, η_List] := With[{ Γ = 5}, -(((1 - X^2) Γ η (1 + X^2 - 2 X ξ))/(2 π (X^2 + η^2 - 2 X ξ + ξ^2) (1 - 2 X ξ + X^2 (η^2 + ξ^2))))]&#xD;
    rhsη[X_, ξ_List, η_List] := With[{ Γ =  5}, -(((1 - X^2) Γ (-ξ - X^2 ξ +  X (1 - η^2 + ξ^2)))/(2 π (X^2 + η^2 - 2 X ξ + ξ^2) (1 - 2 X ξ + X^2 (η^2 + ξ^2))))]&#xD;
    &#xD;
    With[{Δt = 10^-2, T = 0.2},&#xD;
     Monitor[&#xD;
      Do[&#xD;
       nds = NDSolveValue[&#xD;
          Block[{ X = Evaluate[1/2 Sign[Sin[Pi (k + 1/2) Δt/T]]] &amp;amp;},&#xD;
                   {ξ&amp;#039;[t] == rhsξ[t, ξ[t], η[t]], η&amp;#039;[t] == rhsη[t, ξ[t], η[t]],&#xD;
                    ξ[k Δt] == Transpose[rPoints][[1]], &#xD;
                    η[k Δt] == Transpose[rPoints][[2]]}],&#xD;
          {ξ[t], η[t]}, {t, (k + 1) Δt, (k + 1) Δt}] /. t -&amp;gt; (k + 1) Δt;&#xD;
       rPoints = Transpose[nds],&#xD;
       {k, 0, 200}], k]]&#xD;
&#xD;
Switching irregularly between the two stirrer positions gives qualitatively similar-looking trajectories. We use a sum of three trig functions see here for a detailed account on this type of function).&#xD;
&#xD;
    (* left or right stirrer is on *)&#xD;
    Plot[Sign[Sin[Pi t] + Sin[Pi Sqrt[2] t] + Sin[Pi Sqrt[3] t]], {t, 0, 100}, Exclusions -&amp;gt; None]&#xD;
&#xD;
![enter image description here][21]&#xD;
&#xD;
    nds3 = NDSolveValue[{&#xD;
        Block[{a = 1, Γ = 10, &#xD;
          x = Sign[Sin[Pi #] + Sin[Pi Sqrt[2] #] + Sin[Pi Sqrt[3] #]]/2 &amp;amp;, &#xD;
          y = 0 &amp;amp;}, odes],    ξ[0] == 2/3, η[0] == 0}, {ξ[t], η[t]}, {t, 0, 100}];&#xD;
    &#xD;
    ParametricPlot[Evaluate[nds3], {t, 0, 100}, PlotPoints -&amp;gt; 1000, &#xD;
     ColorFunction -&amp;gt; Function[{x, y, u}, ColorData[&amp;#034;DarkRainbow&amp;#034;][u]]]&#xD;
![enter image description here][22]&#xD;
&#xD;
We can also change the stirring direction.&#xD;
&#xD;
    nds3B = NDSolveValue[{&#xD;
        Block[{a = 1, Γ = 10 Sign[Sin[Pi t] + Sin[Pi Sqrt[2] t] + Sin[Pi Sqrt[3] t]],&#xD;
          x = Sign[Sin[Pi #] + Sin[Pi Sqrt[2] #] + Sin[Pi Sqrt[3] #]]/2 &amp;amp;, &#xD;
          y = 0 &amp;amp;}, odes],    ξ[0] == 2/3, η[0] == 0}, {ξ[t], η[&#xD;
         t]}, {t, 0, 100}];&#xD;
    &#xD;
    ParametricPlot[Evaluate[nds3B], {t, 0, 100}, PlotPoints -&amp;gt; 1000, &#xD;
     ColorFunction -&amp;gt; Function[{x, y, u}, ColorData[&amp;#034;DarkRainbow&amp;#034;][u]]]&#xD;
&#xD;
![enter image description here][23]&#xD;
&#xD;
Here are three stirrer positions at the vertices of an equilateral triangle.&#xD;
&#xD;
    st3[t_] = Piecewise[&#xD;
       With[{r = RandomInteger[{0, 2}]}, {1/2. {Cos[2 Pi r/3], Sin[2 Pi r/3]}, #[[1]] &amp;lt;= t &amp;lt;= #[[2]] }] &amp;amp; /@ &#xD;
        Partition[FoldList[Plus, 0, RandomReal[{0, 1}, 300]], 2, 1]];&#xD;
    &#xD;
    x3[t_Real] := st3[t][[1]]&#xD;
    y3[t_Real] := st3[t][[2]]&#xD;
    &#xD;
    nds3 = NDSolveValue[{ Block[{a = 1, Γ = 5, x = x3, y = y3}, odes], ξ[0] == 1/3, η[0] == 0}, {ξ[t], η[t]}, {t, 0, 100}]&#xD;
&#xD;
![enter image description here][24]&#xD;
&#xD;
    ParametricPlot[Evaluate[nds3], {t, 0, 100}, PlotPoints -&amp;gt; 1000, &#xD;
     ColorFunction -&amp;gt; Function[{x, y, u}, ColorData[&amp;#034;DarkRainbow&amp;#034;][u]]]&#xD;
&#xD;
![enter image description here][25]&#xD;
&#xD;
##Side note: the linked twist map##&#xD;
&#xD;
Mathematically, alternating left and right use of the stirrer, is isomorphic to a so-called linked twist map. The following implements a simple realization of a linked twist map from Cairns /Kolganova.  https://doi.org/10.1088/0951-7715/9/4/011&#xD;
&#xD;
    Clear[g, h, f]; &#xD;
    g[{x_, y_}] := {x, Mod[Piecewise[{{y + 4 x, Abs[x] &amp;lt;= 1/4}}, y], 1, -1/2]}&#xD;
    h[{x_, y_}] := {Mod[Piecewise[{{x + 4 y, Abs[y] &amp;lt;= 1/4}}, x], 1, -1/2], y}&#xD;
    f[{x_, y_}] := g[h[{x, y}]] &#xD;
&#xD;
    f[{x, y}]&#xD;
&#xD;
![enter image description here][26]&#xD;
&#xD;
In explicit piecewise form, the map is more complicated. (To fit it, we use a reduce size.)&#xD;
&#xD;
    (f2 = PiecewiseExpand[# , -1/2 &amp;lt; x &amp;lt; 1/2 &amp;amp;&amp;amp; -1/2 &amp;lt; y &amp;lt; 1/2] &amp;amp; /@ f[{x, y}]) &#xD;
&#xD;
![enter image description here][27]&#xD;
&#xD;
Here are the first and second component visualized.&#xD;
&#xD;
    {ContourPlot[Evaluate[f2[[1]]], {x, -1/2, 1/2} , {y, -1/2, 1/2}, &#xD;
      Exclusions -&amp;gt; {}, PlotPoints -&amp;gt; 60],&#xD;
     ContourPlot[Evaluate[f2[[2]]], {x, -1/2, 1/2} , {y, -1/2, 1/2}, &#xD;
      Exclusions -&amp;gt; {}, PlotPoints -&amp;gt; 60]}&#xD;
&#xD;
![enter image description here][28]&#xD;
&#xD;
Applying the linked twist map to a set of points inside a square hints at the ergodic nature of the map.&#xD;
&#xD;
    ptsRG = With[{pp = 80}, Table[{RGBColor[x + 1/2, y + 1/2, 0.5], Point[{x, y}]}, {y, -1/2, 1/2, 1/pp}, {x, -1/2, 1/2, 1/pp}]];&#xD;
    &#xD;
    Graphics /@ NestList[Function[p, p /. Point[xy_] :&amp;gt; Point[f@xy]], ptsRG, 3]&#xD;
&#xD;
![enter image description here][29]&#xD;
&#xD;
##Closed form mapping##&#xD;
&#xD;
As mentioned, for a fixed stirrer position, a particle moves along a circle. This means that to move the particle to its final position, we don&amp;#039;t have to solve nonlinear differential equations, but rather can calculate the final position through algebraic computations which are unfortunately not fully explicit. Doing the calculations (see Aref&amp;#039;s paper for details) shows that we will have to solve of transcendental equation.&#xD;
&#xD;
In the following we will use a unit disk of radius 1 and a unit strength vortex. The particle is initially at {r,θ} (in polar coordinates) and the stirrer is at {±b,0}.&#xD;
&#xD;
    a = 1;&#xD;
    Γ = 1; &#xD;
&#xD;
The circle the particle is moving on.&#xD;
&#xD;
    circle[{r_, θ_}, b_] :=&#xD;
     Module[{λ, ξc, ρ},&#xD;
      λ = Sqrt[(b^2 + r^2 - 2 b r Cos[θ])/(a^4/b^2 + r^2 - 2 a^2 r Cos[θ]/b)];&#xD;
      ξc = (b - λ^2 a^2/b)/(1 - λ^2);&#xD;
      ρ = Abs[λ/(1 - λ^2) (a^2/b - b)];&#xD;
      Circle[{ξc, 0}, ρ]]&#xD;
&#xD;
 &#xD;
&#xD;
The period for one revolution on the circle.&#xD;
&#xD;
    period[{r_, θ_}, b_, T_] :=  &#xD;
     Module[{λ, ρ, Tλ},&#xD;
      λ = Sqrt[(b^2 + r^2 - 2 b r Cos[θ])/(a^4/b^2 + r^2 - 2 a^2 r Cos[θ]/b)]; &#xD;
      ρ = Abs[λ/(1 - λ^2) (a^2/b - b)]; &#xD;
      Tλ = (2 Pi)^2 ρ^2/Γ (1 + λ^2)/(1 - λ^2) ]&#xD;
&#xD;
The final position after rotating for time T.&#xD;
&#xD;
    rotate[{r_, θ_}, b_, T_, opts___] := &#xD;
    Module[{(*λ,ξc,ρ,θp,Tλ,eq,fr*)},&#xD;
    λ = Sqrt[(b^2 + r^2 - 2 b r Cos[θ])/(a^4/b^2 + r^2 - 2 a^2 r Cos[θ]/b)];&#xD;
    ξc = (b - λ^2 a^2/b)/(1 - λ^2);&#xD;
    ρ = Abs[λ/(1 - λ^2) (a^2/b - b)];&#xD;
    θp = ArcTan[r Cos[θ] - ξc, r Sin[θ]];&#xD;
    Tλ = (2 Pi)^2 ρ^2/Γ (1 + λ^2)/(1 - λ^2);&#xD;
    (* the implicit equation to be solved numerically for θt *)&#xD;
    &#xD;
    eq = θt - 2 λ/(1 + λ^2) Sin[θt] == θp - 2 λ/(1 + λ^2) Sin[θp] + 2 Pi T/Tλ;&#xD;
    fr = FindRoot[eq, {θt, θp}, opts] // Quiet;  (* could use Solve[eq, θt, Reals] *)&#xD;
    {Sqrt[ρ^2 + ξc^2 + 2 ρ ξc Cos[θt]],&#xD;
    ArcTan[ρ Cos[θt] + ξc, ρ Sin[θt]]} /. fr] &#xD;
&#xD;
A high-precision version for later use.&#xD;
&#xD;
     rotateHP[{r_, θ_}, b_, T_ ] :=   &#xD;
     With[{prec = Precision[{r, θ}]}, &#xD;
      rotate[{r, θ}, b, T, WorkingPrecision -&amp;gt; Min[prec, 200] - 1,  PrecisionGoal -&amp;gt; prec - 10]]&#xD;
    &#xD;
    rotateHP[{2/5, 1}, 1/2, 10^-10]&#xD;
&#xD;
    {0.3999999999735895736749310453217879335729586969724148186668989989685300449569453838180010833652353802304511654926113687832716502416432363896855780225351918314742068365263060199921670958293439964299441, &#xD;
    1.000000000034865509829422032384759003150106866109371061507406908121303212377635808764825759934117372434662086592066738925787825280696681907390281734196810440241159138906978471624124765879791828431390}&#xD;
&#xD;
Also for later use, rotate many points at once.&#xD;
&#xD;
    rotate[l : {_List ..}, b_, T_ ] := rotate[#, b, T] &amp;amp; /@ l&#xD;
    &#xD;
    rotateHP[l : {_List ..}, b_, T_ ] := rotateHP[#, b, T] &amp;amp; /@ l&#xD;
&#xD;
The locator is the initial particle position; the stirrer position is the purple point. We show the circle and the final particle position (gray point).&#xD;
&#xD;
    Manipulate[&#xD;
     Graphics[{LightGray, Disk[], &#xD;
       Purple, PointSize[0.02], Point[{b, 0}] , &#xD;
       Gray, circle[ToPolarCoordinates[p], b] ,&#xD;
       PointSize[0.01],&#xD;
       Point[p], Blue , &#xD;
       Point[ FromPolarCoordinates[ rotate @@ SetPrecision[ {ToPolarCoordinates[p], b, T}, 200] ]]}],&#xD;
     {{T, 0.2}, 0.001, 10},&#xD;
     {{b, 0.5}, -0.999, 0.999},&#xD;
     {{p, {0.3, 0.4}}, Locator}]&#xD;
&#xD;
![enter image description here][30]&#xD;
&#xD;
Here is a plot of the period for one revolution as a function of the initial position of the particle. The period can get quite large when points are near the boundary of the disk&#xD;
&#xD;
    ParametricPlot3D[{r Cos[θ], r Sin[θ], period[{r, θ}, 1/2, 1]},&#xD;
     {r, 0, 1}, {θ, -Pi, Pi}, BoxRatios -&amp;gt; {1, 1, 0.3},&#xD;
     PlotPoints -&amp;gt; 40, MeshFunctions -&amp;gt; {#3 &amp;amp;}]&#xD;
&#xD;
![enter image description here][31]&#xD;
&#xD;
For the stirrer located at {0.5,0}, here are the possible circles that the particle will move on.&#xD;
&#xD;
    Graphics[Table[circle[{r, θ}, 1/2.] , {r, 1/10, 9/10, 1/10}, {θ, -Pi, Pi, 2 Pi/20}]]&#xD;
&#xD;
![enter image description here][32]&#xD;
&#xD;
We use the closed form of the stirring map to visualize the flow. Here are about 20k points in stripes in the unit disk.  &#xD;
&#xD;
    stripePoints = Select[RandomPoint[Disk[], 40000], Function[xy, Mod[xy[[1]], 0.2] &amp;lt; 0.1]];&#xD;
    &#xD;
    Graphics[{PointSize[0.002], Point[stripePoints]}]&#xD;
&#xD;
![enter image description here][33]&#xD;
&#xD;
We repeatedly stir with the left and then the right stirrer on for time 1.&#xD;
&#xD;
    swirled[1] = rotate[ToPolarCoordinates[stripePoints], 0.5, 1];&#xD;
    &#xD;
    Graphics[{PointSize[0.002], Point[FromPolarCoordinates[swirled[1]]]}]&#xD;
&#xD;
![enter image description here][34]&#xD;
&#xD;
    swirled[2] = rotate[swirled[1], -0.5, 1];&#xD;
    &#xD;
    Graphics[{PointSize[0.002], Point[FromPolarCoordinates[swirled[2]]]}]&#xD;
&#xD;
![enter image description here][35]&#xD;
&#xD;
    swirled[3] = rotate[swirled[2], 0.5, 1];&#xD;
    &#xD;
    Graphics[{PointSize[0.002], Point[FromPolarCoordinates[swirled[3]]]}]&#xD;
&#xD;
![enter image description here][36]&#xD;
&#xD;
    swirled[4] = rotate[swirled[3], -0.5, 1];&#xD;
    &#xD;
    Graphics[{PointSize[0.002], Point[FromPolarCoordinates[swirled[4]]]}]&#xD;
&#xD;
![enter image description here][37]&#xD;
&#xD;
##Now stir and make hashes##&#xD;
&#xD;
We now use two different initial positions of the points: a sunflower-like one and a random one.&#xD;
&#xD;
    randominitialPositions[n_, prec_] := &#xD;
     SortBy[Table[ReIm[RandomReal[{0, 1}, WorkingPrecision -&amp;gt; prec] *&#xD;
         Exp[ I RandomReal[{-Pi, Pi}, WorkingPrecision -&amp;gt; prec]]], {n}], First]&#xD;
    &#xD;
    SeedRandom[1234];&#xD;
    initialPositionsR = randominitialPositions[100, 250];&#xD;
    &#xD;
    Graphics[{LightGray, Disk[],&#xD;
       MapIndexed[Function[{p, pos},&#xD;
        {Red, PointSize[0.002], Point[p], Black, Text[pos[[1]], p]}],&#xD;
       N[initialPositionsR]]}]&#xD;
&#xD;
![enter image description here][38]&#xD;
&#xD;
    sunflower[n_, R_, prec_] := &#xD;
     Table[FromPolarCoordinates[ N[{Sqrt[j/n] R, Mod[2 Pi (1 - 1/GoldenRatio) j, 2 Pi, -Pi]}, prec]], {j, n}]&#xD;
    &#xD;
    Graphics[{LightGray, Disk[], Black, Point[sunflower[1000, 0.9, 20]]}]&#xD;
![enter image description here][39]&#xD;
&#xD;
The message to encode we will tell in the form of a sequence of 0s and 1s. A zero means use the left stirrer position and a 1 means use the right stirrer position. So, we define a stirring process with a given message σ and fixed b and T as follows:&#xD;
&#xD;
    stirringProcess[initialPositions_, bAbs_, T_, σ_List] := &#xD;
      FromPolarCoordinates /@ &#xD;
      FoldList[rotateHP[#1, #2 bAbs, T] &amp;amp;, ToPolarCoordinates /@ initialPositions, 2 σ - 1] &#xD;
&#xD;
Here is a simple message:&#xD;
&#xD;
    message1 = RandomInteger[{0, 1}, 50]&#xD;
&#xD;
     {1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, &#xD;
       1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1,1, 0, 1, 0}&#xD;
&#xD;
Now we carry out the corresponding stirring process. (We arbitrarily use b=1/2 and T=1/10.)&#xD;
&#xD;
    sP1 = stirringProcess[initialPositionsR, 1/2, 1/10, message1];&#xD;
&#xD;
To get a feeling for the stirring process, we connect successive positions of each particle with a randomly colored spline interpolation. (Note that the spline interpolation does not exactly represent the particle&amp;#039;s trajectory.)&#xD;
&#xD;
    Graphics[{LightGray, Disk[], Thickness[0.001], &#xD;
      Map[Function[c, {RandomColor[], BSplineCurve[c, SplineDegree -&amp;gt; 5]}], &#xD;
       Transpose[N[Table[sP1[[j]], {j, 50}]]]]}]&#xD;
![enter image description here][40]&#xD;
&#xD;
Now, can we trust these results? We can check by running the stirring process (numerically) backwards.&#xD;
&#xD;
    sP1Rev = stirringProcess[sP1[[-1]], 1/2, -1/10, Reverse[message1]];&#xD;
&#xD;
The so-recovered initial positions agree to at least 80 digits with the original point positions.&#xD;
&#xD;
    sP1Rev[[-1]] - initialPositionsR // Abs // Max // Accuracy&#xD;
&#xD;
    86.9777&#xD;
&#xD;
As mentioned earlier, we define the hashes as the positions of the particles when ordered according to their x-values. So, for a given particle configurations, this is the hash-making function.&#xD;
&#xD;
    makeHash[l_] := Sort[ MapIndexed[{#1, #2[[1]]} &amp;amp;, l]][[All, 2]]&#xD;
&#xD;
Because the hashes are permutations of the particle numberings, the number of hashes grows factorially with the particle number and 58 particles could model a 256 bit hash and 99 particles a 512 bit hash.&#xD;
&#xD;
    {2^256, {57!, 58!}} // N&#xD;
&#xD;
    {1.15792*10^77, {4.05269*10^76, 2.35056*10^78}}&#xD;
&#xD;
    {2^512, {98!, 99!}} // N&#xD;
&#xD;
    {1.34078*10^154, {9.42689*10^153, 9.33262*10^155}}&#xD;
&#xD;
    hashes1 = makeHash /@ sP1;&#xD;
&#xD;
Here is a visualization how the hashes evolve with each stir. The coloring is from blue (1) to 100 (red) of the initial particle numbering.&#xD;
&#xD;
    ArrayPlot[hashes1, ColorFunction -&amp;gt; ColorData[&amp;#034;DarkRainbow&amp;#034;], PlotRange -&amp;gt; {1, 100}]&#xD;
![enter image description here][41]&#xD;
&#xD;
This is how the edit distance of the hashes increases with successive stirrings.&#xD;
&#xD;
    ListPlot[Table[{j, EditDistance[hashes1[[1]], hashes1[[j]]]}, {j, 1, 50}],  Filling -&amp;gt; Axis]&#xD;
![enter image description here][42]&#xD;
&#xD;
Gilpin defines the rearrangement index of a hash as the sum of the absolute difference between neighboring particle indices.&#xD;
&#xD;
    rearrangementIndex[indexList_] := Total[Abs[Differences[indexList]]]&#xD;
&#xD;
Here is the growth rate of the rearrangement index for our just-calculated hashes. &#xD;
&#xD;
    ListPlot[Table[{j, rearrangementIndex[hashes1[[j]]]}, {j, 1, 50}], Filling -&amp;gt; Axis]&#xD;
![enter image description here][43]&#xD;
&#xD;
Let&amp;#039;s make a second message that has one bit flipped, say at position 10.&#xD;
&#xD;
    message2 = MapAt[1 - # &amp;amp;, message1, 10]&#xD;
&#xD;
    {1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0,&#xD;
     0, 1,  1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0}&#xD;
&#xD;
    message1 - message2&#xD;
&#xD;
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &#xD;
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}&#xD;
&#xD;
The resulting particle movements look quite different.&#xD;
&#xD;
    sP2 = stirringProcess[initialPositionsR, 1/2, 1/10, message2];&#xD;
&#xD;
    Graphics[{LightGray, Disk[], Thickness[0.001], &#xD;
      Map[Function[c, {RandomColor[], BSplineCurve[c, SplineDegree -&amp;gt; 5]}], &#xD;
       Transpose[N[Table[sP2[[j]], {j, 50}]]]]}]&#xD;
![enter image description here][44]&#xD;
&#xD;
The edit distances between the two hash sequences increase quickly after the different bit is encountered.&#xD;
&#xD;
    hashes2 = makeHash /@ sP2;&#xD;
&#xD;
    ListPlot[Table[{j, EditDistance[hashes1[[j]], hashes2[[j]]]}, {j, 0, 50}], Filling -&amp;gt; Axis]&#xD;
&#xD;
![enter image description here][45]&#xD;
&#xD;
Gilpin carried out many numerical experiments investigating how the hashes behave as a function of the hash length (number of particles), stirring time T, and message length.&#xD;
&#xD;
The next two examples change only the stirring time, and keep all other parameters: message, stirrer distance, initial particle distance.&#xD;
&#xD;
    sP1B = stirringProcess[initialPositionsR, 1/2, 1/9, message1];&#xD;
&#xD;
    hashes1B = makeHash /@ sP1B;&#xD;
&#xD;
    ListPlot[Table[{j, EditDistance[hashes1[[j]], hashes1B[[j]]]}, {j, 0, 50}], Filling -&amp;gt; Axis]&#xD;
&#xD;
![enter image description here][46]&#xD;
&#xD;
With increasing stirring time, the edit distance between the hashes quickly increases.&#xD;
&#xD;
    sP1C = stirringProcess[initialPositionsR, 1/2, 1/2, message1];&#xD;
    &#xD;
    hashes1C = makeHash /@ sP1C;&#xD;
    &#xD;
    ListPlot[Table[{j, EditDistance[hashes1[[j]], hashes1C[[j]]]}, {j, 0, 50}], Filling -&amp;gt; Axis]&#xD;
![enter image description here][47]&#xD;
&#xD;
Next, we use the phyllotaxis-like initial position from above with 200 particles. We also use a longer stirring time (T=1).&#xD;
&#xD;
    message3 = RandomInteger[{0, 1}, 50]&#xD;
&#xD;
    {0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0,1, 0, 1, 0}&#xD;
&#xD;
    sP3 = stirringProcess[sunflower[200, 9/10, 250], 1/2, 1, message3];&#xD;
&#xD;
A plot of the 200 particle trajectories suggests a good mixing.&#xD;
&#xD;
    Graphics[{LightGray, Disk[], Thickness[0.001], &#xD;
      Map[Function[c, {RandomColor[], BSplineCurve[c, SplineDegree -&amp;gt; 5]}], &#xD;
       Transpose[N[Table[sP3[[j]], {j, 50}]]]]}]&#xD;
&#xD;
![enter image description here][48]&#xD;
&#xD;
Already after the first stir, the edit distance between the original hash and the one resulting after stirring is quite large.&#xD;
&#xD;
    hashes3 = makeHash /@ sP3;&#xD;
    &#xD;
    ListPlot[Table[{j, EditDistance[hashes3[[1]], hashes3[[j]]]}, {j, 0, 50}], Filling -&amp;gt; Axis]&#xD;
![enter image description here][49]&#xD;
&#xD;
We will end here. The interested reader can continue to model, stir a million times, count trajectory exchanges, and statistically analyze other aspects of the proposed hashing scheme from Gilpin&amp;#039;s paper. &#xD;
&#xD;
PS: And one can compare with theoretical hashing probabilities for ideal hashes. Such as: draw \[ScriptCapitalN]s hashes from M! possible hashes. How many different hashes Subscript[\[ScriptCapitalN], U] does one draw in average?&#xD;
&#xD;
    uniqueHashes[M_, \[ScriptCapitalN]s_] := &#xD;
     M! (1 - (1 - 1/M!)^\[ScriptCapitalN]s)&#xD;
&#xD;
    Plot3D[uniqueHashes[M, \[ScriptCapitalN]s], {M, 1, 60}, {\[ScriptCapitalN]s, 1, 1000}, MeshFunctions -&amp;gt; {#3 &amp;amp;},&#xD;
     PlotPoints -&amp;gt; 100, ScalingFunctions -&amp;gt; &amp;#034;Log&amp;#034;, PlotRange -&amp;gt; All,&#xD;
     WorkingPrecision -&amp;gt; 50,&#xD;
     AxesLabel -&amp;gt; {Style[&amp;#034;M&amp;#034;, Italic], Style[&amp;#034;\[ScriptCapitalN]s&amp;#034;, Italic], Style[&amp;#034;\!\(\*SubscriptBox[\(\[ScriptCapitalN]\), \(U\)]\)&amp;#034;, Italic]}]&#xD;
&#xD;
![enter image description here][50]&#xD;
&#xD;
For Ns≪M!, this becomes:&#xD;
&#xD;
    Series[Mfac (1 - (1 -  1/Mfac)^\[ScriptCapitalN]s), {Mfac, ∞, 2}] /. Mfac -&amp;gt; M! // Simplify&#xD;
&#xD;
![enter image description here][51]&#xD;
&#xD;
    uniqueHashesApprox[M_, \[ScriptCapitalN]s_] := \[ScriptCapitalN]s - (\[ScriptCapitalN]s*(\[ScriptCapitalN]s - 1))/(2*M!) + (\[ScriptCapitalN]s*(\[ScriptCapitalN]s - 1)*(\[ScriptCapitalN]s - 2))/(6*M!^2)&#xD;
&#xD;
Here is a quick numerical modeling with a sample size of 100 from 6!=720 possible hashes.&#xD;
&#xD;
    With[{M = 6, \[ScriptCapitalN]s = 100},&#xD;
      {Table[Length[&#xD;
          Tally[RandomChoice[Range[M!], \[ScriptCapitalN]s]]], {10000}] // Mean,&#xD;
       uniqueHashes[M, \[ScriptCapitalN]s],&#xD;
       uniqueHashesApprox[M, \[ScriptCapitalN]s]}] // N&#xD;
&#xD;
    {93.407, 93.4267, 93.4369}&#xD;
&#xD;
I definitely suggest reading the whole paper, including the Supplementary Information.&#xD;
&#xD;
The notebook with all the code and visualizations is attached.&#xD;
&#xD;
&#xD;
  [1]: https://www.pnas.org/doi/epdf/10.1073/pnas.1721852115&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-05-02at11.55.34AM.png&amp;amp;userId=20103&#xD;
  [3]: http://www.wgilpin.com/papers/gilpin_pnas_2018.pdf&#xD;
  [4]: https://news.stanford.edu/2018/04/23/swirling-liquids-shed-light-bitcoin-works/&#xD;
  [5]: https://btcmanager.com/stanford-university-physicists-uncover-correlation-between-bitcoin-transactions-and-laws-of-nature/&#xD;
  [6]: https://www.cambridge.org/core/journals/journal-of-fluid-mechanics/article/stirring-by-chaotic-advection/7B32CACE61D5AD79077846D7ACF4A31E&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=61661.png&amp;amp;userId=20103&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=82192.png&amp;amp;userId=20103&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=40363.png&amp;amp;userId=20103&#xD;
  [10]: http://community.wolfram.com//c/portal/getImageAttachment?filename=79744.png&amp;amp;userId=20103&#xD;
  [11]: http://community.wolfram.com//c/portal/getImageAttachment?filename=59285.png&amp;amp;userId=20103&#xD;
  [12]: http://community.wolfram.com//c/portal/getImageAttachment?filename=10756.png&amp;amp;userId=20103&#xD;
  [13]: http://community.wolfram.com//c/portal/getImageAttachment?filename=34567.png&amp;amp;userId=20103&#xD;
  [14]: http://community.wolfram.com//c/portal/getImageAttachment?filename=92028.png&amp;amp;userId=20103&#xD;
  [15]: http://community.wolfram.com//c/portal/getImageAttachment?filename=19639.png&amp;amp;userId=20103&#xD;
  [16]: http://community.wolfram.com//c/portal/getImageAttachment?filename=385110.png&amp;amp;userId=20103&#xD;
  [17]: http://community.wolfram.com//c/portal/getImageAttachment?filename=341511.png&amp;amp;userId=20103&#xD;
  [18]: http://community.wolfram.com//c/portal/getImageAttachment?filename=891612.png&amp;amp;userId=20103&#xD;
  [19]: http://community.wolfram.com//c/portal/getImageAttachment?filename=903513.png&amp;amp;userId=20103&#xD;
  [20]: http://community.wolfram.com//c/portal/getImageAttachment?filename=200714.png&amp;amp;userId=20103&#xD;
  [21]: http://community.wolfram.com//c/portal/getImageAttachment?filename=1069415.png&amp;amp;userId=20103&#xD;
  [22]: http://community.wolfram.com//c/portal/getImageAttachment?filename=577216.png&amp;amp;userId=20103&#xD;
  [23]: http://community.wolfram.com//c/portal/getImageAttachment?filename=224217.png&amp;amp;userId=20103&#xD;
  [24]: http://community.wolfram.com//c/portal/getImageAttachment?filename=435818.png&amp;amp;userId=20103&#xD;
  [25]: http://community.wolfram.com//c/portal/getImageAttachment?filename=121819.png&amp;amp;userId=20103&#xD;
  [26]: http://community.wolfram.com//c/portal/getImageAttachment?filename=370620.png&amp;amp;userId=20103&#xD;
  [27]: http://community.wolfram.com//c/portal/getImageAttachment?filename=949421.png&amp;amp;userId=20103&#xD;
  [28]: http://community.wolfram.com//c/portal/getImageAttachment?filename=426622.png&amp;amp;userId=20103&#xD;
  [29]: http://community.wolfram.com//c/portal/getImageAttachment?filename=281923.png&amp;amp;userId=20103&#xD;
  [30]: http://community.wolfram.com//c/portal/getImageAttachment?filename=365024.png&amp;amp;userId=20103&#xD;
  [31]: http://community.wolfram.com//c/portal/getImageAttachment?filename=389825.png&amp;amp;userId=20103&#xD;
  [32]: http://community.wolfram.com//c/portal/getImageAttachment?filename=256626.png&amp;amp;userId=20103&#xD;
  [33]: http://community.wolfram.com//c/portal/getImageAttachment?filename=218327.png&amp;amp;userId=20103&#xD;
  [34]: http://community.wolfram.com//c/portal/getImageAttachment?filename=319828.png&amp;amp;userId=20103&#xD;
  [35]: http://community.wolfram.com//c/portal/getImageAttachment?filename=889929.png&amp;amp;userId=20103&#xD;
  [36]: http://community.wolfram.com//c/portal/getImageAttachment?filename=995130.png&amp;amp;userId=20103&#xD;
  [37]: http://community.wolfram.com//c/portal/getImageAttachment?filename=30s.png&amp;amp;userId=20103&#xD;
  [38]: http://community.wolfram.com//c/portal/getImageAttachment?filename=639031.png&amp;amp;userId=20103&#xD;
  [39]: http://community.wolfram.com//c/portal/getImageAttachment?filename=469232.png&amp;amp;userId=20103&#xD;
  [40]: http://community.wolfram.com//c/portal/getImageAttachment?filename=123233.png&amp;amp;userId=20103&#xD;
  [41]: http://community.wolfram.com//c/portal/getImageAttachment?filename=1074134.png&amp;amp;userId=20103&#xD;
  [42]: http://community.wolfram.com//c/portal/getImageAttachment?filename=497035.png&amp;amp;userId=20103&#xD;
  [43]: http://community.wolfram.com//c/portal/getImageAttachment?filename=993836.png&amp;amp;userId=20103&#xD;
  [44]: http://community.wolfram.com//c/portal/getImageAttachment?filename=852637.png&amp;amp;userId=20103&#xD;
  [45]: http://community.wolfram.com//c/portal/getImageAttachment?filename=597938.png&amp;amp;userId=20103&#xD;
  [46]: http://community.wolfram.com//c/portal/getImageAttachment?filename=1011739.png&amp;amp;userId=20103&#xD;
  [47]: http://community.wolfram.com//c/portal/getImageAttachment?filename=1005540.png&amp;amp;userId=20103&#xD;
  [48]: http://community.wolfram.com//c/portal/getImageAttachment?filename=132941.png&amp;amp;userId=20103&#xD;
  [49]: http://community.wolfram.com//c/portal/getImageAttachment?filename=625642.png&amp;amp;userId=20103&#xD;
  [50]: http://community.wolfram.com//c/portal/getImageAttachment?filename=879343.png&amp;amp;userId=20103&#xD;
  [51]: http://community.wolfram.com//c/portal/getImageAttachment?filename=1026844.png&amp;amp;userId=20103</description>
    <dc:creator>Michael Trott</dc:creator>
    <dc:date>2018-05-02T11:44:45Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/127970">
    <title>Hodgkin-Huxley cable equation or propogation equation</title>
    <link>https://community.wolfram.com/groups/-/m/t/127970</link>
    <description>I am trying to find the equations and the solution to an equation that seems to have several names: Hodgkin-Huxley Cable Equation, Propogation Equation, Wave Equation.  I am looking for the equation and solution to the action potential as it goes down an axon in Mathematica code.&#xD;
&#xD;
 I am stuck with being in a wheel chair and tied to oxygen thus I cannot get to a library.  I no longer work as a professor so I have no one to ask.  So I am stuck.  &#xD;
&#xD;
I would appreciate any help&#xD;
Thank you&#xD;
Jake</description>
    <dc:creator>Jake Trexel</dc:creator>
    <dc:date>2013-09-22T22:06:08Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2922562">
    <title>Current CO2 emission will increase CO2 concentration cubically</title>
    <link>https://community.wolfram.com/groups/-/m/t/2922562</link>
    <description>&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/aa9ac0c4-abff-46be-b3a4-0ada00a34d86</description>
    <dc:creator>Sangdon Lee</dc:creator>
    <dc:date>2023-05-20T17:14:58Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1034626">
    <title>[GIF] Elaborating on Arrival&amp;#039;s Alien Language, Part I., II. &amp;amp; III.</title>
    <link>https://community.wolfram.com/groups/-/m/t/1034626</link>
    <description>I recently watched &amp;#034;Arrival&amp;#034;, and thought that some of the dialogue sounded Wolfram-esque. Later, I saw the following blog post:&#xD;
&#xD;
[Quick, How Might the Alien Spacecraft Work?][1] &#xD;
&#xD;
Along with many others, I enjoyed the movie. The underlying artistic concept for the alien language reminded me of decade old memories, a book by Stephen Addiss, [Art of Zen][2]. Asian-influenced symbolism is an interesting place to start building a sci-fi concept, even for western audiences.  &#xD;
&#xD;
I also found Cristopher Wolfram&amp;#039;s broadcast and the associated files: &#xD;
&#xD;
[Youtube Broadcast][3]&#xD;
&#xD;
[Github Files ( with image files ) ][4]&#xD;
&#xD;
Thanks for sharing! More science fiction, yes! &#xD;
&#xD;
I think the constraint of circular logograms could be loosened. This leads to interesting connections with theory of functions, which I think the Aliens would probably know about. &#xD;
&#xD;
The following code takes an alien logogram as input and outputs a deformation according to do-it-yourself formulation of the Pendulum Elliptic Functions:&#xD;
&#xD;
![Human Animation][5]&#xD;
&#xD;
## $m=2$ Inversion Coefficients ##&#xD;
&#xD;
    MultiFactorial[n_, nDim_] := Times[n, If[n - nDim &amp;gt; 1, MultiFactorial[n - nDim, nDim], 1]]&#xD;
    GeneralT[n_, m_] :=  Table[(-m)^(-j) MultiFactorial[i + m (j - 1) + 1, m]/ MultiFactorial[i + 1, m], {i, 1, n}, {j, 1, i}]&#xD;
    a[n_] := With[{gt = GeneralT[2 n, 2]}, gt[[2 #, Range[#]]] &amp;amp; /@ Range[n] ]&#xD;
&#xD;
## Pendulum Values : $2(1-\cos(x))$ Expansion Coefficients ##&#xD;
&#xD;
    c[n_ /; OddQ[n]] := c[n] = 0;&#xD;
    c[n_ /; EvenQ[n]] := c[n] = 2 (n!) (-2)^(n/2)/(n + 2)!;&#xD;
&#xD;
## Partial Bell Polynomials ##&#xD;
Note: These polynomials are essentially the same as the &amp;#034;**BellY**&amp;#034; ( hilarious naming convention), but recursion optimized. See timing tests below. &#xD;
&#xD;
    B2[0, 0] = 1;&#xD;
    B2[n_ /; n &amp;gt; 0, 0] := 0;&#xD;
    B2[0, k_ /; k &amp;gt; 0] := 0;&#xD;
    B2[n_ /; n &amp;gt; 0, k_ /; k &amp;gt; 0] := B2[n, k] = Total[&#xD;
        Binomial[n - 1, # - 1] c[#] B2[n - #, k - 1] &amp;amp; /@ &#xD;
         Range[1, n - k + 1] ];&#xD;
&#xD;
## Function Construction ##&#xD;
&#xD;
    BasisT[n_] :=  Table[B2[i, j]/(i!) Q^(i + 2 j), {i, 2, 2 n, 2}, {j, 1, i/2}]&#xD;
    PhaseSpaceExpansion[n_] :=   Times[Sqrt[2 \[Alpha]], 1 + Dot[MapThread[Dot, {BasisT[n], a[n]}], (2 \[Alpha])^Range[n]]];&#xD;
    AbsoluteTiming[CES50 = PhaseSpaceExpansion[50];] (* faster than 2(s) *)&#xD;
    Fast50 = Compile[{{\[Alpha], _Real}, {Q, _Real}}, Evaluate@CES50];&#xD;
&#xD;
## Image Processing ##&#xD;
note: This method is a hack from &amp;#034;.jpg&amp;#034; to sort-of vector drawing. I haven&amp;#039;t tested V11.1 vectorization functionality, but it seems like this could be a means to process all jpg&amp;#039;s and output a file of vector polygons. Anyone ?&#xD;
&#xD;
    LogogramData = Import[&amp;#034;Human1.jpg&amp;#034;];&#xD;
    Logogram01 = ImageData[ColorNegate@Binarize[LogogramData, .9]];&#xD;
    ArrayPlot@Logogram01;&#xD;
    &#xD;
    Positions1 = &#xD;
      Position[Logogram01[[5 Range[3300/5], 5 Range[3300/5]]], 1];&#xD;
    Graphics[{Disk[#, 1.5] &amp;amp; /@ Positions1, Red, &#xD;
       Disk[{3300/5/2, 3300/5/2}, 10]}];&#xD;
    onePosCentered = &#xD;
      N[With[{cent = {3300/5/2, 3300/5/2} }, # - cent &amp;amp; /@ Positions1]];&#xD;
    radii = Norm /@ onePosCentered;&#xD;
    maxR = Max@radii;&#xD;
    normRadii = radii/maxR;&#xD;
    angles = ArcTan[#[[2]], #[[1]]] &amp;amp; /@ onePosCentered;&#xD;
    Qs = Cos /@ angles;&#xD;
## Constructing and Printing Image Frames ##&#xD;
&#xD;
    AlienWavefunction[R_, pixel_, normRad_, Qs_, angles_] := Module[{&#xD;
       deformedRadii = MapThread[Fast50, {R normRad, Qs}],&#xD;
       deformedVectors = Map[N[{Cos[#], Sin[#]}] &amp;amp;, angles],&#xD;
       deformedCoords&#xD;
       },&#xD;
      deformedCoords = &#xD;
       MapThread[Times, {deformedRadii, deformedVectors}];&#xD;
      Show[ PolarPlot[ Evaluate[&#xD;
         CES50 /. {Q -&amp;gt; Cos[\[Phi]], \[Alpha] -&amp;gt; #/10} &amp;amp; /@ &#xD;
          Range[9]], {\[Phi], 0, 2 Pi}, Axes -&amp;gt; False, &#xD;
        PlotStyle -&amp;gt; Gray],&#xD;
       Graphics[Disk[#, pixel] &amp;amp; /@ deformedCoords], ImageSize -&amp;gt; 500]]&#xD;
    &#xD;
    AbsoluteTiming[  OneFrame = &#xD;
       AlienWavefunction[1, (1 + 1)* 1.5/maxR, normRadii, Qs, angles]&#xD;
     ](* about 2.5 (s)*)&#xD;
&#xD;
![Alien Pendulum][6]&#xD;
&#xD;
## Validation and Timing ##&#xD;
In this code, we&amp;#039;re using the magic algorithm to get up to about $100$ orders of magnitude in the half energy, $50$ in the energy. I did prove $m=1$ is equivalent to other published forms, but haven&amp;#039;t found anything in the literature about $m=2$, and think that the proving will take more time, effort, and insight (?). For applications, we just race ahead without worrying too much, but do check with standard, known expansions: &#xD;
&#xD;
    EK50 = Normal@ Series[D[ Expand[CES50^2/2] /.  Q^n_ :&amp;gt; (1/2)^n Binomial[n, n/2], \[Alpha]], {\[Alpha], 0, 50}];&#xD;
    SameQ[Normal@  Series[(2/Pi) EllipticK[\[Alpha]], {\[Alpha], 0, 50}], EK50]&#xD;
    Plot[{(2/Pi) EllipticK[\[Alpha]], EK50}, {\[Alpha], .9, 1}, ImageSize -&amp;gt; 500]&#xD;
    Out[]:= True&#xD;
&#xD;
![Approximation Validity][7]&#xD;
&#xD;
This plot gives an idea of approximation validity via the time integral over $2\pi$ radians in phase space. Essentially, even the time converges up to, say,  $\alpha = 0.92$. Most of the divergence is tied up in the critical point, which is difficult to notice in the phase space drawings above. &#xD;
&#xD;
Also compare the time of function evaluation:&#xD;
&#xD;
    tDIY = Mean[ AbsoluteTiming[Fast50[.9, RandomReal[{0, 1}]] ][[1]] &amp;amp; /@ Range[10000]];&#xD;
    tMma = Mean[AbsoluteTiming[JacobiSN[.9, RandomReal[{0, 1}]] ][[1]] &amp;amp; /@ Range[10000]];&#xD;
    tMma/tDIY&#xD;
&#xD;
In the region of sufficient convergence, Mathematica function **JacobiSN** is almost 20 times slower. The CES radius also requires a function call to **JacobiCN**, so an output-equivalent **AlienWavefunction** algorithm using built-in Mathematica functions would probably take at least 20 times as long to produce. When computing hundreds of images this is a noticeable slow down, something to avoid ! !  &#xD;
&#xD;
Also compare time to evaluate the functional basis via the Bell Polynomials:&#xD;
&#xD;
     BasisT2[n_] := Table[BellY[i, j, c /@ Range[2 n]]/(i!) Q^(i + 2 j), {i, 2, 2 n,  2}, {j, 1, i/2}];&#xD;
    SameQ[BasisT2[20], BasisT[20]]&#xD;
    t1 = AbsoluteTiming[BasisT[#];][[1]] &amp;amp; /@ Range[100];&#xD;
    t2 = AbsoluteTiming[BasisT2[#];][[1]] &amp;amp; /@ Range[25];&#xD;
    ListLinePlot[{t1, t2}, ImageSize -&amp;gt; 500]&#xD;
![Series Inverse][8]&#xD;
&#xD;
The graph shows quite clearly that careful evaluation via the recursion relations changes the complexity of the inversion algorithm to polynomial time, $(n^2)$, in one special example where the forward series expansions coefficients have known, numeric values. &#xD;
&#xD;
&#xD;
## Conclusion ##&#xD;
&#xD;
We show proof-of-concept that alien logograms admit deformations that preserve the cycle topology. Furthermore we provide an example calculation where the &amp;#034;human&amp;#034; logogram couples to a surface. Deformation corresponds to scale transformation of the logogram along the surface. Each deformation associates with an energy. &#xD;
&#xD;
Invoking the pendulum analogy gives the energy a physical meaning in terms of gravity, but we are not limited to classical examples alone. The idea extends to arbitrary surfaces in two, three or four dimensions, as long as the surfaces have local extrema. Around the extrema, there will exist cycle contours, which we can inscript with the Alien logograms. This procedure leads readily to large form compositions, especially if the surface has many extrema. Beyond Fourier methods, we might also apply spherical harmonics, and hyperspherical harmonics to get around the limitation of planarity. &#xD;
&#xD;
The missing proof... Maybe later. LOL! ~ ~ ~ ~ Brad   &#xD;
&#xD;
And in the Fanfiction Voice: &#xD;
&#xD;
Physicist : &amp;#034;It should be no surprise that heptapod speech mechanism involves an arbitrary deformation of the spacetime manifold.&amp;#034;&#xD;
&#xD;
Linguist :  &amp;#034;Space-traveling aliens, yes, of course they know math and physics, but Buddhist symbology, where&amp;#039;d they learn that?&amp;#034;&#xD;
&#xD;
&#xD;
  [1]: http://blog.stephenwolfram.com/2016/11/quick-how-might-the-alien-spacecraft-work/&#xD;
  [2]: https://books.google.com/books/about/Art_of_Zen.html?id=4jGEQgAACAAJ&#xD;
  [3]: https://www.youtube.com/watch?v=8N6HT8hzUCA&amp;amp;t=4992s&#xD;
  [4]: https://github.com/WolframResearch/Arrival-Movie-Live-Coding&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Deformation.gif&amp;amp;userId=234448&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=AlienPendulum.png&amp;amp;userId=234448&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=EllipticK.png&amp;amp;userId=234448&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=BellPolynomial.png&amp;amp;userId=234448</description>
    <dc:creator>Brad Klee</dc:creator>
    <dc:date>2017-03-18T20:23:59Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1313605">
    <title>Making A Word Cloud Dense</title>
    <link>https://community.wolfram.com/groups/-/m/t/1313605</link>
    <description>##Motivation##&#xD;
&#xD;
Some time ago, my coworker Eila Stiegler was working on her [blog][1] about the cool [Marathon visualization website][2]. While doing so, she asked me if it is possible to make artistic word clouds, such as the one from the 2017 Champaign-Urbana marathon poster (that hangs on her office door) using the Wolfram Language . With only a few weeks until [this year&amp;#039;s marathon][3] left, I will give this a try.&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
That is an interesting problemhow to make such-type deformed dense letter arrangements in the Wolfram Language.&#xD;
&#xD;
This hand-made poster has many nice elements, e.g.:&#xD;
&#xD;
 - the words are all contained in the outline of the [Alma Mater][5]&#xD;
 -  the characters fill out most of the space with smooth outlines, but&#xD;
   the character is still recognizable (like in a CAPTCHA)&#xD;
 -  the characters of a given word are not all the same size, but the&#xD;
   size varies smoothly along a word&#xD;
 -  the [Illini coloring][6] is correlated to the flow of the robe&#xD;
&#xD;
To keep this post at reasonable length, let&amp;#039;s try to reproduce the first two features: a dense packing of characters that fills a given outer shape. &#xD;
&#xD;
Our overall approach will be the following:&#xD;
&#xD;
 - make an initial word cloud (using WordCloud) within a given shape&#xD;
   (the Alma Mater)&#xD;
 - solve the diffusion equation (using NDSolve) to let the characters&#xD;
   of the words diffuse/flow into the space between the words/characters&#xD;
   and between the characters and the boundary of the outer shape&#xD;
 - follow the boundaries of the letters under this diffusion process&#xD;
   (again using NDSolve)&#xD;
&#xD;
The use of the diffusion equation to spread out areas was pioneered by [Gastner and Newman][7] in building cartograms in their cartogram algorithm. (Because we don&amp;#039;t want to preserve the character weights/areas, we will use different boundary conditions.)&#xD;
&#xD;
If one imagines a liquid with time-and position-dependent concentrations n(t,x,y) of say ink, the ink will spread to a uniform distribution in the long time limit. In our case, the initial letters have a lot of ink and the space between the letters is ink-free.&#xD;
&#xD;
To follow a single ink molecule, one first solves the classical diffusion equation (with Subscript[c, D] being the diffusion coefficient)&#xD;
&#xD;
![enter image description here][8]&#xD;
&#xD;
then defines the flow&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
and then follows that path {x(x),y(t)} of a given inc molecule (in our case character boundary point) with initial position {$x_0,y_0$} through the nonlinear system of ordinary coupled differential equations.&#xD;
&#xD;
![enter image description here][10]&#xD;
&#xD;
As hinted above, in our example, we will start with a high concentration of ink at the characters and follow the ink molecules that are at the edges of the characters over time.&#xD;
&#xD;
The individual characters will over time diffuse into the voids between them but they will not start overlapping. And the movement into the voids depends on the available space. So, we expect smooth curves as the boundaries of the spread-out letters. If we would say, use the wave equation instead, we would get interference effects from overlapping waves from the individual characters and the propagation would be uniform in each direction.&#xD;
&#xD;
The result will be the following:&#xD;
(click to play)&#xD;
&#xD;
[![enter image description here][11] ][12]&#xD;
&#xD;
##The Alma Mater Outline##&#xD;
&#xD;
First we need an outline of the outer, word-confining shape. Using a photograph of the Alma Mater, we can quickly trace out the boundary.&#xD;
&#xD;
    Show[ ImageTake[ Import[&amp;#034;https://tinyurl.com/yd6dn242&amp;#034;], {220, -500}, {320, -320}],  ImageSize -&amp;gt; 300]&#xD;
&#xD;
![enter image description here][13]&#xD;
&#xD;
    almaMater = {{761.7, 1432.}, {790.8, 1425.}, {832.7, 1417.}, {862.3, &#xD;
        1405.}, {900.7, 1388.}, {928.2, 1386.}, &#xD;
           {946.5, 1364.}, {978.9, 1355.}, {989.5, 1340.}, {1031., &#xD;
        1324.}, {1068., 1333.}, {1094., 1333.}, {1075., 1325.}, &#xD;
           {1068., 1321.}, {1108., 1296.}, {1102., 1290.}, {1088., &#xD;
        1297.}, {1099., 1285.}, {1093., 1269.}, {1076., 1268.}, &#xD;
           {1071., 1262.}, {1034., 1286.}, {995.5, 1289.}, {1001., &#xD;
        1231.}, {990.4, 1183.}, {987.3, 1149.}, {970.6, 1133.}, &#xD;
           {950.2, 1133.}, {929.3, 1126.}, {909., 1123.}, {882.1, &#xD;
        1127.}, {867.6, 1135.}, {854.8, 1148.}, {865.5, 1072.}, &#xD;
           {874.2, 980.6}, {887.6, 848.7}, {897.3, 709.4}, {900.9, &#xD;
        629.1}, {906.5, 537.5}, {866.6, 528.8}, {857.9, 533.3}, &#xD;
           {833.4, 528.7}, {814.1, 530.2}, {776.2, 535.9}, {747.6, &#xD;
        537.4}, {710.3, 532.3}, {675.2, 533.8}, {632.2, 530.7}, &#xD;
           {607.7, 532.3}, {590.4, 528.7}, {558.3, 533.3}, {554.7, &#xD;
        619.4}, {563.4, 710.6}, {564.1, 825.9}, {568.2, 931.9}, &#xD;
           {575.9, 1021.}, {574.4, 1114.}, {571.3, 1129.}, {542.1, &#xD;
        1120.}, {513., 1109.}, {495.2, 1113.}, {473.8, 1132.}, &#xD;
           {457.9, 1176.}, {445.6, 1250.}, {444.1, 1280.}, {415.6, &#xD;
        1281.}, {385., 1262.}, {376.4, 1269.}, {361.7, 1269.}, &#xD;
           {353.5, 1282.}, {350.4, 1292.}, {375.5, 1309.}, {358.6, &#xD;
        1320.}, {361.9, 1328.}, {390.9, 1314.}, {432.9, 1332.}, &#xD;
           {458., 1345.}, {488.7, 1362.}, {486.7, 1371.}, {528.1, &#xD;
        1386.}, {555.8, 1396.}, {593.7, 1407.}, {639.6, 1421.}, &#xD;
           {660., 1430.}, {678.8, 1431.}, {676.4, 1454.}, {676.3, &#xD;
        1463.}, {665.7, 1485.}, {657.6, 1487.}, {643.4, 1502.}, &#xD;
           {643.5, 1532.}, {654.2, 1554.}, {670.4, 1580.}, {693.5, &#xD;
        1594.}, {726.7, 1588.}, {749.9, 1568.}, {766.9, 1542.}, &#xD;
           {765.8, 1521.}, {761.2, 1504.}, {752.6, 1484.}, {748.2, &#xD;
        1473.}, {748.2, 1450.}, {747.5, 1440.}, {761.7, 1432.}};&#xD;
&#xD;
    Graphics[FilledCurve[BSplineCurve[almaMater]]]&#xD;
&#xD;
![enter image description here][14]&#xD;
&#xD;
For the use in WordCloud, we make mask that is exactly this shape.&#xD;
&#xD;
    Show[almaMaterPolygon = Rasterize[Graphics[Polygon[&#xD;
         Table[&#xD;
          Evaluate[BSplineFunction[almaMater, SplineDegree -&amp;gt; 2][t]] - {750, &#xD;
            1000}, {t, 0, 1, 1/200}]]], &amp;#034;Image&amp;#034;, ImageSize -&amp;gt; 800], &#xD;
     ImageSize -&amp;gt; 300]&#xD;
&#xD;
![enter image description here][15]&#xD;
&#xD;
##Making the Word Cloud of Marathon Words##&#xD;
&#xD;
Next, we collect a set of words that describe the Illinois Marathon. Making a web search for pages that mention the marathon event or the twin city might give us some suggestions for words to include.&#xD;
&#xD;
    sites = Function[searchTerm, &#xD;
        WebSearch[searchTerm, &#xD;
         MaxItems -&amp;gt; &#xD;
          25]] /@  {&amp;#034;Illinois marathon&amp;#034;,  &amp;#034;Champaign marathon&amp;#034;, &amp;#034;Urbana marathon&amp;#034;, &amp;#034;Champaign-Urbana&amp;#034;};&#xD;
    &#xD;
    urls = Union[Flatten[Normal[#[All, &amp;#034;Hyperlink&amp;#034;]] &amp;amp; /@ sites]];&#xD;
    Monitor[pageData = Table[Import[urls[[j, 1]]], {j, 1 Length[urls]}]; // Quiet, j]&#xD;
    &#xD;
    words = KeySelect[&#xD;
       Select[WordCounts[&#xD;
         DeleteStopwords[&#xD;
          StringJoin[Riffle[ToLowerCase[Cases[pageData, _String]], &amp;#034; &amp;#034;]]]], # &amp;gt;= &#xD;
          50 &amp;amp;], StringLength[#] &amp;gt; 2 &amp;amp;];&#xD;
    &#xD;
    WordCloud[words, PlotTheme -&amp;gt; &amp;#034;Monochrome&amp;#034;]&#xD;
&#xD;
![enter image description here][16]&#xD;
&#xD;
We include  the word &amp;#039;cold&amp;#039;, as it was a fresh morning at last year&amp;#039;s race.&#xD;
&#xD;
![enter image description here][17]&#xD;
&#xD;
So, in the following we will use this list of words.&#xD;
&#xD;
    words = {&amp;#034;Marathon&amp;#034;, &amp;#034;26.2\[ThinSpace]miles&amp;#034;, &amp;#034;42.195\[ThinSpace]km&amp;#034;, &#xD;
       &amp;#034;Champaign&amp;#034;, &amp;#034;Urbana&amp;#034;, &amp;#034;4\[ThinSpace]hours&amp;#034;, &amp;#034;5\[ThinSpace]k&amp;#034;, &#xD;
       &amp;#034;10\[ThinSpace]k&amp;#034;,&#xD;
       &amp;#034;46112\[ThinSpace]y&amp;#034;, &amp;#034;138336\[ThinSpace]ft&amp;#034;, &amp;#034;Walk&amp;#034;, &amp;#034;2017&amp;#034;, &#xD;
       &amp;#034;26\[ThinSpace]mi 385\[ThinSpace]y&amp;#034;, &amp;#034;Battle of Marathon&amp;#034;, &amp;#034;Half&amp;#034;, &#xD;
       &amp;#034;7\[ThinSpace]am&amp;#034;,&#xD;
       &amp;#034;\[TildeTilde]2,600\[ThinSpace]Cal&amp;#034;, &amp;#034;9th Race&amp;#034;, &amp;#034;Memorial Stadium&amp;#034;, &#xD;
       &amp;#034;Dick Beardsley&amp;#034;, &amp;#034;Sunny&amp;#034;, &amp;#034;Rainy&amp;#034;, &amp;#034;Windy&amp;#034;,&#xD;
       &amp;#034;Cold&amp;#034;, &amp;#034;Warm&amp;#034;, &amp;#034;Fun&amp;#034;, &amp;#034;9\[ThinSpace]min/mile&amp;#034;, &amp;#034;490\[ThinSpace]BC&amp;#034;,&#xD;
       &amp;#034;Race&amp;#034;, &amp;#034;Running&amp;#034;, &amp;#034;Pheidippides&amp;#034;, &amp;#034;April\[ThinSpace]21,22&amp;#034;, &amp;#034;Pacers&amp;#034;, &#xD;
       &amp;#034;Christie&amp;#034;,&#xD;
       &amp;#034;Illinois&amp;#034;, &amp;#034;Start&amp;#034;, &amp;#034;Expo&amp;#034;, &amp;#034;Alma Mater&amp;#034;, &amp;#034;02:22:18&amp;#034;, &amp;#034;Stadium&amp;#034;, &amp;#034;Relay&amp;#034;,&#xD;
       &amp;#034;Olympic 1896&amp;#034;, &amp;#034;Abe&amp;#039;s Log&amp;#034;, &amp;#034;BIB&amp;#034;, &amp;#034;Race Street&amp;#034;, &amp;#034;Green Street&amp;#034;,&#xD;
       &amp;#034;Boston Qualifier&amp;#034;, &amp;#034;Winner&amp;#034;};&#xD;
&#xD;
We use selected seed values to obtain a word cloud that has some words in the head and so that all characters are strictly contained in the Alma Mater. Different seeds will result in different-looking word clouds.&#xD;
&#xD;
    SeedRandom[111]&#xD;
    WordCloud[(RandomReal[{1, 2}] -&amp;gt; #) &amp;amp; /@&#xD;
      words, &#xD;
     ColorNegate@almaMaterPolygon, WordOrientation -&amp;gt; {-Pi/3, Pi/3},&#xD;
     MaxItems -&amp;gt; \[Infinity], ColorFunction -&amp;gt; (Black &amp;amp;), FontSize -&amp;gt; {5, 15},&#xD;
     RandomSeeding -&amp;gt; 111]&#xD;
&#xD;
![enter image description here][18]&#xD;
&#xD;
To avoid any dependence of the following calculations and visualisations, here is the word cloud that we want to use in the following (obtained with the seeds 35, 35).&#xD;
&#xD;
![enter image description here][19]&#xD;
&#xD;
![enter image description here][20]&#xD;
&#xD;
Here are the words from the word cloud within the Alma Mater.&#xD;
&#xD;
    With[{d = ImageSize -&amp;gt; ImageDimensions[almaMaterPolygon]},&#xD;
     Overlay[{Show[almaMaterPolygon, d],&#xD;
        Show[SetAlphaChannel[Show[wc1, d],&#xD;
                  Darker@ColorNegate[almaMaterPolygon]], d]}] // &#xD;
                                                   &#xD;
      Rasterize[#, &amp;#034;Image&amp;#034;, ImageSize -&amp;gt; 400] &amp;amp;]&#xD;
&#xD;
![enter image description here][21]&#xD;
&#xD;
##Build a Region-object for the Words in the Alma Mater##&#xD;
&#xD;
As we want to solve the diffusion equation, we build a region-object to use in the numerical differential equation solver. We want the characters to have a high initial value and have the characters flow out. To get a good numerical solution, we want a fine grid near the boundaries of the characters that form the words.&#xD;
&#xD;
We load the FEM package to have such useful functions such as ToElementMesh at our disposal.&#xD;
&#xD;
    Needs[&amp;#034;NDSolve`FEM`&amp;#034;]&#xD;
&#xD;
The characters from the word cloud taken out. Using a larger image size will give later smoother-looking characters. But it will also increase the computation time.&#xD;
&#xD;
    Show[im = ImageMesh[ras = Rasterize[wc1, &amp;#034;Image&amp;#034;, ImageSize -&amp;gt; 800]], &#xD;
     Frame -&amp;gt; True]&#xD;
&#xD;
![enter image description here][22]&#xD;
&#xD;
The Alma Mater region mask:&#xD;
&#xD;
    Show[im2 = ImageMesh[ImageResize[almaMaterPolygon,&#xD;
        ImageDimensions[ras]]], Frame -&amp;gt; True]&#xD;
&#xD;
![enter image description here][23]&#xD;
&#xD;
And here are the characters taken out of the Alma Mater region.&#xD;
&#xD;
    im3 = RegionDifference[im, im2]&#xD;
![enter image description here][24]&#xD;
&#xD;
Next, we build the triangulated version for use in the PDE solving. We see the fine triangulation near the character boundaries that we want for an accurate solution of the PDE.&#xD;
&#xD;
    holes = im3[&amp;#034;RegionHoles&amp;#034;];&#xD;
    (em = ToElementMesh[RegionBoundary[im3], &#xD;
         &amp;#034;RegionMarker&amp;#034; -&amp;gt; ({#, 0, 1} &amp;amp; /@ holes), &amp;#034;MaxCellMeasure&amp;#034; -&amp;gt; 100])[&#xD;
      &amp;#034;Wireframe&amp;#034;] /.                              {e_EdgeForm :&amp;gt; &#xD;
       EdgeForm[{Black, Thickness[0.0001]}]}&#xD;
![enter image description here][25]&#xD;
&#xD;
The corresponding mesh region.&#xD;
&#xD;
    mr = MeshRegion[em]&#xD;
&#xD;
![enter image description here][26]&#xD;
&#xD;
And these are the meshed versions of the individual characters.&#xD;
&#xD;
    outer = Rectangle @@ Transpose[RegionBounds[im]];&#xD;
    Show[allChars = &#xD;
      RegionDifference[outer, im] // DiscretizeRegion[#, MaxCellMeasure -&amp;gt; 5] &amp;amp;, &#xD;
     Frame -&amp;gt; True]&#xD;
&#xD;
![enter image description here][27]&#xD;
&#xD;
    Length[chars = ConnectedMeshComponents[allChars]]&#xD;
&#xD;
&amp;gt; 371&#xD;
&#xD;
Right now, about 21 % of the area of the Alma Mater are occupied by the characters.&#xD;
&#xD;
    Quantity[100 Total[Area /@ chars]/Area[mr], &amp;#034;Percent&amp;#034;] // NumberForm[#, 4] &amp;amp;&#xD;
&#xD;
&amp;gt; 21.22%&#xD;
&#xD;
##Colors the Words of the Word Cloud##&#xD;
&#xD;
We want to color each word individually. By overlaying the region characters with the original word cloud, we identify which characters belong to the same word.&#xD;
&#xD;
We use standard [Illini colors][28].&#xD;
&#xD;
    uOfIColors = {RGBColor[19/255, 31/255, 51/255], &#xD;
       RGBColor[250/255, 99/255, 0/255]};&#xD;
    &#xD;
    SeedRandom[25];&#xD;
    Show[rasC = &#xD;
      Rasterize[wc1 /. GrayLevel[0] :&amp;gt; Blend[uOfIColors, RandomReal[]], &amp;#034;Image&amp;#034;, &#xD;
       ImageSize -&amp;gt; 800], ImageSize -&amp;gt; 300]&#xD;
&#xD;
![enter image description here][29]&#xD;
&#xD;
    imC = Reverse@ImageData[rasC];&#xD;
    &#xD;
    getColor[cm_] :=&#xD;
     Module[{xMin, xMax, yMin, yMax, reg, points, ccs},&#xD;
      {{xMin, xMax}, {yMin, yMax}} = RegionBounds[cm] ;&#xD;
      reg = RegionMember[cm];&#xD;
      points = &#xD;
       Cases[Table[&#xD;
         If[reg[{x, y}], {x, y}, Null], {x, Floor[xMin], Ceiling[xMax]}, {y, &#xD;
          Floor[yMin], Ceiling[yMax]}], {_, _}, {-2}]; &#xD;
      (* majority color *)&#xD;
      ccs = DeleteCases[Reverse[SortBy[Tally[&#xD;
           imC[[Sequence @@ Reverse[#]]] &amp;amp; /@ points], Last]], {{1.`, 1.`, &#xD;
          1.`}, _}];&#xD;
      ccs[[1]]]&#xD;
    &#xD;
    Monitor[charColors = Table[getColor[chars[[j]]],&#xD;
                                                          {j, Length[chars]}];, j]&#xD;
&#xD;
Here are the characters, as regions, colored.&#xD;
&#xD;
    Show[Table[&#xD;
      Region[chars[[j]], BaseStyle -&amp;gt; {RGBColor @@ charColors[[j, 1]]}], {j, &#xD;
       Length[chars]}]]&#xD;
&#xD;
![enter image description here][30]&#xD;
&#xD;
##Make Triangles and Region Functions##&#xD;
&#xD;
We extract the triangles from the mesh for the construction of the initial conditions that will be needed in the next section.&#xD;
&#xD;
    triangles = (MeshPrimitives[mr, 2] /.&#xD;
        &#xD;
        Region`Mesh`Quadratic[Polygon[{p1_, p2_, p3_, ___}]] :&amp;gt; &#xD;
         Polygon[{p1, p2, p3}]);&#xD;
&#xD;
We have about 240k triangles in our FEM mesh.&#xD;
&#xD;
    Length[triangles]&#xD;
&#xD;
&amp;gt; 243642&#xD;
&#xD;
We calculate the areas and centroids of these triangles.&#xD;
&#xD;
    {centroids, areas} = &#xD;
      Transpose[{RegionCentroid[#], Area[#]} &amp;amp; /@ Take[triangles, All]];&#xD;
&#xD;
Here is a distribution of the sizes of the triangles from the mesh.&#xD;
&#xD;
    Histogram[areas, 5000]&#xD;
    &#xD;
![enter image description here][31]&#xD;
&#xD;
    rb = RegionBoundary[mr];&#xD;
    &#xD;
    rd = RegionDistance[allChars];&#xD;
    srd = SignedRegionDistance[mr];&#xD;
&#xD;
##Reconstructing Deformed Characters from Their Boundary Points##&#xD;
&#xD;
As a small intermezzo, and because we will need it later anyway, we implement a function that given a 2D mesh region and a function that maps these points to new (evolved) points, builds filled curves. We do need this function because we want smoothed boundaries and filling of our character outlines. Most of the code deals with detecting interior holes and the order of the points. If we have characters with &amp;#039;holes&amp;#039; (e.g. A, B), we will actually draw multiple filled curves. First we will draw the outermost one, and then the inner holes with the color of the outer environment on top.&#xD;
&#xD;
    makeClosedCurve[mr_MeshRegion, f_] := &#xD;
     Module[{coords, newCoords, lines, gr, orderPoints, fun},&#xD;
      coords = MeshCoordinates[mr];&#xD;
      newCoords = f /@ coords;&#xD;
      lines = MeshCells[mr, 1] /. &#xD;
        Region`Mesh`Quadratic[Line[{p1_, p2_, _}]] :&amp;gt; Line[{p1, p2}];&#xD;
      (* order points *)&#xD;
      gr = Graph[UndirectedEdge @@@ lines[[All, 1]]];&#xD;
      orderPoints = FindHamiltonianPath[gr];&#xD;
      fun = BSplineFunction[Append[#, First[#]] &amp;amp;@newCoords[[orderPoints]],&#xD;
        SplineDegree -&amp;gt; 3 (* could use  SplineClosed \[Rule] True *)];&#xD;
      Line[Table[fun[s], {s, 0, 1, 1/360}]] ]&#xD;
&#xD;
    makeFilledCurve[mr_MeshRegion, f_, {col1_, col2_}] := &#xD;
     Module[{cmcs, cmcs3},&#xD;
      cmcs = ConnectedMeshComponents[RegionBoundary[mr]];&#xD;
      Which[Length[cmcs] === 1, {col1, &#xD;
        FilledCurve[{makeClosedCurve[cmcs[[1]], f]}]},&#xD;
                   Length[cmcs] &amp;gt; 1,&#xD;
                    cmcs3 =  Reverse[SortBy[cmcs, ArcLength]];&#xD;
                   {col1, FilledCurve[ makeClosedCurve[cmcs3[[1]], f]], &#xD;
                    col2, FilledCurve[makeClosedCurve[#, f]] &amp;amp; /@ Rest[cmcs3]}&#xD;
                ]]&#xD;
&#xD;
Two examples. With and without holes.&#xD;
&#xD;
    {Graphics[makeFilledCurve[chars[[5]], Identity, {Red, Blue}]],&#xD;
     Graphics[makeFilledCurve[chars[[5]], -CubeRoot[#] &amp;amp;, {Red, Blue}]]}&#xD;
&#xD;
![enter image description here][32]&#xD;
&#xD;
{Graphics[makeFilledCurve[chars[[1]], Identity, {Red, Blue}]],&#xD;
 Graphics[makeFilledCurve[chars[[1]], -CubeRoot[#] &amp;amp;, {Red, Blue}]]}&#xD;
&#xD;
![enter image description here][33]&#xD;
&#xD;
##Construct the Initial Conditions for the Diffusion Equation##&#xD;
&#xD;
To get some kind of randomness, we construct a random wavy function that determines the initial height of the characters. The height represents the initial &amp;#039;ink concentration&amp;#039;. This means by using different concrete realizations of the function wavy will result in different final diffused word clouds.&#xD;
&#xD;
Here is a plot of the initial concentration within the bounding rectangle as well as in the Alma Mater.&#xD;
&#xD;
    SeedRandom[40];&#xD;
    wavy[{x_, y_}] = &#xD;
      With[{S = 1000, M = 12}, &#xD;
       Sum[RandomReal[{-1, 1}] Cos[x/S RandomReal[{-M, M}] +&#xD;
             2 Pi RandomReal[]] Cos[&#xD;
           y/S RandomReal[{-M, M}] + 2 Pi RandomReal[]], {6}]^2];&#xD;
    &#xD;
    {Plot3D[wavy[{x, y}], {x, 300, 1100}, {y, 530, 1600}, MeshFunctions -&amp;gt; {#3 &amp;amp;},&#xD;
       PlotPoints -&amp;gt; 40, PlotRange -&amp;gt; All,&#xD;
      BoxRatios -&amp;gt; {758, 1065, 300}, ImageSize -&amp;gt; 360],&#xD;
     Plot3D[wavy[{x, y}], {x, y} \[Element] Polygon[almaMater], &#xD;
      MeshFunctions -&amp;gt; {#3 &amp;amp;}, PlotPoints -&amp;gt; 40, PlotRange -&amp;gt; All, &#xD;
      BoxRatios -&amp;gt; {758, 1065, 300}, ImageSize -&amp;gt; 360]}&#xD;
![enter image description here][34]&#xD;
&#xD;
    triangleIntegrate[f_] := (f /@ centroids).areas &#xD;
    &#xD;
    maxDist = 190;&#xD;
&#xD;
We will construct such initial conditions, that the total concentration of the characters equals the (negative) concentration in all the space between the characters. This will allow for a nice filling flow, without flowing out of the outer region.&#xD;
&#xD;
We avoid sharp corners in the initial conditions and smooth the concentration at the boundaries of the characters. &#xD;
&#xD;
    (* area of the characters and their smoothed boundaries *)&#xD;
    &#xD;
    H1[{x_Real, y_Real}] := &#xD;
    With[{d = rd[{x, y}], ? = 3}, &#xD;
    wavy[{x, y}] Which[d == 0, 1, d &amp;gt; ?, 0, True, &#xD;
    Cos[d/? Pi/2]^2]]&#xD;
&#xD;
    &#xD;
    ?m = triangleIntegrate[H1]&#xD;
&#xD;
&amp;gt; 124522.&#xD;
&#xD;
(* area between the characters *)&#xD;
&#xD;
    H2[{x_Real, y_Real}] := &#xD;
     With[{d = rd[{x, y}], ? = 3, d2 = -srd[{x, y}]}, &#xD;
      Which[d == 0, 0, d &amp;lt;= ?, 0 Cos[d/? Pi/2]^2, d &amp;gt;= ?, &#xD;
       Sin[d2/maxDist Pi/2]^.5]]&#xD;
    &#xD;
    ?2m = triangleIntegrate[H2]&#xD;
&#xD;
&amp;gt; 108853.&#xD;
&#xD;
    factorB = B /. Solve[?m == B ?2m, B][[1]]&#xD;
&#xD;
&amp;gt; 1.14395&#xD;
&#xD;
We compensate the positive concentration of the characters with a negative one between the characters. We do shape the negative concentration in a bathtub-shaped like manner with the value zero at the boundary.&#xD;
&#xD;
    H3[{x_Real, y_Real}] := &#xD;
     With[{d = rd[{x, y}], ? = 3, d2 = -srd[{x, y}]}, &#xD;
      Which[d == 0, wavy[{x, y}], d &amp;lt;= ?, &#xD;
       wavy[{x, y}] Cos[d/? Pi/2]^2, &#xD;
       True, -factorB Abs[Sin[d2/maxDist Pi/2]]^.5]]&#xD;
&#xD;
The integrals of the positive and negative concentrations even out to a high degree.&#xD;
&#xD;
    triangleIntegrate[H3]&#xD;
&#xD;
&amp;gt; -1.45519*10^-11&#xD;
&#xD;
Here is a plot of the initial concentration for the diffusion equation within the Alma Mater.&#xD;
&#xD;
    Plot3D[Evaluate[H3[{x, y}]], {x, y} ? em, PlotRange -&amp;gt; All,&#xD;
     MeshFunctions -&amp;gt; {#3 &amp;amp;}, PlotPoints -&amp;gt; 80, ImageSize -&amp;gt; 500]&#xD;
&#xD;
![enter image description here][35]&#xD;
&#xD;
##Deciding on the Boundary Conditions ##&#xD;
&#xD;
To solve the diffusion equation, we also need boundary conditions of the domain (at the boundary of the Alma Mater). To decide between Dirichlet and Neumann conditions, we solve a simple 1D model. The two gray lines show the path of the two points at the edge of the initial concentration bump.&#xD;
&#xD;
    Manipulate[&#xD;
     Module[{nds, U, V},&#xD;
      nds =&#xD;
       NDSolveValue[{If[method == &amp;#034;Neumann&amp;#034;,&#xD;
          D[U[t, x], t] - D[U[t, x], {x, 2}] == NeumannValue[v, True],&#xD;
          Sequence @@ {D[U[t, x], t] - D[U[t, x], {x, 2}] == 0, &#xD;
            DirichletCondition[U[t, x] == v, True]}],&#xD;
                                   &#xD;
         U[0, x] == If[Abs[x] &amp;lt; Pi/2, H  Cos[x]^2, 1]},&#xD;
                                     U , {x, -Pi, Pi}, {t, 0, 5},&#xD;
        Method -&amp;gt; {&amp;#034;PDEDiscretization&amp;#034; -&amp;gt; {&amp;#034;MethodOfLines&amp;#034;, &#xD;
                                &#xD;
            &amp;#034;SpatialDiscretization&amp;#034; -&amp;gt; { &amp;#034;FiniteElement&amp;#034;,  &#xD;
                                      &#xD;
              &amp;#034;MeshOptions&amp;#034; -&amp;gt; {&amp;#034;MaxCellMeasure&amp;#034; -&amp;gt; 0.01}}}}];&#xD;
      V  = Function[{t, x}, Evaluate[D[nds[t, x], x]/nds[t, x]]]; &#xD;
      With[{nds1 = nds, V1 = V},&#xD;
       Manipulate[ &#xD;
        Module[{nds2R, nds2L},&#xD;
         Column[{Plot[nds1[?, ?], {?, -Pi, Pi}, &#xD;
            AxesLabel -&amp;gt; {Style[&amp;#034;x&amp;#034;, Italic], Style[&amp;#034;u&amp;#034;, Italic]}, &#xD;
                                              &#xD;
            PlotLabel -&amp;gt; Row[{Style[&amp;#034;t&amp;#034;, Italic], &amp;#034;=&amp;#034;, ?}]],&#xD;
           Plot3D[nds1[s, ?], {?, -Pi, Pi}, {s, 0, ?}, &#xD;
            MeshFunctions -&amp;gt; {#3 &amp;amp;}, &#xD;
            AxesLabel -&amp;gt; {Style[&amp;#034;x&amp;#034;, Italic], Style[&amp;#034;t&amp;#034;, Italic], &#xD;
              Style[&amp;#034;u&amp;#034;, Italic]} ],&#xD;
                          &#xD;
           nds2R = NDSolveValue[{X&amp;#039;[s] == V1[s, X[s]], X[0] == +Pi/2}, &#xD;
             X, {s, 0, ?}];&#xD;
                          &#xD;
           nds2L = NDSolveValue[{X&amp;#039;[s] == V1[s, X[s]], X[0] == -Pi/2}, &#xD;
             X, {s, 0, ?}];&#xD;
                          &#xD;
           ParametricPlot[&#xD;
            Evaluate[{{nds2L[s], s}, {nds2R[s], s}}], {s, 0, ?},&#xD;
                                                            &#xD;
            AxesLabel -&amp;gt; {Style[&amp;#034;x&amp;#034;, Italic], Style[&amp;#034;t&amp;#034;, Italic]},&#xD;
                                                           &#xD;
            PlotStyle -&amp;gt; Gray,&#xD;
                                                          &#xD;
            AspectRatio -&amp;gt; 1/GoldenRatio, PlotRange -&amp;gt; {{-Pi, Pi}, All}]&#xD;
                }]],&#xD;
        {{?, 1}, 0, 5, Appearance -&amp;gt; &amp;#034;Labeled&amp;#034;}, &#xD;
        TrackedSymbols :&amp;gt; {?}]]],&#xD;
     {{method, &amp;#034;Neumann&amp;#034;}, {&amp;#034;Neumann&amp;#034;, &amp;#034;Dirichlet&amp;#034;}}, &#xD;
     {{v, 1, &amp;#034;boundary condition value&amp;#034;} , -3, 3, Appearance -&amp;gt; &amp;#034;Labeled&amp;#034;},&#xD;
     {{H, 2, &amp;#034;initial bump height&amp;#034;}, -3, 3, Appearance -&amp;gt; &amp;#034;Labeled&amp;#034;},&#xD;
     TrackedSymbols :&amp;gt; {method, v, H}, SaveDefinitions -&amp;gt; True]&#xD;
&#xD;
![enter image description here][36]&#xD;
&#xD;
After some playing around one sees that Neumann boundary conditions with positive values seem to be a good choice to spread out the concentration out up to the outer boundary.&#xD;
&#xD;
##Solve the Diffusion Equation with Neumann Boundary Conditions##&#xD;
&#xD;
Now we solve the diffusion equation numerically. An appropriate value for the diffusion coefficient Subscript[c, D] and corresponding total integration time t can be found after some experimentation or some crude estimation based on the classic formula $?|{x,y}|^2??4c_Dt.$&#xD;
&#xD;
    cD = 50;&#xD;
    uSolN = NDSolveValue[{D[n[t, x, y], t] - cD Laplacian[n[t, x, y], {x, y}] == &#xD;
         NeumannValue[1, True],&#xD;
         n[0, x, y] == 1 + H3[{x, y}]},&#xD;
       n, {x, y} ? em, {t, 0, 100}, PrecisionGoal -&amp;gt; 5] // Quiet&#xD;
&#xD;
![enter image description here][37]&#xD;
&#xD;
Here are a few plots of the concentration at various times (we show the concentration for t=0.01, t=0.5, t=5, and t=50). With increasing time the concentration differences even out. And the character shapes slowly disappear.&#xD;
&#xD;
    concentrationPlot[t_] := &#xD;
     Plot3D[Evaluate[uSolN[t, x, y]], {x, y} \[Element] em, PlotRange -&amp;gt; All,&#xD;
      MeshFunctions -&amp;gt; {#3 &amp;amp;}, PlotPoints -&amp;gt; 80, ImageSize -&amp;gt; 500]&#xD;
&#xD;
    concentrationPlot[0.01]&#xD;
&#xD;
![enter image description here][38]&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
    concentrationPlot[0.5]&#xD;
&#xD;
![enter image description here][39]&#xD;
&#xD;
    concentrationPlot[5]&#xD;
![enter image description here][40]&#xD;
&#xD;
    concentrationPlot[50]&#xD;
&#xD;
![enter image description here][41]&#xD;
&#xD;
##Calculate the Flow Field##&#xD;
&#xD;
But we are not interested in the concentration itself, but rather in the integrals of the flow of the concentration.&#xD;
&#xD;
The flow vector field can be easily obtained by differentiating the interpolating function that represents the diffusion equation solution with respect to the coordinates.&#xD;
&#xD;
    vX[t_, x_Real, y_Real] = -D[uSolN[t, x, y], x]/uSolN[t, x, y]&#xD;
&#xD;
![enter image description here][42]&#xD;
&#xD;
    vY[t_, x_Real, y_Real] = -D[uSolN[t, x, y], y]/uSolN[t, x, y]&#xD;
&#xD;
![enter image description here][43]&#xD;
&#xD;
Here is a plot of the direction of the flow at t=0.1 and at the much later time t=10. Each color represent a flow direction.&#xD;
&#xD;
    colF = If[# == 10, White, &#xD;
        ColorData[&amp;#034;VisibleSpectrum&amp;#034;][380 + 370 (#1 + Pi)/(2 Pi)]] &amp;amp;;&#xD;
    &#xD;
    vectorGrid[T_] := With[{t = T, pp = 800},&#xD;
       Monitor[ &#xD;
        Table[If[srd[{x, y}] &amp;gt;= 0, 10, &#xD;
          ArcTan[vX[t, 1. x, 1. y], vY[t, 1. x, 1. y]]],&#xD;
                     {y, 0, 1100, 1100/pp}, {x, 0, 800, 800/pp}],&#xD;
        N[y]]] /. Indeterminate -&amp;gt; 0.&#xD;
    &#xD;
    ReliefPlot[vectorGrid[0.1], ColorFunction -&amp;gt; colF,&#xD;
     ColorFunctionScaling -&amp;gt; False, AspectRatio -&amp;gt; Automatic, Frame -&amp;gt; False]&#xD;
&#xD;
![enter image description here][44]&#xD;
&#xD;
&#xD;
&#xD;
    ReliefPlot[vectorGrid[10], ColorFunction -&amp;gt; colF,&#xD;
     ColorFunctionScaling -&amp;gt; False, AspectRatio -&amp;gt; Automatic, Frame -&amp;gt; False]&#xD;
&#xD;
![enter image description here][45]&#xD;
&#xD;
Here is a line integral convolution plot that shows the flow at some early time.&#xD;
&#xD;
    vectors =&#xD;
      With[{t = 0.1, pp = 600},&#xD;
       Monitor[&#xD;
        Table[If[&#xD;
          srd[{x, y}] &amp;gt; 0, {0, 0}, {vX[t, 1. x, 1. y], vY[t, 1. x, 1. y]}],&#xD;
                     {y, 0, 1100, 1100/pp}, {x, 0, 800, 800/pp}],&#xD;
        N[y]]];&#xD;
    &#xD;
    ListLineIntegralConvolutionPlot[Map[Normalize, Transpose@vectors, {2}],&#xD;
     PerformanceGoal -&amp;gt; &amp;#034;Quality&amp;#034;,&#xD;
     RasterSize -&amp;gt; 600, LineIntegralConvolutionScale -&amp;gt; 20,&#xD;
     AspectRatio -&amp;gt; 11/8, Frame -&amp;gt; False] &#xD;
&#xD;
![enter image description here][46]&#xD;
&#xD;
##Diffuse the Characters of the Words##&#xD;
&#xD;
For a few characters (M=20), we calculate their time evolution under the diffusion. To be time-efficient, we only diffuse/propagate the boundary points, rather than all interior points. The above-defined function makeFilledCurve will then reconstruct the full character. We use the &amp;#034;StiffnessSwitching&amp;#034; option for calculating along the flow lines to avoid getting stuck at potential abrupt function value changes.&#xD;
&#xD;
    M = 20;  &#xD;
    Monitor[ &#xD;
      ptsA =&#xD;
       Table[pts = MeshPrimitives[RegionBoundary[chars[[m]]], {0}];&#xD;
                     ? = Length[pts];&#xD;
        Table[NDSolveValue[{x&amp;#039;[t] == cD vX[t, x[t], y[t]], &#xD;
                                                  &#xD;
           y&amp;#039;[t] == cD vY[t, x[t], y[t]],&#xD;
                                                  x[0] == pts[[j, 1, 1]], &#xD;
           y[0] == pts[[j, 1, 2]]},&#xD;
                                                    {x[t], y[t]},  {t, 0, &#xD;
           80},&#xD;
                         PrecisionGoal -&amp;gt; 3, StartingStepSize -&amp;gt; 10^-4,&#xD;
                        MaxSteps -&amp;gt; 10000, &#xD;
          Method -&amp;gt; &amp;#034;StiffnessSwitching&amp;#034;] ,&#xD;
                    {j, ?}],&#xD;
        {m, M}], &#xD;
      {m, {j, ?}}];&#xD;
&#xD;
Some examples of the propagated/diffused boundaries of the characters. The points of the boundaries are connected by line segments. To obtain smoother-looking curves, we will use splines in the final graphics. Early times are blue and later times are more red-like. The expansion of the characters is clearly visible.&#xD;
&#xD;
    Table[Show[Table[MeshRegion[ptsA[[k]] /. t -&amp;gt; 10^?, &#xD;
            Style[MeshCells[RegionBoundary[chars[[k]]], 1], &#xD;
         ColorData[&amp;#034;ThermometerColors&amp;#034;][(? + 3)/5]]],&#xD;
         {?, -3, 1, 0.1}], ImageSize -&amp;gt; 140], {k, 9}]&#xD;
&#xD;
![enter image description here][47]&#xD;
&#xD;
&#xD;
The following Manipulate allows to change the time, and so the character shape, interactively.&#xD;
&#xD;
    Manipulate[&#xD;
     Show[Table[&#xD;
        MeshRegion[ptsA[[m]] /. t -&amp;gt; ?, &#xD;
         MeshCells[RegionBoundary[chars[[m]]], 1]], {m, M}],&#xD;
       PlotRange -&amp;gt; {{100, 800}, {100, 1000}}, ImageSize -&amp;gt; 400] // &#xD;
      Quiet, {?, 0, 50}]&#xD;
&#xD;
&#xD;
##Make the Dense Word Cloud(s)##&#xD;
&#xD;
Now we have all ingredients together to make a dense word cloud. We define a function that diffuses/propagates a point forward in time.&#xD;
&#xD;
    diffusionMove[{x0_, y0_}, T_] := #[T] &amp;amp; /@&#xD;
      &#xD;
      NDSolveValue[{x&amp;#039;[t] == cD vX[t, x[t], y[t]], &#xD;
                                    y&amp;#039;[t] == cD vY[t, x[t], y[t]],&#xD;
                                    x[0] == x0, y[0] == y0},&#xD;
                        {x, y},  {t, T, T}, MaxStepSize -&amp;gt; 0.1,&#xD;
                      PrecisionGoal -&amp;gt; 3, StartingStepSize -&amp;gt; 10^-4,&#xD;
                     MaxSteps -&amp;gt; 500000, Method -&amp;gt; &amp;#034;StiffnessSwitching&amp;#034;]&#xD;
&#xD;
    outline = makeClosedCurve[RegionBoundary[mr], Identity];&#xD;
    &#xD;
    rnA = RegionNearest[RegionBoundary@mr];&#xD;
    fix[{x_, y_}] := If[srd[{x, y}] &amp;lt;= 0, {x, y}, rnA[{x, y}]]&#xD;
    fix[Line[l_]] := Line[fix /@ l]&#xD;
&#xD;
The function makeFlowImage generates a word cloud of the diffused-out characters at time t.&#xD;
&#xD;
    makeFlowImage[T_] := &#xD;
     Module[{mfc},&#xD;
      Monitor[&#xD;
       allCharsD = &#xD;
         Table[Check[mfc = makeFilledCurve[chars[[k]], diffusionMove[#, T] &amp;amp;,    &#xD;
                            {RGBColor @@ charColors[[k, 1]], LightBlue}],&#xD;
                                                       &#xD;
           mfc /. l_Line :&amp;gt; fix[l]],   {k, Length[chars]}];,&#xD;
       Text@Row[{&amp;#034;Calculating diffusion shape for character &amp;#034;, k, &amp;#034; from &amp;#034;, &#xD;
          Length[chars], &amp;#034; characters.&amp;#034;}]]; &#xD;
      Graphics[{LightBlue, FilledCurve[outline], Black, outline, allCharsD}, &#xD;
       ImageSize -&amp;gt; 600]];&#xD;
&#xD;
Looping over all boundary points of all characters shows how the characters spread out over time and fill the void to the Alma Mater boundary and between the characters and words.&#xD;
&#xD;
Here are the outlines of the characters at various times.&#xD;
&#xD;
    makeFlowImage[0.5]&#xD;
&#xD;
![enter image description here][48]&#xD;
&#xD;
    makeFlowImage[1]&#xD;
![enter image description here][49]&#xD;
&#xD;
    makeFlowImage[5]&#xD;
&#xD;
![enter image description here][50]&#xD;
&#xD;
    makeFlowImage[10]&#xD;
&#xD;
![enter image description here][51]&#xD;
&#xD;
    makeFlowImage[20]&#xD;
![enter image description here][52]&#xD;
&#xD;
    makeFlowImage[50]&#xD;
&#xD;
![enter image description here][53]&#xD;
&#xD;
    makeFlowImage[100]&#xD;
&#xD;
![enter image description here][54]&#xD;
&#xD;
&#xD;
  [1]: http://blog.wolfram.com/2018/01/18/running-the-numbers-with-the-illinois-marathon-viewer/&#xD;
  [2]: https://www.wolframcloud.com/objects/marathon/IL/Champaign/2017/MarathonViewer&#xD;
  [3]: http://illinoismarathon.com/&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=43611.png&amp;amp;userId=20103&#xD;
  [5]: https://en.wikipedia.org/wiki/Alma_Mater_%28Illinois_sculpture%29&#xD;
  [6]: http://fightingillini.com/sports/2015/11/10/traditions_orangeandblue.aspx&#xD;
  [7]: http://www.pnas.org/content/101/20/7499.full&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=61732.png&amp;amp;userId=20103&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=90303.png&amp;amp;userId=20103&#xD;
  [10]: http://community.wolfram.com//c/portal/getImageAttachment?filename=70474.png&amp;amp;userId=20103&#xD;
  [11]: http://community.wolfram.com//c/portal/getImageAttachment?filename=9013ScreenShot2018-04-02at13.00.56.png&amp;amp;userId=20103&#xD;
  [12]: https://www.youtube.com/watch?v=7ioYnpeHBJE&amp;amp;feature=youtu.be&#xD;
  [13]: http://community.wolfram.com//c/portal/getImageAttachment?filename=43165.png&amp;amp;userId=20103&#xD;
  [14]: http://community.wolfram.com//c/portal/getImageAttachment?filename=74246.png&amp;amp;userId=20103&#xD;
  [15]: http://community.wolfram.com//c/portal/getImageAttachment?filename=63597.png&amp;amp;userId=20103&#xD;
  [16]: http://community.wolfram.com//c/portal/getImageAttachment?filename=42148.png&amp;amp;userId=20103&#xD;
  [17]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-04-02at10.13.07.png&amp;amp;userId=20103&#xD;
  [18]: http://community.wolfram.com//c/portal/getImageAttachment?filename=96899.png&amp;amp;userId=20103&#xD;
  [19]: http://community.wolfram.com//c/portal/getImageAttachment?filename=x1.png&amp;amp;userId=20103&#xD;
  [20]: http://community.wolfram.com//c/portal/getImageAttachment?filename=824510.png&amp;amp;userId=20103&#xD;
  [21]: http://community.wolfram.com//c/portal/getImageAttachment?filename=678711.png&amp;amp;userId=20103&#xD;
  [22]: http://community.wolfram.com//c/portal/getImageAttachment?filename=612512.png&amp;amp;userId=20103&#xD;
  [23]: http://community.wolfram.com//c/portal/getImageAttachment?filename=606313.png&amp;amp;userId=20103&#xD;
  [24]: http://community.wolfram.com//c/portal/getImageAttachment?filename=666514.png&amp;amp;userId=20103&#xD;
  [25]: http://community.wolfram.com//c/portal/getImageAttachment?filename=808015.png&amp;amp;userId=20103&#xD;
  [26]: http://community.wolfram.com//c/portal/getImageAttachment?filename=669516.png&amp;amp;userId=20103&#xD;
  [27]: http://community.wolfram.com//c/portal/getImageAttachment?filename=610517.png&amp;amp;userId=20103&#xD;
  [28]: http://identitystandards.illinois.edu/graphicstandardsmanual/generalguidelines/colors.html&#xD;
  [29]: http://community.wolfram.com//c/portal/getImageAttachment?filename=648518.png&amp;amp;userId=20103&#xD;
  [30]: http://community.wolfram.com//c/portal/getImageAttachment?filename=952619.png&amp;amp;userId=20103&#xD;
  [31]: http://community.wolfram.com//c/portal/getImageAttachment?filename=232920.png&amp;amp;userId=20103&#xD;
  [32]: http://community.wolfram.com//c/portal/getImageAttachment?filename=972621.png&amp;amp;userId=20103&#xD;
  [33]: http://community.wolfram.com//c/portal/getImageAttachment?filename=741422.png&amp;amp;userId=20103&#xD;
  [34]: http://community.wolfram.com//c/portal/getImageAttachment?filename=320623.png&amp;amp;userId=20103&#xD;
  [35]: http://community.wolfram.com//c/portal/getImageAttachment?filename=278824.png&amp;amp;userId=20103&#xD;
  [36]: http://community.wolfram.com//c/portal/getImageAttachment?filename=865425.png&amp;amp;userId=20103&#xD;
  [37]: http://community.wolfram.com//c/portal/getImageAttachment?filename=243726.png&amp;amp;userId=20103&#xD;
  [38]: http://community.wolfram.com//c/portal/getImageAttachment?filename=179227.png&amp;amp;userId=20103&#xD;
  [39]: http://community.wolfram.com//c/portal/getImageAttachment?filename=766428.png&amp;amp;userId=20103&#xD;
  [40]: http://community.wolfram.com//c/portal/getImageAttachment?filename=468129.png&amp;amp;userId=20103&#xD;
  [41]: http://community.wolfram.com//c/portal/getImageAttachment?filename=166030.png&amp;amp;userId=20103&#xD;
  [42]: http://community.wolfram.com//c/portal/getImageAttachment?filename=388031.png&amp;amp;userId=20103&#xD;
  [43]: http://community.wolfram.com//c/portal/getImageAttachment?filename=285132.png&amp;amp;userId=20103&#xD;
  [44]: http://community.wolfram.com//c/portal/getImageAttachment?filename=637133.png&amp;amp;userId=20103&#xD;
  [45]: http://community.wolfram.com//c/portal/getImageAttachment?filename=181734.png&amp;amp;userId=20103&#xD;
  [46]: http://community.wolfram.com//c/portal/getImageAttachment?filename=115535.png&amp;amp;userId=20103&#xD;
  [47]: http://community.wolfram.com//c/portal/getImageAttachment?filename=445136.png&amp;amp;userId=20103&#xD;
  [48]: http://community.wolfram.com//c/portal/getImageAttachment?filename=981937.png&amp;amp;userId=20103&#xD;
  [49]: http://community.wolfram.com//c/portal/getImageAttachment?filename=793338.png&amp;amp;userId=20103&#xD;
  [50]: http://community.wolfram.com//c/portal/getImageAttachment?filename=985739.png&amp;amp;userId=20103&#xD;
  [51]: http://community.wolfram.com//c/portal/getImageAttachment?filename=365640.png&amp;amp;userId=20103&#xD;
  [52]: http://community.wolfram.com//c/portal/getImageAttachment?filename=729441.png&amp;amp;userId=20103&#xD;
  [53]: http://community.wolfram.com//c/portal/getImageAttachment?filename=496942.png&amp;amp;userId=20103&#xD;
  [54]: http://community.wolfram.com//c/portal/getImageAttachment?filename=471943.png&amp;amp;userId=20103</description>
    <dc:creator>Michael Trott</dc:creator>
    <dc:date>2018-04-02T16:52:14Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/355110">
    <title>Transform an image into a region and compute on it</title>
    <link>https://community.wolfram.com/groups/-/m/t/355110</link>
    <description>Imagine you have an irregular image like this:&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
How would you solve a differential equation or compute an integral over a region of this shape? &#xD;
&#xD;
First, let&amp;#039;s get the boundary:&#xD;
&#xD;
    i = Import[&amp;#034;http://wolfr.am/ZS7ERg&amp;#034;];&#xD;
    edge = EdgeDetect[ColorNegate[i]]&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
It is now easy to extract points with `Position` but how to order them inside `Polygon` correctly along the boundary? Using `FindShortestTour`! - a trick I learned from this excellent post: [Find polygons corresponding to image borders][3] &#xD;
&#xD;
    reg = MeshRegion[#, Polygon[Last[FindShortestTour[#]]]] &amp;amp;@ Position[ImageData[edge], 1]&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
Now we are ready to have fun:&#xD;
&#xD;
    Plot3D[Cos[.0002 ((x - 215)^2 + (y - 215)^2)]^2, {x, y} \[Element] reg, &#xD;
    Mesh -&amp;gt; None, Filling -&amp;gt; -3, FillingStyle -&amp;gt; Red, PlotRange -&amp;gt; All, BoxRatios -&amp;gt; {1, 1, 1/3}]&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
    uif = NDSolveValue[{\!\(\*SubsuperscriptBox[\(\[Del]\), \({x, y}\), \(2\)]\(u[x, y]\)\) == 0, &#xD;
        DirichletCondition[u[x, y] == 1/2 + Sin[.0001 x y] , True]}, u, {x, y} \[Element] reg];&#xD;
    &#xD;
    ContourPlot[uif[x, y], {x, y} \[Element] reg, PlotPoints -&amp;gt; 50, &#xD;
     ContourStyle -&amp;gt; Opacity[.2], Contours -&amp;gt; 50, ColorFunction -&amp;gt; &amp;#034;Rainbow&amp;#034;]&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
&#xD;
  [1]: /c/portal/getImageAttachment?filename=sdfgewr456.png&amp;amp;userId=11733&#xD;
  [2]: /c/portal/getImageAttachment?filename=sdfgghr678596454.png&amp;amp;userId=11733&#xD;
  [3]: http://community.wolfram.com/groups/-/m/t/235551&#xD;
  [4]: /c/portal/getImageAttachment?filename=sdfs4563gndfgert.png&amp;amp;userId=11733&#xD;
  [5]: /c/portal/getImageAttachment?filename=asdas2343254678656fdgsdas.png&amp;amp;userId=11733&#xD;
  [6]: /c/portal/getImageAttachment?filename=345dfg54tgdfg456tdsf.png&amp;amp;userId=11733</description>
    <dc:creator>Vitaliy Kaurov</dc:creator>
    <dc:date>2014-09-25T18:50:52Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3137899">
    <title>Finding roots of multivariable function</title>
    <link>https://community.wolfram.com/groups/-/m/t/3137899</link>
    <description>I have a real-valued function of four variables, namely $L[\phi, m0, m1, m2]$. I am interested in taking the partial derivative $\partial_{\phi}L$ thereof and setting the partial derivative to zero, that is $\partial_{\phi}L = 0$. Then solving for $\phi \in [0,2\pi]$ in terms of $m0, m1, m2 \in &#xD;
\mathbb{N}_{0}$. I have reached the point in the attached code where I have generated the partial derivative $\partial_{\phi}L$, but I am having difficulty setting the partial derivative to zero and getting an analytic expression for $\phi$ in terms of the other variables $m0,~m1$ and $m2$. Please advise if there is a clear way of doing this analytically and numerically. &#xD;
&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
Just a note that the function $L[\phi, m0, m1, m2]$ is defined in terms of probabilities $P1, P2$ and $P3$, hence it has a real-valued output for any $\phi \in \mathbb{R}$. Link to [related Mathematica SE post][2].&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/8a8e8c5b-b040-4954-bc13-f6fd943d5026&#xD;
  [2]: https://mathematica.stackexchange.com/questions/300241/solving-multivariable-equation-after-setting-partial-derivative-to-zero?noredirect=1#comment739470_300241</description>
    <dc:creator>Byron Alexander</dc:creator>
    <dc:date>2024-03-09T14:21:21Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/932742">
    <title>[?] NSolve[2x== 0,x] return {{}} in Mathematica 11.0.1?</title>
    <link>https://community.wolfram.com/groups/-/m/t/932742</link>
    <description>I just upgraded to Mathematica 11.0.1 and ran into a problem with NSolve. The following simplified example illustrates it:&#xD;
&#xD;
    NSolve[  2 x == 0, x]&#xD;
&#xD;
This returns {{}}&#xD;
&#xD;
Anyone else having this problem? I am running Mathematica on Ubuntu 16.04 64 bit.&#xD;
&#xD;
Gijsbert</description>
    <dc:creator>Gijsbert Wiesenekker</dc:creator>
    <dc:date>2016-10-02T19:01:41Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3499774">
    <title>Modeling airflow past a car</title>
    <link>https://community.wolfram.com/groups/-/m/t/3499774</link>
    <description>&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/3ee8e0d5-9a50-4ab1-9f50-db5a5f804d17</description>
    <dc:creator>David Keith</dc:creator>
    <dc:date>2025-07-10T18:06:30Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2466894">
    <title>[GiF] Animating the Lorenz attractor with thousands of initial conditions</title>
    <link>https://community.wolfram.com/groups/-/m/t/2466894</link>
    <description>*MODERATOR NOTE: a submission to computations art contest, see more:* https://wolfr.am/CompArt-22  &#xD;
*check the particle&amp;#039;s point of view version here:* https://community.wolfram.com/groups/-/m/t/2543566&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
&#xD;
&amp;gt; YouTube video: https://youtu.be/DI504zatHCI &#xD;
&#xD;
&amp;gt; Twitter post: https://twitter.com/bencbartlett/status/1440039445261029377&#xD;
&#xD;
&amp;gt; Math animations collection: https://muon.people.stanford.edu/math-animations&#xD;
&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ezgif-3-3cf45e6291.gif&amp;amp;userId=20103&#xD;
  [2]: https://www.wolframcloud.com/obj/38e945bc-a797-4c7f-844a-1ebceb6b150a</description>
    <dc:creator>Ben Bartlett</dc:creator>
    <dc:date>2022-02-08T18:42:06Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2153362">
    <title>3D Helmholtz resonance in the violin body with f-holes</title>
    <link>https://community.wolfram.com/groups/-/m/t/2153362</link>
    <description>*Wolfram notebook is attached at the end of the post.*&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
This post is about FEM simulation of violin vibration modes in 3D. As well known there are Helmholtz resonances of air inside the violin body with frequencies dependent on geometry of f-holes. This is the main reason why violin has so pronounced sound. To simulate these modes with Mathematica FEM we first define the body geometry (this is my design with given volume and area of f-holes, but it taken from the real violin):&#xD;
&#xD;
    xy = {{3.805405405405406`,3.34954954954955`},{3.8252252252252257`,6.6990990990991`},{3.9441441441441443`,7.9081081081081095`},&#xD;
    {4.47927927927928`,8.601801801801802`},{5.014414414414414`,8.264864864864865`},{4.816216216216216`,7.8882882882882885`},&#xD;
    {4.895495495495496`,7.630630630630631`},{5.232432432432433`,7.432432432432433`},{5.47027027027027`,7.491891891891892`},&#xD;
    {5.648648648648649`,7.8882882882882885`},{5.668468468468468`,8.046846846846847`},{5.56936936936937`,8.403603603603605`},&#xD;
    {5.252252252252252`,8.681081081081082`},{4.855855855855856`,8.780180180180182`},{4.518918918918919`,8.8`},&#xD;
    {3.9639639639639643`,8.522522522522523`},{3.567567567567568`,7.967567567567568`},{3.3693693693693696`,7.372972972972973`},&#xD;
    {3.2306306306306305`,6.67927927927928`},{3.1513513513513516`,3.3693693693693696`},{3.1513513513513516`,2.655855855855856`},&#xD;
    {2.9729729729729732`,1.783783783783784`},{2.8738738738738743`,1.4666666666666668`},{2.100900900900901`,0.7927927927927928`},&#xD;
    {1.7243243243243245`,1.3081081081081083`},{2.021621621621622`,1.7639639639639642`},{2.0414414414414415`,2.0414414414414415`},&#xD;
    {1.9621621621621623`,2.23963963963964`},{1.6648648648648652`,2.4378378378378383`},{1.4666666666666668`,2.5171171171171176`},&#xD;
    {1.10990990990991`,2.338738738738739`},{0.891891891891892`,1.9423423423423425`},{0.9315315315315316`,1.4072072072072073`},&#xD;
    {1.5657657657657658`,0.7927927927927928`},{2.081081081081081`,0.6342342342342343`},{2.5963963963963965`,0.7927927927927928`},&#xD;
    {3.0918918918918923`,1.2090090090090093`},{3.5081081081081082`,1.902702702702703`},{3.706306306306306`,2.6954954954954955`}};&#xD;
    &#xD;
    reg1 = RegionUnion[Disk[{0, 19.5/2}, 19.5/2], &#xD;
      Disk[{0, 36 - 15.5/2}, 15.5/2], &#xD;
      Rectangle[{-10, 15}, {10, 25}]]; reg2 = &#xD;
     RegionDifference[reg1, &#xD;
      RegionUnion[Disk[{-10, 20}, 9.5/2], Disk[{10, 20}, 9.5/2]]];&#xD;
    c0 = {0, 36 - 15.5/2}; c1 = {7.03562, 25}; &#xD;
    f[x_] := c0[[2]] + x (c1[[2]] - c0[[2]])/(c1[[1]] - c0[[1]]); r1 = &#xD;
     Norm[c1 - {10, f[10]}];&#xD;
    reg3 = RegionDifference[reg2, Disk[{10, f[10]}, r1]]; &#xD;
    f1[x_] := c0[[2]] - x (c1[[2]] - c0[[2]])/(c1[[1]] - c0[[1]]);&#xD;
    reg4 = RegionDifference[reg3, Disk[{-10, f1[-10]}, r1]]; c10 = {0, &#xD;
      19.5/2}; c11 = {8.215838362577491`, 15}; &#xD;
    f11[x_] := c10[[2]] + x (c11[[2]] - c10[[2]])/(c11[[1]] - c10[[1]]);&#xD;
    r2 = Norm[c11 - {10, f11[10]}];&#xD;
    reg5 = RegionDifference[reg4, Disk[{10, f11[10]}, r2]]; &#xD;
    f12[x_] := c10[[2]] - x (c11[[2]] - c10[[2]])/(c11[[1]] - c10[[1]]);&#xD;
    reg6 = RegionDifference[reg5, Disk[{-10, f12[-10]}, r2]]; p6 = &#xD;
     RegionPlot[reg6, AspectRatio -&amp;gt; Automatic];&#xD;
    fh[xf_, yf_] := &#xD;
      RegionUnion[&#xD;
       Polygon[Table[{xy[[i, 1]] - xf, xy[[i, 2]] + yf}, {i, &#xD;
          Length[xy]}]], &#xD;
       Polygon[Table[{-xy[[i, 1]] + xf, xy[[i, 2]] + yf}, {i, &#xD;
          Length[xy]}]]];&#xD;
General view of the violin body from the front and back side&#xD;
&#xD;
    Show[p6, Graphics[fh[7, 12], AspectRatio -&amp;gt; Automatic]] &#xD;
    dz = 3.79; reg8 = &#xD;
     ImplicitRegion[Element[{x, y}, reg6] &amp;amp;&amp;amp; 0 &amp;lt;= z &amp;lt;= dz, {x, y, z}];&#xD;
    mesh3d1 = DiscretizeRegion[reg8, {{-10, 10}, {0, 36}, {0, dz}}]&#xD;
    &#xD;
 ![Figure 1][2]   &#xD;
Next step is the computation of air modes in the violin body with using ` NDEigensystem[]` as follows &#xD;
&#xD;
    ca = 34321(*T=20C*); L = -Laplacian[u[x, y, z], {x, y, z}]; {vals, funs} = &#xD;
    NDEigensystem[{L, &#xD;
    DirichletCondition[u[x, y, z] == 0, &#xD;
    Element[{x, y}, fh[7, 11.49]] &amp;amp;&amp;amp; z == dz]}, u, &#xD;
    Element[{x, y, z}, mesh3d1], 15];&#xD;
&#xD;
 Finally we visualize  first 5 modes and the main mode in 3D &#xD;
&#xD;
    {Table[DensityPlot[funs[[i]][x, y, dz/2], {x, -10, 10}, {y, 0, 36}, &#xD;
      PlotRange -&amp;gt; All, PlotLabel -&amp;gt; ca Sqrt[vals[[i]]]/(2 Pi), &#xD;
      ColorFunction -&amp;gt; &amp;#034;Rainbow&amp;#034;, AspectRatio -&amp;gt; Automatic], {i, 1, &#xD;
      5}],&#xD;
     DensityPlot3D[&#xD;
     funs[[1]][x, y, z], {x, -10, 10}, {y, 0, 36}, {z, 0, dz}, &#xD;
     PlotRange -&amp;gt; All, PlotLabel -&amp;gt; ca Sqrt[vals[[1]]]/(2 Pi), &#xD;
     ColorFunction -&amp;gt; &amp;#034;Rainbow&amp;#034;, AspectRatio -&amp;gt; Automatic, &#xD;
     PlotLegends -&amp;gt; Automatic, PlotPoints -&amp;gt; 100, BoxRatios -&amp;gt; Automatic, &#xD;
     OpacityFunction -&amp;gt; None, Boxed -&amp;gt; False]} &#xD;
![Figure 2][3]&#xD;
Therefore the first mode of 440.033 Hz is close to &amp;#034;A4&amp;#034; (440 Hz) tone. But we expecting &amp;#034;C4&amp;#034; (261.626 Hz), or &amp;#034;C#4&amp;#034; (277.183 Hz). The main reason of this discrepancies could be the wood plate vibration from the back side. Thus we define mesh, parameters of the wood plate and modes as follows&#xD;
&#xD;
    dreg = DiscretizeRegion[reg6, {{-10, 10}, {0, 36}}, &#xD;
      MaxCellMeasure -&amp;gt; .05]&#xD;
    Y = 10.8*10^9; nu = 31/100; rho = 500; h = .003; d = &#xD;
     10^4 Sqrt[Y h^2/(12 rho (1 - nu^2))];Ld2 = {Laplacian[-d u[x, y], {x, y}] + &#xD;
        v[x, y], -d Laplacian[v[x, y], {x, y}]};&#xD;
    &#xD;
    {vals, funs} = &#xD;
      NDEigensystem[{Ld2, DirichletCondition[u[x, y] == 0, True]}, {u, v},&#xD;
        Element[{x, y}, dreg], 5];&#xD;
    &#xD;
    Table[DensityPlot[Re[funs[[i, 1]][x, y]], {x, y} \[Element] dreg, &#xD;
      PlotRange -&amp;gt; All, PlotLabel -&amp;gt; vals[[i]]/(2 Pi), &#xD;
      ColorFunction -&amp;gt; &amp;#034;Rainbow&amp;#034;, AspectRatio -&amp;gt; Automatic], {i, 2, &#xD;
      Length[vals]}]&#xD;
![Figure 3][4]&#xD;
Hence for wood plate we have mode of 259.394 Hz and it is close to C4 tone. &#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2021-01-04at1.47.31PM.jpg&amp;amp;userId=20103&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=bd9Wx.png&amp;amp;userId=1218692&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=w7dPm.png&amp;amp;userId=1218692&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=qb3HU.png&amp;amp;userId=1218692</description>
    <dc:creator>Alexander Trounev</dc:creator>
    <dc:date>2021-01-03T23:13:58Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/815125">
    <title>Multiplying 4x4 matrices with complicated elements - taking long time</title>
    <link>https://community.wolfram.com/groups/-/m/t/815125</link>
    <description>I&amp;#039;m very new to Mathematica and to programming. Complete computer novice. I might be coming at my problem from too mathematical a viewpoint&#xD;
&#xD;
Basically what I&amp;#039;m trying to do is find the transmission of a generic wave through a series of potential barriers with spin orbit interaction and a magnetic field. Now, I can do all the maths, but at a certain point you have to compute these hideous 4x4 matrices so I hoped mathematica could do that part for me and give me graphs.&#xD;
&#xD;
I want to keep the functions as general as possible until right at the end so I can input parameters right at the graphing stage. But the evaluation gets so big that graphs take hours to plot even over small ranges. Also, the calculation is complicated enough that even if I define 5 out of 6 variables and only keep the variable I want to us as x axis, the evaluation uses up all of my memory and quits before it even finishes.&#xD;
&#xD;
I don&amp;#039;t understand parallelization - and the little bit of experimenting I&amp;#039;ve done returns &amp;lt;&amp;lt;cannot be parallelized&amp;gt;&amp;gt; messages.&#xD;
&#xD;
The crucial line is&#xD;
&#xD;
    Anz[n_, a_, d_, kx_, l_, g_] = &#xD;
     Inverse[L[((n - 1)/2) (a + d), kx]].Smz[a, d, kx, l, &#xD;
       g].(MatrixPower[Sz[a, d, kx, l, g], (n - 3)/2]).L[a, kx]&#xD;
&#xD;
Where L, Smz and Sz are all 4x4 matrices with huge elements. Like so huge I cannot post even one here.&#xD;
&#xD;
Please help,&#xD;
My computation as is isn&amp;#039;t even as complicated as it need to be and it takes hours to plot a single graph!</description>
    <dc:creator>Eleanor Holmes</dc:creator>
    <dc:date>2016-03-02T17:07:09Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3604903">
    <title>Modulo reduction of input for trigonometric functions</title>
    <link>https://community.wolfram.com/groups/-/m/t/3604903</link>
    <description>For reducing such input from a range (-infinity; +infinity) to the target interval (-π; +π] on which trigonometric functions shall operate, the original input must be taken modulo 2π. Performance of such a modulo reduction on limited hardware systems depends on the number of digits you provide for 2π. Said number may be in the order of some hundred to some thousand. How can I specify this number for WolframAlpha?&#xD;
&#xD;
WolframAlpha understands my request to give me, e.g., 700 digits of 2π and returns them properly. But if and when I try to compute a given real number modulo (700 digits of 2π) it fails to decode my wish and, alas, doesn&amp;#039;t advise me what to do instead. Any hint in this matter is appreciated. Thanks in advance.</description>
    <dc:creator>Walter Bonin</dc:creator>
    <dc:date>2026-01-11T23:23:02Z</dc:date>
  </item>
</rdf:RDF>

