<?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 Numerical Computation sorted by most likes.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/122095" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1569707" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2763509" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2975371" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2017849" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3467978" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1843550" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3202678" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/745870" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/515162" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3111908" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2030201" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2978606" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2961701" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2740397" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/826688" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/355110" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1485074" />
        <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:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/122095">
    <title>Dancing with friends and enemies: boids&amp;#039; swarm intelligence</title>
    <link>https://community.wolfram.com/groups/-/m/t/122095</link>
    <description>The latest way I have found to use my expensive math software for frivolous entertainment is this. Here&amp;#039;s is a way to describe it. 
[list]
[*]1000 dancers assume random positions on the dance-floor. 
[*]Each randomly chooses one &amp;#034;friend&amp;#034; and one &amp;#034;enemy&amp;#034;. 
[*]At each step every dancer 
[list]
[*]moves 0.5% closer to the centre of the floor
[*]then takes a large step towards their friend 
[*]and a small step away from their enemy. 
[/list]
[*]At random intervals one dancer re-chooses their friend and enemy
[/list]
Randomness is deliberately injected. Here is the dance...
[mcode]n = 1000; 
r := RandomInteger[{1, n}]; 
f := (#/(.01 + Sqrt[#.#])) &amp;amp; /@ (x[[#]] - x) &amp;amp;; 
s := With[{r1 = r}, p[[r1]] = r; q[[r1]] = r]; 
x = RandomReal[{-1, 1}, {n, 2}]; 
{p, q} = RandomInteger[{1, n}, {2, n}]; 
Graphics[{PointSize[0.007], Dynamic[If[r &amp;lt; 100, s]; 
Point[x = 0.995 x + 0.02 f[p] - 0.01 f[q]]]}, PlotRange -&amp;gt; 2][/mcode]
[img]/c/portal/getImageAttachment?filename=OPTfnlfrnds.gif&amp;amp;userId=11733[/img]

Thanks to Vitaliy for posting this on my behalf, complete with animations :-)

Background: I had read somewhere that  macro-scale behaviour of animal swarms (think of flocks of starlings or shoals of herring) is explained by each individual following very simple rules local to their vicinity, essentially 1) try to keep up and 2) try not to collide. I started trying to play with this idea in Mathematica, but it was rather slow to identify the nearest neighbours of each particle. So I wondered what would happen if each particle acted according to the locations of two other particles, regardless of their proximity. The rule was simply to move away from one and towards the other.

The contraction (x = 0.995 x) was added to prevent the particle cloud from dispersing towards infinity or drifting away from the origin. I tweaked the &amp;#034;towards&amp;#034; and &amp;#034;away&amp;#034; step sizes to strike a balance between the tendency to clump together and to spread apart (if you make the step sizes equal you get something more like a swarm of flies). With each particle&amp;#039;s attractor and repeller fixed, the system finds a sort of dynamic equilibrium, so to keep things changing I added a rule to periodically change the attractor and repeller for one of the particles. The final adjustment was to make the &amp;#034;force&amp;#034; drop towards zero for particles at very close range. This helps to stop the formation of very tight clumps, and also prevents a division-by-zero error when a particle chooses itself as its attractor or repeller.

The description of the system as a dance was an attempt to explain the swirling pattern on the screen without using mathematical language. I&amp;#039;d love to see what other &amp;#034;dances&amp;#034; can be created with other simple rules.</description>
    <dc:creator>Simon Woods</dc:creator>
    <dc:date>2013-09-11T18:31:12Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1569707">
    <title>A prime pencil: truncatable primes</title>
    <link>https://community.wolfram.com/groups/-/m/t/1569707</link>
    <description>![a very prime pencil][1]&#xD;
&#xD;
I just got a set of these pencils, from [Mathsgear][2].&#xD;
The number printed on it is prime, and will remain so as you sharpen the pencil from the left, all the way down to the last digit, 7.&#xD;
Here is a recursive construction of all such *truncatable primes*.&#xD;
&#xD;
    TruncatablePrimes[p_Integer?PrimeQ] :=&#xD;
     With[{digits = IntegerDigits[p]},&#xD;
      {p, TruncatablePrimes /@ (FromDigits /@ (Prepend[digits, #] &amp;amp; /@ Range[9]))}&#xD;
      ];&#xD;
    TruncatablePrimes[p_Integer] := {}&#xD;
&#xD;
   The one on the pencil is the largest one,&#xD;
&#xD;
    In[7]:= Take[Sort[Flatten[TruncatablePrimes /@ Range[9]]], -5]&#xD;
    &#xD;
    Out[7]= {&#xD;
    9918918997653319693967, &#xD;
    57686312646216567629137, &#xD;
    95918918997653319693967, &#xD;
    96686312646216567629137,&#xD;
    357686312646216567629137}&#xD;
    &#xD;
 [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=IMG_20181212_120939.jpg&amp;amp;userId=143131&#xD;
 [2]: https://mathsgear.co.uk/products/truncatable-prime-pencil</description>
    <dc:creator>Roman Maeder</dc:creator>
    <dc:date>2018-12-12T12:01:36Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2763509">
    <title>Optimize search for rational numbers on unit circle?</title>
    <link>https://community.wolfram.com/groups/-/m/t/2763509</link>
    <description>*Crossposted: https://mathematica.stackexchange.com/q/278250/13 *&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=RealRational_560.jpg&amp;amp;userId=11733&#xD;
  [2]: https://www.wolframcloud.com/obj/4dd2dfe1-b258-4a55-a8c4-39f6b4f0cfe9</description>
    <dc:creator>Vitaliy Kaurov</dc:creator>
    <dc:date>2023-01-06T18:30:28Z</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/2017849">
    <title>How black holes and accretion disks around them actually look</title>
    <link>https://community.wolfram.com/groups/-/m/t/2017849</link>
    <description>#Introduction&#xD;
&#xD;
One of the most thrilling parts in Nolan&amp;#039;s movie &amp;#034;Interstellar&amp;#034; is the black hole Gargantua and its accretion disk. Its weird shape has surely attracted lots of attention. But do black holes and their accretion disks actually look like that? Not exactly.&#xD;
&#xD;
![BH and accretion disk in Interstellar][1]&#xD;
&#xD;
In the paper &amp;#034;Gravitational lensing by spinning black holes in astrophysics, and in the movie Interstellar&amp;#034;, the authors say that in the movie, redshift and blueshift, as well as the intensity difference is ignored to prevent confusion to the audience. So, although the outline of the accretion disk in &amp;#034;Interstellar&amp;#034; is accurate, the color and the intensity are not. Furthermore, even in the paper, effects brought by the time delay in the propagation of light are ignored, and the influence of gravity lensing on light intensity is simplified.&#xD;
&#xD;
Though I cannot easily render a spinning black hole (Kerr black hole), what I can do is try to render an accretion disk around a Schwarzschild black hole, and as physically correct as possible. The result would be something like this (observer static at 6 times the Schwarzschild radius):&#xD;
&#xD;
![my rendering result, static observer][2]&#xD;
&#xD;
I strongly recommend you to see the videos at [Bilibili](https://www.bilibili.com/video/BV1Fp4y1S7EF) or [Youtube](https://www.youtube.com/watch?v=Dux1NkTaqwo) (Both have English subtitles) first to have a first impression, and it would be the best if you can click the vote up button XD. After that, If you would like to know more about the Mathematica realization and physical principles behind the scene, please continue.&#xD;
&#xD;
**A disclaimer first:** I know nothing about accretion disk physics, so the property of accretion disks are set arbitrarily. Furthermore, actual accretion disks are actually blazingly bright, and you would be blind instantly if you are looking at it from a short distance, so I have to make some modifications.&#xD;
&#xD;
#Analytics&#xD;
&#xD;
###Physics Perspective&#xD;
&#xD;
First, we need to analyze this problem from the physics perspective, get to know about the problems we should consider. **For observers**, the intensity of light is determined by how much photons reached their eye in a certain angle range, and the color is determined by the spectrum of the light. However, the orientation, spectrum, and intensity of light beams can be influenced by the observer&amp;#039;s movement, so we have to consider that. Naturally, the next question should be, where the light comes? Well, all the light must have come from some **light-emitting materials**, so we have to consider the light-emitting materials&amp;#039; property and movement. But the **light should travel** for some time and distance before reaching the observer&amp;#039;s eye. This process involves tracing the light from the emitter to the observer to determine the direction of light the observer perceived, as well as how much portion of light can reach the observer&amp;#039;s eyes. Till now, we have already listed out all effects, from the emission to the perception, which could influence our view, so I believe this rendering is &amp;#034;physically accurate&amp;#034;.&#xD;
&#xD;
&#xD;
### Programming Perspective&#xD;
&#xD;
But view from the programming perspective, the zeroth problem should be how lights travel around a black hole: we need the light path to calculate all other effects. Then, based on the light path, we can directly compute the equivalent of &amp;#034;brighter when closer&amp;#034; rule, as well as the time delay between light emission and observation. If combined with the movement of the light-emitting materials and the observer, we can compute the redshift and the blueshift. &#xD;
&#xD;
#Details, Theory, Coding and Results&#xD;
&#xD;
Now let&amp;#039;s assume that we are stationary observers viewing from 6 times the Schwarzchild radius.&#xD;
&#xD;
##Ray Tracing&#xD;
The first problem to solve is tracing the light beam. Light bends around black holes following the geodesics, and the most apparent consequence of this would be that the accretion disk we see would not be on a plane, but rather curved and bent. Fortunately for us, because Schwartzchild black holes are spherically symmetric, we can reduce the problem to 2D. The parametric equation of geodesics around a Schwarzschild black hole can be derived as follows:&#xD;
&#xD;
$$&#xD;
	\left\{&#xD;
	\begin{aligned}&#xD;
		t&amp;#039;&amp;#039;(\lambda)&amp;amp;=\frac{R_s r&amp;#039; t&amp;#039;}{R_s r-r^2}\\&#xD;
		r&amp;#039;&amp;#039;(\lambda)&amp;amp;=\frac{-R_s r^2 r&amp;#039;^2-2r^3\theta&amp;#039;^2(R_s-r)^2+R_s(R_s-r)^2t&amp;#039;^2}{2r^3(R_s-r)}\\&#xD;
		\theta&amp;#039;&amp;#039;(\lambda)&amp;amp;=-\frac{2r&amp;#039;\theta&amp;#039;}{r}&#xD;
	\end{aligned}&#xD;
	\right.&#xD;
$$&#xD;
&#xD;
&#xD;
Where $\lambda$ is the ray parameter.&#xD;
&#xD;
Now we construct a set of light which originates from the observer, and trace them backward:&#xD;
&#xD;
![Possible light paths][3]&#xD;
&#xD;
![Definition of variables][4]&#xD;
&#xD;
![How interpolation works][5]&#xD;
&#xD;
On each ray, we take some sample points and record the corresponding angle $\theta_0$, $\theta_1$, and time $\Delta T$. By interpolating them, we know about how a random object will look like in our eyes.&#xD;
&#xD;
    (*Initial definitions*)&#xD;
    Rs = 1;&#xD;
    R0 = 6 Rs;&#xD;
    Rmax = 6 Rs + 1.*^-6;&#xD;
    (*Tracking the light*)&#xD;
    parfunc = &#xD;
      ParametricNDSolveValue[{{tt&amp;#039;&amp;#039;[\[Tau]], &#xD;
          rr&amp;#039;&amp;#039;[\[Tau]], \[Theta]\[Theta]&amp;#039;&amp;#039;[\[Tau]]} == {(&#xD;
          Derivative[1][rr][\[Tau]] Derivative[1][tt][\[Tau]])/(&#xD;
          rr[\[Tau]] - rr[\[Tau]]^2), (&#xD;
           rr[\[Tau]]^2 Derivative[1][&#xD;
              rr][\[Tau]]^2 - (-1 + rr[\[Tau]])^2 Derivative[1][&#xD;
              tt][\[Tau]]^2)/(&#xD;
           2 (-1 + rr[\[Tau]]) rr[\[Tau]]^3) + (-1 + &#xD;
              rr[\[Tau]]) Derivative[1][\[Theta]\[Theta]][\[Tau]]^2, -((&#xD;
           2 Derivative[1][rr][\[Tau]] Derivative[&#xD;
             1][\[Theta]\[Theta]][\[Tau]])/rr[\[Tau]])}, {tt&amp;#039;[0], &#xD;
          rr&amp;#039;[0], \[Theta]\[Theta]&amp;#039;[&#xD;
           0]} == {1/(1 - Rs/R0), -Cos[\[Theta]0], &#xD;
          Sqrt[1/(1 - Rs/R0)]/R0 Sin[\[Theta]0]}, {tt[0], &#xD;
          rr[0], \[Theta]\[Theta][0]} == {0, R0, 0}, &#xD;
        WhenEvent[&#xD;
         1.01 Rs &amp;gt;= rr[\[Tau]] || &#xD;
          rr[\[Tau]] &amp;gt;= Rmax || \[Theta]\[Theta][\[Tau]] &amp;gt;= 3.1 Pi, &#xD;
         &amp;#034;StopIntegration&amp;#034;]}, {tt[\[Tau]], &#xD;
        rr[\[Tau]], \[Theta]\[Theta][\[Tau]]}, {\[Tau], 0, &#xD;
        1000}, {\[Theta]0}];&#xD;
    (*data used in interpolation*)&#xD;
    datp = Catenate@&#xD;
       Table[With[{pf = parfunc[\[Theta]]}, &#xD;
         With[{\[Tau]max = pf[[1, 0, 1, 1, 2]], df = D[Rest@pf, \[Tau]], &#xD;
           f = Rest@pf}, &#xD;
          Block[{\[Tau] = &#xD;
             Range[RandomReal[{0, \[Tau]max/500}], \[Tau]max, \[Tau]max/&#xD;
               500]}, Select[&#xD;
            Thread[(Thread@f -&amp;gt; &#xD;
               Thread@{\[Theta], &#xD;
                 ArcTan[-df[[1]], df[[2]] f[[1]] Sqrt[1 - Rs/f[[1]]]], &#xD;
                 pf[[1]]})], &#xD;
            2.4 Rs &amp;lt; #[[1, 1]] &amp;lt; 5.6 Rs &amp;amp;&amp;amp; -0.05 Pi &amp;lt; #[[1, 1]] &amp;lt; &#xD;
               3.08 Pi &amp;amp;]]]], {\[Theta], &#xD;
         Range[-2.5 Degree, 80 Degree, 1 Degree]~Join~&#xD;
          Range[20.2 Degree, 28.2 Degree, 0.5 Degree]~Join~&#xD;
          Range[23.025 Degree, 24.05 Degree, 0.05 Degree]~Join~&#xD;
          Range[23.2825 Degree, 23.4 Degree, 0.005 Degree]~Join~&#xD;
          Range[23.28525 Degree, 23.30025 Degree, 0.001 Degree]}];&#xD;
    datp = First /@ GatherBy[datp, Floor[#[[1]]/{0.01 Rs, 1 Degree}] &amp;amp;];&#xD;
    &#xD;
    (*Construct InterpolatingFunctions*)&#xD;
    ReceiveAngleFunction = &#xD;
      Interpolation[Thread[{datp[[;; , 1]], datp[[;; , 2, 1]]}], &#xD;
       InterpolationOrder -&amp;gt; 1];&#xD;
    EmitAngleFunction = &#xD;
     Interpolation[Thread[{datp[[;; , 1]], datp[[;; , 2, 2]]}], &#xD;
      InterpolationOrder -&amp;gt; 1];&#xD;
    DelayFunction = &#xD;
     Interpolation[Thread[{datp[[;; , 1]], datp[[;; , 2, 3]]}], &#xD;
      InterpolationOrder -&amp;gt; 1];&#xD;
    (*Angle vs time of observation*)&#xD;
    GenerateAngleFunctions[R1_, \[Theta]1_] := Block[{\[Phi]1},&#xD;
      With[{interpol = &#xD;
           Interpolation@&#xD;
            Table[{DelayFunction[R1, #] + &#xD;
               Sqrt[2 R1^3] \[Phi]1, \[Phi]1}, {\[Phi]1, 0., 2 Pi, &#xD;
              10. Degree}]},&#xD;
         With[{ts = interpol[[1, 1, 1]], tperiod = 2. Pi Sqrt[2 R1^3]}, &#xD;
          Function[t, interpol[t - Floor[t - ts, tperiod]]]]] &amp;amp; /@ ({#, &#xD;
           2 Pi - #, 2 Pi + #} &amp;amp;@ArcCos[Sin[\[Phi]1] Sin[\[Theta]1]])]&#xD;
&#xD;
If we only consider this effect, then we will have something like this:&#xD;
&#xD;
![Light bending included][6]&#xD;
&#xD;
The inner two rings correspond to the light that rotates around the black hole for more than half a round.&#xD;
&#xD;
And if we consider the propagation time of light, the right side will be a bit brighter.&#xD;
&#xD;
![Time correction included][7]&#xD;
&#xD;
This is because on the right, objects are moving away from you. So from your point of view, these particles will stay for a longer time on the right. (The reason is explained in the figure)&#xD;
&#xD;
![Illustration of how velocity influence timing][8]&#xD;
&#xD;
##&amp;#034;Brighter when Closer&amp;#034;&#xD;
The next question is about the &amp;#034;brighter when closer&amp;#034; rule. We all know that the further a bulb is, the dimmer it would appear to be. This is because the light from the bulb is approximately evenly distributed across solid angles, but as we move further, the solid angle corresponding to our eyes will be smaller. Mathematically, this is saying $I\propto S_0 \frac{d\Omega}{dS}$ where $S_0$ is the surface area of our eyes, $S$ is area, and $\Omega$ is the solid angle.&#xD;
&#xD;
![&amp;#034;Brighter when closer&amp;#034; rule in flat space][9]&#xD;
&#xD;
The same rules apply here in curved spacetime, except the light beams are weirder.&#xD;
&#xD;
![&amp;#034;Brighter when closer&amp;#034; rule in curved space][10]&#xD;
&#xD;
We know that $\frac{d\Omega}{dS}=(\frac{dx}{d\theta_x}\frac{dy}{d\theta_y})^{-1}$. While $\frac{dy}{d\theta_y}=\frac{R_0 \sin \alpha}{\sin \theta_1}$ can be derived using basic solid geometry, $\frac{dx}{d\theta_x}$ must be calculated numerically by tracing the light from the object to the observer. Similarly, we use interpolating function to generalize the result from a set of sample points to the whole space.&#xD;
&#xD;
    (*Reverse ray tracing*)&#xD;
    parfuncrev = &#xD;
      ParametricNDSolveValue[{{tt&amp;#039;&amp;#039;[\[Tau]], &#xD;
          rr&amp;#039;&amp;#039;[\[Tau]], \[Theta]\[Theta]&amp;#039;&amp;#039;[\[Tau]]} == {(&#xD;
          Derivative[1][rr][\[Tau]] Derivative[1][tt][\[Tau]])/(&#xD;
          rr[\[Tau]] - rr[\[Tau]]^2), (&#xD;
           rr[\[Tau]]^2 Derivative[1][&#xD;
              rr][\[Tau]]^2 - (-1 + rr[\[Tau]])^2 Derivative[1][&#xD;
              tt][\[Tau]]^2)/(&#xD;
           2 (-1 + rr[\[Tau]]) rr[\[Tau]]^3) + (-1 + &#xD;
              rr[\[Tau]]) Derivative[1][\[Theta]\[Theta]][\[Tau]]^2, -((&#xD;
           2 Derivative[1][rr][\[Tau]] Derivative[&#xD;
             1][\[Theta]\[Theta]][\[Tau]])/rr[\[Tau]])}, {tt&amp;#039;[0], &#xD;
          rr&amp;#039;[0], \[Theta]\[Theta]&amp;#039;[0]} == {1/(1 - Rs/R1), &#xD;
          Cos[\[Theta]0], -Sqrt[1/(1 - Rs/R1)]/R1 Sin[\[Theta]0]}, {tt[0],&#xD;
           rr[0], \[Theta]\[Theta][0]} == {0, R1, \[Theta]1}, &#xD;
        WhenEvent[\[Theta]\[Theta][\[Tau]] == 0, &#xD;
         &amp;#034;StopIntegration&amp;#034;]}, {tt[\[Tau]], &#xD;
        rr[\[Tau]], \[Theta]\[Theta][\[Tau]]}, {\[Tau], 0, &#xD;
        100}, {\[Theta]0, R1, \[Theta]1}];&#xD;
    (*data used in interpolation*)&#xD;
    \[CapitalDelta]\[Phi] = 1.*^-5;&#xD;
    intensity = &#xD;
      Catenate@Table[{{R, \[Theta]}, &#xD;
         R0^2 With[{\[Theta] = Abs[\[Theta]]}, &#xD;
           Abs[Sin[EmitAngleFunction[&#xD;
                R, \[Theta]]]/(R0 \&#xD;
    Sin[\[Theta]])]*(\[CapitalDelta]\[Phi]/(Sin[&#xD;
                 ReceiveAngleFunction[R, \[Theta]]]* &#xD;
                Subtract @@ (With[{f = &#xD;
                       parfuncrev[&#xD;
                        EmitAngleFunction[&#xD;
                        R, \[Theta]] + # \[CapitalDelta]\[Phi], &#xD;
                        R, \[Theta]][[2, 0]]}, f@f[[1, 1, -1]]] &amp;amp; /@ {-1, &#xD;
                    1})))]}, {R, 2.45 Rs, 5.55 Rs, &#xD;
         0.02 Rs}, {\[Theta], -3 Degree, 543 Degree, 2 Degree}];&#xD;
    &#xD;
    (*Construct InterpolatingFunction*)&#xD;
    IntensityFunction1 = Interpolation[intensity];&#xD;
&#xD;
![With intensity correction 1][11]&#xD;
&#xD;
The figure will be much more realistic in the aspect of intensity after we added this effect. The inner two rings are much dimmer because light bent dramatically is rare after all.&#xD;
&#xD;
##Doppler Effect and Headlight Effect&#xD;
Now its time for Doppler effect and headlight effect. These two effects are related to the movement of light-emitting objects and observers. Though the names of these effects can be forbidding, these effects are quite common in everyday life. Blueshift refers to the phenomenon that when a car is approaching you, the noise made by the car would be more acute and loud, and redshift means when the car is leaving you, the noise would quieter and be of lower frequency. &#xD;
&#xD;
![Doppler effect][12]&#xD;
&#xD;
The equation for the relativistic Doppler effect is:&#xD;
&#xD;
$$&#xD;
    f&amp;#039;=f\frac{\sqrt{1-\beta^2}}{1-\beta \cos \theta}&#xD;
$$&#xD;
&#xD;
where $\beta=\frac{v}{c}$ and $\theta$ is the angle between the velocity direction of the light-emitting object and the light emitted, as observed by an external observer. In this case, we should further add a coefficient of &#xD;
&#xD;
$$&#xD;
 f&amp;#039;&amp;#039;=f&amp;#039;\sqrt{\frac{1 - R_s/R_1}{1 - R_s/R_0}}&#xD;
$$&#xD;
&#xD;
due to general relativistic effects.&#xD;
&#xD;
Headlight effect means when you are driving a car on rainy days, no matter how the wind blows, the raindrops will always run towards the windshield. But if you stop your vehicle, you can see how the wind influences the dropping direction of rain.  &#xD;
&#xD;
![Headlight effect][13]&#xD;
&#xD;
The equation for angle transformation is:&#xD;
&#xD;
$$&#xD;
    \cos \theta&amp;#039;= \frac{\cos \theta +\beta}{1+\beta \cos \theta}&#xD;
$$&#xD;
&#xD;
and such, the intensity difference introduced by this can be written as:&#xD;
&#xD;
$$&#xD;
    \frac{dP&amp;#039;}{d\Omega}= \frac{dP}{d\Omega}\frac{\sin \theta}{\sin \theta&amp;#039;}\frac{d \theta}{d \theta&amp;#039;}=\frac{dP}{d\Omega}\frac{1 - \beta^2}{(1 -\beta \cos \theta)^2}&#xD;
$$&#xD;
&#xD;
Except for the difference in timing brought by the curved spacetime, these two effects are purely in the special relativity regime. The only thing involved in coding is tedious coordinate transformation. &#xD;
&#xD;
    (*Calculate moving speed*)&#xD;
    Calc\[Beta][{R1_, \[Theta]_, \[Phi]_}, {vr_, v\[Theta]_, v\[Phi]_}] :=&#xD;
      Sqrt[vr^2/(1 - &#xD;
           Rs/R1) + (R1 v\[Theta])^2 + (R1 Sin[\[Theta]] v\[Phi])^2]/&#xD;
      Sqrt[1 - Rs/R1]&#xD;
    (*Calculate inner product between moving direction and light direction*)&#xD;
    CalcCosAngle[{R1_, \[Theta]_, \[Phi]_}, {vr_, v\[Theta]_, v\[Phi]_}] :=&#xD;
      With[{v = {vr/Sqrt[1 - Rs/R1], R1 v\[Theta], &#xD;
         R1 Sin[\[Theta]] v\[Phi]}}, &#xD;
      MapThread[With[{\[Theta]0 = EmitAngleFunction[R1, #1]},&#xD;
         With[{vnormed = MapThread[Normalize@*List, v]}, &#xD;
          MapThread[&#xD;
           Dot, {vnormed, Thread@{Cos[\[Theta]0], #2 Sin[\[Theta]0], 0}}, &#xD;
           1]]] &amp;amp;, {{\[Theta], 2 Pi - \[Theta], 2 Pi + \[Theta]}, {-1, &#xD;
         1, -1}}]]&#xD;
    (*Frequency shift, Doppler effect + GR timing effects*)&#xD;
    FrequencyMult[R1_, \[Beta]_, cos_] := &#xD;
     Sqrt[(1 - Rs/R1)/(1 - Rs/R0)]*Sqrt[1 - \[Beta]^2]/(1 - \[Beta] cos)&#xD;
    (*Intensity shift due to headlight effect only*)&#xD;
    IntensityMult2[\[Beta]_, &#xD;
      cos_] := (Sqrt[1 - \[Beta]^2]/(1 - \[Beta] cos))^2&#xD;
&#xD;
Then we can put all these effects together and see how things works out!&#xD;
&#xD;
    &amp;lt;&amp;lt; PhysicalColor`&#xD;
    &#xD;
    IntensityFunctionScaling::usage = &amp;#034;Scale Intensity.&amp;#034;;&#xD;
    Protect@IntensityFunctionScaling;&#xD;
    &#xD;
    Options[RenderFunc] = {ColorFunction -&amp;gt; TemperatureColor, &#xD;
       ColorFunctionScaling -&amp;gt; (# &amp;amp;), IntensityFunctionScaling -&amp;gt; (# &amp;amp;), &#xD;
       &amp;#034;StaticObserver&amp;#034; -&amp;gt; True};&#xD;
    &#xD;
    RenderFunc[R1_, {\[Theta]1_, t1_, \[Gamma]1_}, {T0_, I0_}, &#xD;
      OptionsPattern[]] :=&#xD;
     Function[t, Through[#[t]]] &amp;amp;@Module[{&#xD;
        (*Velocity of observer*)&#xD;
        vobs = N@Sqrt[(1 - Rs/R0) Rs/(2 R0)],&#xD;
        (*list of \[Phi]1 parameters*)&#xD;
        \[Phi]1l = Range[0., 2 Pi, 1 Degree],&#xD;
        (*Polar coordinates \[Theta] and \[Phi]*)&#xD;
        \[Theta]l0, \[Phi]l0,&#xD;
        (*velocity of object and its norm*)&#xD;
        vrl, v\[Theta]l, v\[Phi]l, vnorml&#xD;
        },&#xD;
       (*Polar coordinate \[Theta]*)&#xD;
       \[Theta]l0 = ArcCos[Sin[\[Phi]1l] Sin[\[Theta]1]];&#xD;
       &#xD;
       (*Original \[Phi]*)&#xD;
       \[Phi]l0 = &#xD;
        ArcTan[Cos[\[Phi]1l], Sin[\[Phi]1l] Cos[\[Theta]1]] + \[Gamma]1;&#xD;
       &#xD;
       (*velocity of object*)&#xD;
       vrl = ConstantArray[0, Length@\[Phi]1l];&#xD;
       v\[Theta]l = -(Cos[\[Phi]1l] Sin[\[Theta]1])/&#xD;
          Sqrt[1 - Sin[\[Theta]1]^2 Sin[\[Phi]1l]^2]*Sqrt[Rs/(2 R1^3)];&#xD;
       v\[Phi]l = &#xD;
        1/(Cos[\[Phi]1l]^2/Cos[\[Theta]1] + &#xD;
            Cos[\[Theta]1] Sin[\[Phi]1l]^2)*Sqrt[Rs/(2 R1^3)];&#xD;
       &#xD;
       (*velocity norm*)&#xD;
       vnorml = &#xD;
        Calc\[Beta][{R1, \[Theta]l0, 0}, {vrl, v\[Theta]l, v\[Phi]l}];&#xD;
       &#xD;
       MapThread[Module[{&#xD;
           (*Observed \[Phi]1 parameter - t*)&#xD;
           \[Phi]1t = #3,&#xD;
           (*actual \[Theta] of object*)&#xD;
           \[Theta]l = #1,&#xD;
           (*angle between velocy and ray*)&#xD;
           cosl = #4,&#xD;
           (*Observed values - \[Phi]1*)&#xD;
           (*Geometry*)&#xD;
           \[Theta]obsl, \[Phi]obsl = \[Phi]l0 + #2,&#xD;
           (*Frequency and intensity shift*)&#xD;
           freqobsl, intobsl,&#xD;
           (*helper function*)&#xD;
           helpf&#xD;
           },&#xD;
          \[Theta]obsl = ReceiveAngleFunction[R1, \[Theta]l];&#xD;
          &#xD;
          (*Frequency*)&#xD;
          freqobsl = FrequencyMult[R1, vnorml, cosl];&#xD;
          &#xD;
          (*Process with the non-static observer*)&#xD;
          If[OptionValue[&amp;#034;StaticObserver&amp;#034;] =!= True,&#xD;
           Module[{\[Theta]transl, \[Phi]transl, \[Delta] = ArcSin[vobs]},&#xD;
            (*Geometrics, static frame*)&#xD;
            \[Theta]transl = ArcCos[Sin[\[Theta]obsl] Cos[\[Phi]obsl]];&#xD;
            \[Phi]transl = &#xD;
             ArcTan[Sin[\[Theta]obsl] Sin[\[Phi]obsl], Cos[\[Theta]obsl]];&#xD;
            (*Frequency shift due to movement of observer, &#xD;
            intensity shift is calculated together later*)&#xD;
            freqobsl *= (1 + vobs Cos[\[Theta]transl])/Sqrt[1 - vobs^2];&#xD;
            (*Angle shift due to movement of observer*)&#xD;
            \[Theta]transl = &#xD;
             ArcCos[(vobs + Cos[\[Theta]transl])/(1 + &#xD;
                 vobs Cos[\[Theta]transl])];&#xD;
            (*Transform back*)&#xD;
            (*Here we change the center of viewing angle so that the \&#xD;
    black hole&amp;#039;s center is at {0,0}*)&#xD;
            \[Theta]obsl = &#xD;
             ArcCos[Sin[\[Delta]] Cos[\[Theta]transl] + &#xD;
               Cos[\[Delta]] Sin[\[Theta]transl] Sin[\[Phi]transl]];&#xD;
            \[Phi]obsl = &#xD;
             ArcTan[Cos[\[Delta]] Cos[\[Theta]transl] - &#xD;
               Sin[\[Delta]] Sin[\[Theta]transl] Sin[\[Phi]transl], &#xD;
              Sin[\[Theta]transl] Cos[\[Phi]transl]]&#xD;
            ]&#xD;
           ];&#xD;
          &#xD;
          \[Phi]obsl = &#xD;
           Catenate[&#xD;
            MapIndexed[#1 + 2 Pi #2[[1]] &amp;amp;, Split[\[Phi]obsl, Less]]];&#xD;
          &#xD;
          (*Intensity*)&#xD;
          intobsl = &#xD;
           freqobsl^2*IntensityFunction1[R1, \[Theta]l]*&#xD;
            IntensityMult2[vnorml, cosl]*&#xD;
            TemperatureIntensity[freqobsl T0]/TemperatureIntensity[T0]/&#xD;
             freqobsl^4;&#xD;
          &#xD;
          (*Helper function to construct interpolating functions*)&#xD;
          helpf[l_] := Interpolation[Thread[{\[Phi]1l, l}]];&#xD;
          &#xD;
          With[{&#xD;
            cf = OptionValue[ColorFunction],&#xD;
            (*Interpolating functions*)&#xD;
            t11 = t1,&#xD;
            \[Phi]1f = #3,&#xD;
            \[Theta]func = helpf[\[Theta]obsl],&#xD;
            \[Phi]func = helpf[\[Phi]obsl],&#xD;
            freqfunc = &#xD;
             helpf[OptionValue[ColorFunctionScaling][T0 freqobsl]],&#xD;
            intfunc = &#xD;
             helpf[OptionValue[IntensityFunctionScaling][I0 intobsl]]&#xD;
            },&#xD;
            &#xD;
           (*Final function*)&#xD;
           Function[t,&#xD;
            With[{\[Phi]11 = \[Phi]1f[t + t11]},&#xD;
             {Append[cf[freqfunc[\[Phi]11]], intfunc[\[Phi]11]],&#xD;
              &#xD;
              With[{\[Theta] = \[Theta]func[\[Phi]11], \[Phi] = \&#xD;
    \[Phi]func[\[Phi]11]},&#xD;
               (*Point[{Sin[\[Theta]]Cos[\[Phi]],Sin[\[Theta]]Sin[\[Phi]],&#xD;
               Cos[\[Theta]]}]*)&#xD;
               Point[Tan[\[Theta]] {Cos[\[Phi]], Sin[\[Phi]]}]]}&#xD;
             ]]&#xD;
           ]&#xD;
          ] &amp;amp;, {{\[Theta]l0, 2 Pi - \[Theta]l0, 2 Pi + \[Theta]l0}, {0, &#xD;
          Pi, 0}, GenerateAngleFunctions[R1, \[Theta]1], &#xD;
         CalcCosAngle[{R1, \[Theta]l0, 0}, {vrl, v\[Theta]l, v\[Phi]l}]}]]&#xD;
    (*My version of rasterize, which increase color precision in dimmer areas*)&#xD;
    HDRRasterize[gr_Graphics, convertfunc_, &#xD;
      opts : OptionsPattern[Rasterize]] :=&#xD;
     Module[{rasterl = &#xD;
        Join[ColorSeparate[ColorConvert[Rasterize[gr, opts], &amp;#034;HSB&amp;#034;]], &#xD;
         ColorSeparate[&#xD;
          ColorConvert[&#xD;
           Rasterize[&#xD;
            gr /. RGBColor[r_, g_, b_, op_] :&amp;gt; RGBColor[r, g, b, 16 op], &#xD;
            opts], &amp;#034;HSB&amp;#034;]]], mask, invmask},&#xD;
      mask = Binarize[rasterl[[3]], 1/16];&#xD;
      invmask = 1 - mask;&#xD;
      ColorCombine[{&#xD;
        mask*rasterl[[1]] + invmask*rasterl[[4]],&#xD;
        mask*rasterl[[2]] + invmask*rasterl[[5]],&#xD;
        mask*convertfunc[rasterl[[3]]] + &#xD;
         invmask*convertfunc[rasterl[[6]]/16.]}, &amp;#034;HSB&amp;#034;]&#xD;
      ]&#xD;
    (*Preliminary computation*)&#xD;
    npts = 5000;&#xD;
    rflist = MapThread[&#xD;
       Function[{R1, \[Theta]1, t1, \[Gamma]1, T0, I0}, &#xD;
        RenderFunc[R1, {\[Theta]1, t1, \[Gamma]1}, {T0, I0}, &#xD;
         &amp;#034;StaticObserver&amp;#034; -&amp;gt; False(*,&#xD;
         IntensityFunctionScaling\[Rule](.7(#/.5)^0.5&amp;amp;)*)]],&#xD;
       {RandomReal[{3, 4.5}, npts],&#xD;
        RandomReal[-{83, 86} Degree, npts],&#xD;
        RandomReal[{0, 10000}, npts],&#xD;
        RandomReal[15 Degree + {-2, 2} Degree, npts],&#xD;
        RandomReal[{4000, 10000}, npts],&#xD;
        RandomReal[{.03, .1}, npts]&#xD;
        }&#xD;
       ];&#xD;
    (*rendering!!!*)&#xD;
    g = Graphics[{(*AbsolutePointSize@.1,White,Point[{Sin[20Degree]Cos[#],&#xD;
        Sin[20Degree]Sin[#],Cos[20Degree]}&amp;amp;/@Range[0.,360.Degree,&#xD;
        60.Degree]],*)AbsoluteThickness@2, &#xD;
        Map[Line[#[[;; , 2, 1]], &#xD;
           VertexColors -&amp;gt; &#xD;
            MapThread[&#xD;
             Function[{col, len, mult}, &#xD;
              MapAt[mult^2*#*0.006/len &amp;amp;, col, 4]], {#[[;; , 1]], &#xD;
              Prepend[#, #[[1]]] &amp;amp;@&#xD;
               BlockMap[Norm[#[[2]] - #[[1]]] &amp;amp;, #[[;; , 2, 1]], 2, 1], &#xD;
              Subdivide[Length[#] - 1]}]] &amp;amp;, &#xD;
         Reverse@Transpose[&#xD;
           Through[rflist[#]] &amp;amp; /@ (Range[0, 3, .1]), {3, 2, 1}], {2}]}, &#xD;
       Background -&amp;gt; Black, ImageSize -&amp;gt; {500, Automatic}, &#xD;
       PlotRange -&amp;gt; {{-1.28, 1.28}, {-0.72, 0.72}}];&#xD;
&#xD;
    HDRRasterize[g, #^(1/2.2) &amp;amp;, ImageSize -&amp;gt; {1920, 1080}]&#xD;
&#xD;
![With all effects, static observer][14]&#xD;
&#xD;
Well, because objects at left are moving towards you, they will appear much brighter and blue-ish, while objects at right are much dimmer and red-ish.&#xD;
&#xD;
We can also consider the movement of the observer, which will make the image something like this:&#xD;
&#xD;
![With all effects, observer moving][15]&#xD;
&#xD;
Hooray!&#xD;
&#xD;
The notebook can be found in the attachment or at [my github repo](https://github.com/wjxway/Realistic_Blackhole_Accretion_Disk).&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=bh10.png&amp;amp;userId=1340903&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=T_001.png&amp;amp;userId=1340903&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Path_4.png&amp;amp;userId=1340903&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=illus2.png&amp;amp;userId=1340903&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=illus1.png&amp;amp;userId=1340903&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=LightBending.png&amp;amp;userId=1340903&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=WithTimeCorrection.png&amp;amp;userId=1340903&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=illus3.png&amp;amp;userId=1340903&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=IntensityIllus.png&amp;amp;userId=1340903&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=illus4.png&amp;amp;userId=1340903&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=WithIntensity1.png&amp;amp;userId=1340903&#xD;
  [12]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Doppler.jpg&amp;amp;userId=1340903&#xD;
  [13]: https://community.wolfram.com//c/portal/getImageAttachment?filename=FrontLight.jpg&amp;amp;userId=1340903&#xD;
  [14]: https://community.wolfram.com//c/portal/getImageAttachment?filename=WithAllEffects.png&amp;amp;userId=1340903&#xD;
  [15]: https://community.wolfram.com//c/portal/getImageAttachment?filename=WithObserverMoving.png&amp;amp;userId=1340903</description>
    <dc:creator>Jingxian Wang</dc:creator>
    <dc:date>2020-07-02T11:26:03Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3467978">
    <title>Collatz conjecture visualizations</title>
    <link>https://community.wolfram.com/groups/-/m/t/3467978</link>
    <description>![Collatz conjecture visualizations][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Main227052025.png&amp;amp;userId=20103&#xD;
  [2]: https://www.wolframcloud.com/obj/85fd1874-61c4-4798-8e48-d8ba6d037984</description>
    <dc:creator>Anton Antonov</dc:creator>
    <dc:date>2025-05-27T12:23:54Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1843550">
    <title>Mandelbrot Set on Neural Network</title>
    <link>https://community.wolfram.com/groups/-/m/t/1843550</link>
    <description>*MODERATOR NOTE: a submission to computations art contest, see more:* https://wolfr.am/CompArt-22&#xD;
&#xD;
----------&#xD;
&#xD;
Showing Abs and Arg fields of Mandelbrot set under 200 iterations&#xD;
&#xD;
![Mandelbrot_wallpaper.png][1]&#xD;
&#xD;
---&#xD;
&#xD;
Showing Abs field of Mandelbrot set under 9 iterations&#xD;
&#xD;
![9_iteration_abs.png][2]&#xD;
&#xD;
---&#xD;
&#xD;
Showing Re vs. Im complex mapping of Mandelbrot set under 200 iterations&#xD;
&#xD;
![ReIm_Complex_map.png][3]&#xD;
&#xD;
---&#xD;
&#xD;
Mandelbrot Set on Neural Network&#xD;
===========================================&#xD;
&#xD;
[The MXNet-based neural network framework](http://reference.wolfram.com/language/guide/NeuralNetworks.html) has been introduced to Wolfram Language since version 11. It is mostly designed for deep learning. However if we think about it, neural network is merely another fancy way to implement a certain program. As more and more functions are supported, it is now possible for us to &amp;#034;compile&amp;#034; general numerical program to neural network, which essentially gives us an interface to GPGPU parallel ability without the hassle of low-level coding.&#xD;
&#xD;
Inspired by [Brian](https://community.wolfram.com/web/tl2854)&amp;#039;s [recent post on MathCompile](https://community.wolfram.com/groups/-/m/t/1830592), we demonstrate in this post how to implement a neural network to compute the Mandelbrot set.&#xD;
&#xD;
## Utilities&#xD;
&#xD;
As usual here is the code dump of some helper functions. Readers can evaluate then safely skip this section.&#xD;
&#xD;
### code dump of helper functions&#xD;
&#xD;
```&#xD;
ClearAll[pipe, branch]&#xD;
pipe   = RightComposition;&#xD;
branch = Through@*{##} &amp;amp;;&#xD;
```&#xD;
```&#xD;
Needs[&amp;#034;NeuralNetworks`&amp;#034;]&#xD;
```&#xD;
```&#xD;
Clear[netInputPortSort]&#xD;
netInputPortSort[inPortLst_List] := Function[origNet, netInputPortSort[origNet, inPortLst]]&#xD;
netInputPortSort[origNet_NetGraph, inPortLst_List] :=&#xD;
 Block[{NetGraph = Inactive[NetGraph], fullnet, net},&#xD;
           fullnet         = origNet&#xD;
           ; net           = fullnet[[1]]&#xD;
           ; net[&amp;#034;Inputs&amp;#034;] = AssociationThread[Rule[inPortLst, inPortLst /. net[&amp;#034;Inputs&amp;#034;]]]&#xD;
           ; ReplacePart[fullnet, 1 -&amp;gt; net]&#xD;
      ] // Activate&#xD;
```&#xD;
&#xD;
---&#xD;
&#xD;
# Basic concept&#xD;
&#xD;
The center of the Mandelbrot set computation is a simple iteration:&#xD;
&#xD;
$$\left\{&#xD;
\begin{align}&#xD;
 z_n &amp;amp;= c+z_{n-1}^2 \\&#xD;
 z_0 &amp;amp;= 0&#xD;
\end{align}&#xD;
\right.$$&#xD;
&#xD;
Under simple iteration it leads to the Mandelbrot set.&#xD;
&#xD;
```&#xD;
Block[{region, c, faclets}&#xD;
         ,&#xD;
         (* random-points as different c for iteration: *)&#xD;
         region = Disk[{-.5, 0}, 2] // DiscretizeGraphics // DiscretizeRegion[#, MaxCellMeasure -&amp;gt; .0001] &amp;amp;&#xD;
         ; faclets = MeshCells[region, 2][[;; , 1]]&#xD;
         ; c = MeshCoordinates[region].{1, I}&#xD;
         ;(* The iteration taking place simultaneously for all c, nested 21 steps: *)&#xD;
         Nest[Function[z, z^2 + c], 0, 21] //&#xD;
              (* Visualizing the result: *)&#xD;
              pipe[&#xD;
                      pipe[(* Regularizing the norm for a clear visualization: *)&#xD;
                           Abs, HistogramTransform, Rescale, (1 - #)^2 &amp;amp;]&#xD;
                      , Append[ReIm[c]\[Transpose], #]\[Transpose] &amp;amp;&#xD;
                      , Graphics3D[&#xD;
                                    GraphicsComplex[#, {EdgeForm[], Polygon@faclets}]&#xD;
                                    , Boxed -&amp;gt; False, SphericalRegion -&amp;gt; True, RotationAction -&amp;gt; &amp;#034;Fit&amp;#034;&#xD;
                                    , ViewPoint -&amp;gt; {1, -2.4, 2.4}, ViewVertical -&amp;gt; {0, 0, 1}&#xD;
                                  ] &amp;amp;&#xD;
                  ]&#xD;
     ]&#xD;
```&#xD;
&#xD;
![3D mesh of Mandelbrot set][4]&#xD;
&#xD;
Using the built-in [`MandelbrotSetPlot`](http://reference.wolfram.com/language/ref/MandelbrotSetPlot.html) function, it&amp;#039;s straightforward to plot the traditional Mandelbrot set visualization:&#xD;
&#xD;
```&#xD;
MandelbrotSetPlot[{-2.5 - 2 I, 1.5 + 2 I}]&#xD;
```&#xD;
&#xD;
![MandelbrotSetPlot][5]&#xD;
&#xD;
With some test we can notice that, for fixed `MaxIterations`, the relationship between computing time of `MandelbrotSetPlot` and `ImageResolution` follows a power law.&#xD;
&#xD;
```&#xD;
builtInTimeTest = {#, AbsoluteTiming[MandelbrotSetPlot[{-2.5 - 2 I, 1.5 + 2 I}, MaxIterations -&amp;gt; 100, ImageResolution -&amp;gt; #];][[1]]} &amp;amp; /@ Range[101, 4001, 100]&#xD;
&#xD;
NonlinearModelFit[builtInTimeTest, a r^k, {a, k}, r][r] //&#xD;
  LogLogPlot[#, {r, 400, 5000}, PlotStyle -&amp;gt; Directive[Red, AbsoluteThickness[2]], Frame -&amp;gt; True, FrameTicks -&amp;gt; All] &amp;amp; //&#xD;
  Show[{#&#xD;
        , ListLogLogPlot[builtInTimeTest, PlotMarkers -&amp;gt; &amp;#034;OpenMarkers&amp;#034;, PlotRange -&amp;gt; All]&#xD;
        }, FrameLabel -&amp;gt; {&amp;#034;ImageResolution&amp;#034;, &amp;#034;AbsoluteTiming&amp;#034;}] &amp;amp;&#xD;
```&#xD;
&#xD;
![time benchmark of MandelbrotSetPlot][6]&#xD;
&#xD;
This is a scenario where parallel computation might make a difference.&#xD;
&#xD;
---&#xD;
&#xD;
# Mandelbrot set on neural network -- A naïve attempt&#xD;
&#xD;
## The implementation&#xD;
&#xD;
### Iteration core net&#xD;
&#xD;
Neural network (short for **_NN_**) doesn&amp;#039;t support complex number (yet). Aside from that, the iteration formula is simple enough for [`ThreadingLayer`](http://reference.wolfram.com/language/ref/ThreadingLayer.html):&#xD;
&#xD;
```&#xD;
iterNet = Module[{c = cX + cY I, z = x + y I},&#xD;
  z^2 + c // pipe[&#xD;
                    ReIm, ComplexExpand, Echo[#, &amp;#034;{Re[\!\(\*SuperscriptBox[\(z\), \(2\)]\)+c], Im[\!\(\*SuperscriptBox[\(z\), \(2\)]\)+c]}:&amp;#034;] &amp;amp;&#xD;
                    , Map@pipe[&#xD;
                                 Inactive[Function][{cX, cY, x, y}, #] &amp;amp;&#xD;
                                 , Activate&#xD;
                                 , ThreadingLayer&#xD;
                              ]&#xD;
                    , Inactive[NetGraph][#&#xD;
                                            , {&#xD;
                                                   (NetPort /@ StringSplit[&amp;#034;cX,cY,x,y&amp;#034;, &amp;#034;,&amp;#034;]) -&amp;gt; # &amp;amp; /@ {1, 2}&#xD;
                                                   , 1 -&amp;gt; NetPort[&amp;#034;x&amp;#034;], 2 -&amp;gt; NetPort[&amp;#034;y&amp;#034;]&#xD;
                                              }&#xD;
                                        ] &amp;amp;&#xD;
                    , Activate&#xD;
                 ]&#xD;
  ]&#xD;
```&#xD;
&#xD;
![iterNet][7]&#xD;
&#xD;
It&amp;#039;s very easy to perform the iteration with the help of [`Nest`](http://reference.wolfram.com/language/ref/Nest.html) / [`NestList`](http://reference.wolfram.com/language/ref/NestList.html).&#xD;
&#xD;
```&#xD;
Block[{region, c, xyInit, result}&#xD;
         ,&#xD;
         (* random-points as different c for iteration: *)&#xD;
         region = Disk[{0, 0}, .5] // DiscretizeGraphics // DiscretizeRegion[#, MaxCellMeasure -&amp;gt; .01] &amp;amp;&#xD;
         ; c = MeshCoordinates[region].{1, I} // ReIm&#xD;
         ; c = AssociationThread[StringSplit[&amp;#034;cX,cY&amp;#034;, &amp;#034;,&amp;#034;], c\[Transpose]]&#xD;
         ; xyInit = AssociationThread[StringSplit[&amp;#034;x,y&amp;#034;, &amp;#034;,&amp;#034;], 0*Values[c]]&#xD;
         ; result = NestList[&#xD;
                                pipe[&#xD;
                                      Map[Clip[#, {-2, 2}] &amp;amp;]&#xD;
                                      , Join[c, #] &amp;amp;&#xD;
                                      , iterNet&#xD;
                                    ]&#xD;
                                , xyInit, 20&#xD;
                            ]&#xD;
         ; result //&#xD;
             pipe[&#xD;
                     Values, Rest, Map@Transpose&#xD;
                     , Transpose&#xD;
                     , MapThread[{#2, BSplineCurve@#1} &amp;amp;, {#, # // Length // Range // N // Rescale // Map[ColorData[&amp;#034;Rainbow&amp;#034;]]}] &amp;amp;&#xD;
                     , Graphics[#, Frame -&amp;gt; True, FrameTicks -&amp;gt; All, PlotRange -&amp;gt; {GoldenRatio {-1, 1}, {-1, 1}}, PlotRangeClipping -&amp;gt; True] &amp;amp;&#xD;
                 ]&#xD;
     ]&#xD;
```&#xD;
&#xD;
![Nest on iterNet][8]&#xD;
&#xD;
### Nest net&#xD;
&#xD;
Now we have the core net representing the iteration formula, we need to mimic the functionality of `Nest[f, expr, n]` fully on a neural network.&#xD;
&#xD;
The go-to function is of course [`NetNestOperator`](https://reference.wolfram.com/language/ref/NetNestOperator.html). However in our case, the same $c$ is used repeatedly for all iterations, so we&amp;#039;d like to pass it directly to each iteration. Thus, we do it with the following customized `NetNestPartialOperator` function:&#xD;
&#xD;
```&#xD;
ClearAll[NetNestPartialOperator]&#xD;
NetNestPartialOperator[net_, staticPorts_List, nestPort_, iterNum_Integer] :=&#xD;
 Module[{pIdx, netIdx, staticpath, nestpath},&#xD;
  netIdx = Range[iterNum]&#xD;
  ; pIdx = AssociationThread[staticPorts, staticPorts // Length // Range // Map[ToString]]&#xD;
  ; staticpath = Function[p, NetPort[&amp;#034;static&amp;#034; &amp;lt;&amp;gt; pIdx[p]] -&amp;gt; (NetPort[#, p] &amp;amp; /@ netIdx)] /@ staticPorts&#xD;
  ; nestpath = Thread[Flatten[{NetPort[&amp;#034;nest&amp;#034;], netIdx // Most}] -&amp;gt; (NetPort[#, nestPort] &amp;amp; /@ netIdx)]&#xD;
  ; Inactive[NetGraph][ConstantArray[net, iterNum], {staticpath, nestpath} // Flatten] //&#xD;
       Activate // &#xD;
       netInputPortSort[Flatten[{&amp;#034;nest&amp;#034;, &amp;#034;static&amp;#034; &amp;lt;&amp;gt; # &amp;amp; /@ Values[pIdx]}]]&#xD;
  ]&#xD;
```&#xD;
&#xD;
Basically our `NetNestPartialOperator` takes a [`net_NetGraph`](https://reference.wolfram.com/language/ref/NetGraph.html) as the 1st argument. One of `net`&amp;#039;s input ports, i.e. `nestPort`, is going to be nested across iterations; other input ports (i.e. `staticPorts`) will be feed in constant/non-nested values.&#xD;
&#xD;
Here is a simple example realizing a 5 steps nest iteration `Nest[Function[c,a+b+c],c0,5]`:&#xD;
&#xD;
```&#xD;
Module[{coreNet, nestNet}&#xD;
           , coreNet = NetGraph[{ThreadingLayer[#1+#2+#3&amp;amp;]}, {{NetPort[&amp;#034;a&amp;#034;],NetPort[&amp;#034;b&amp;#034;],NetPort[&amp;#034;c&amp;#034;]}-&amp;gt;1},&amp;#034;a&amp;#034;-&amp;gt;&amp;#034;Real&amp;#034;,&amp;#034;b&amp;#034;-&amp;gt;&amp;#034;Real&amp;#034;,&amp;#034;c&amp;#034;-&amp;gt;&amp;#034;Real&amp;#034;]&#xD;
           ; nestNet = NetNestPartialOperator[coreNet, {&amp;#034;a&amp;#034;, &amp;#034;b&amp;#034;}, &amp;#034;c&amp;#034;, 5]&#xD;
           ; {&#xD;
               {&amp;#034;coreNet&amp;#034;, &amp;#034;nestNet&amp;#034;}&#xD;
               , Quiet[&#xD;
                         NetInformation[#, &amp;#034;MXNetNodeGraph&amp;#034;] // Graph[#, VertexSize -&amp;gt; 0.2, VertexLabels -&amp;gt; &amp;#034;Name&amp;#034;] &amp;amp;&#xD;
                      ] &amp;amp; /@ {coreNet, nestNet}&#xD;
             }\[Transpose] // &#xD;
             Grid[#, Background -&amp;gt; {{GrayLevel[.9], None}, None}, Frame -&amp;gt; All, FrameStyle -&amp;gt; Black] &amp;amp;&#xD;
      ]&#xD;
```&#xD;
&#xD;
![NetNestPartialOperator example][9]&#xD;
&#xD;
### The Mandelbrot net&#xD;
&#xD;
In order to construct a net suitable for `NetNestPartialOperator`, we merge the real and imaginary ports in `iterNet` into a single &amp;#034;complex&amp;#034; port.&#xD;
&#xD;
```&#xD;
zNet = NetGraph[{ReplicateLayer[1], ReplicateLayer[1], CatenateLayer[]}, {NetPort[&amp;#034;1&amp;#034;] -&amp;gt; 1, NetPort[&amp;#034;2&amp;#034;] -&amp;gt; 2, {1, 2} -&amp;gt; 3}];&#xD;
&#xD;
nestcoreNet = NetGraph[&#xD;
                        {PartLayer[1], PartLayer[2], iterNet, zNet}&#xD;
                        , {&#xD;
                               (NetPort[#] -&amp;gt; NetPort[3, #]) &amp;amp; /@ StringSplit[&amp;#034;cX,cY&amp;#034;, &amp;#034;,&amp;#034;]&#xD;
                             , NetPort[&amp;#034;z&amp;#034;] -&amp;gt; {1, 2}&#xD;
                             , {{1, 2}, StringSplit[&amp;#034;x,y&amp;#034;, &amp;#034;,&amp;#034;]} // MapThread[(#1 -&amp;gt; NetPort[3, #2]) &amp;amp;]&#xD;
                             , {StringSplit[&amp;#034;x,y&amp;#034;, &amp;#034;,&amp;#034;], StringSplit[&amp;#034;1,2&amp;#034;, &amp;#034;,&amp;#034;]} // MapThread[(NetPort[3, #1] -&amp;gt; NetPort[4, #2]) &amp;amp;]&#xD;
                          }&#xD;
                      ]&#xD;
```&#xD;
&#xD;
![nestcoreNet][10]&#xD;
&#xD;
Thus a full net computing the Mandelbrot set is constructed as follows:&#xD;
&#xD;
```&#xD;
ClearAll[mandelbrot]&#xD;
mandelbrot[iterNum_Integer?Positive] :=&#xD;
     NetGraph[{&#xD;
                  zNet&#xD;
                , ElementwiseLayer[0 # &amp;amp;]&#xD;
                , NetNestPartialOperator[nestcoreNet, StringSplit[&amp;#034;cX,cY&amp;#034;, &amp;#034;,&amp;#034;], &amp;#034;z&amp;#034;, iterNum]&#xD;
              }, {&#xD;
                  {NetPort[&amp;#034;cX&amp;#034;], NetPort[&amp;#034;cY&amp;#034;]} -&amp;gt; 1 -&amp;gt; 2&#xD;
                , {2, NetPort[&amp;#034;cX&amp;#034;], NetPort[&amp;#034;cY&amp;#034;]} -&amp;gt; 3&#xD;
              }&#xD;
             ]&#xD;
```&#xD;
&#xD;
## Results&#xD;
&#xD;
We showcase our `mandelbrot` net with 9 iteration steps over the complex region ${-2-1.2I,1+1.2I}$, with a image resolution $401 \times 501$. The network is executed on a GPU (NVIDIA GeForce GTX 1050 Ti) with [`&amp;#034;Real64&amp;#034;`](https://reference.wolfram.com/language/ref/NetGraph.html#1010560149) precision.&#xD;
&#xD;
```&#xD;
mandelbrotF = mandelbrot[9];&#xD;
```&#xD;
```&#xD;
result =&#xD;
  Module[{region = {-2 - 1.2 I, 1 + 1.2 I}, resol = 501, aspr},&#xD;
         region = region // ReIm // Transpose&#xD;
         ; aspr = region.{-1, 1} // Reverse // Apply[Divide]&#xD;
         ; resol = resol {1, aspr} // Round&#xD;
         ; {resol, region} //&#xD;
             pipe[&#xD;
                   MapThread[Rescale[Range[#1] // N // Rescale, {0, 1}, #2] &amp;amp;]&#xD;
                   , Tuples&#xD;
                   , AssociationThread[{&amp;#034;cX&amp;#034;, &amp;#034;cY&amp;#034;}, #\[Transpose]] &amp;amp;&#xD;
                   , AbsoluteTiming[mandelbrotF[#, WorkingPrecision -&amp;gt; &amp;#034;Real64&amp;#034;, TargetDevice -&amp;gt; &amp;#034;GPU&amp;#034;]] &amp;amp;&#xD;
                   , pipe[&#xD;
                            branch[pipe[First, Quantity[#, &amp;#034;Seconds&amp;#034;] &amp;amp;, Echo[#, &amp;#034;Computing time on NN:&amp;#034;] &amp;amp;], Last]&#xD;
                            , Last]&#xD;
                   , Developer`ToPackedArray&#xD;
                   , ArrayReshape[#, {2, Sequence @@ resol}] &amp;amp;&#xD;
                   , {1, I}.# &amp;amp;&#xD;
                   , Transpose, Reverse&#xD;
                 ]&#xD;
        ];&#xD;
&#xD;
(* Computing time on NN: 3.08505 s *)&#xD;
```&#xD;
```&#xD;
result // Dimensions&#xD;
(* {401, 501} *)&#xD;
```&#xD;
```&#xD;
result //&#xD;
   pipe[&#xD;
         branch[&#xD;
                 pipe[ Abs&#xD;
                     , pipe[&#xD;
                             branch[Flatten /* HistogramTransform, Dimensions /* Last]&#xD;
                           , Apply@Partition&#xD;
                           ]&#xD;
                     , Rescale, (1 - #)^5 &amp;amp;&#xD;
                     ]&#xD;
               , pipe[Arg, Sin, Rescale]&#xD;
               ]&#xD;
       , Map @ pipe[&#xD;
                     Image[#, ImageSize -&amp;gt; Length[#]] &amp;amp;&#xD;
                   , Colorize[#, ColorFunction -&amp;gt; &amp;#034;DarkColorFractalGradient&amp;#034;] &amp;amp;&#xD;
                   ]&#xD;
       ]&#xD;
```&#xD;
&#xD;
![naive result][11]&#xD;
&#xD;
Note the highlighted [periodic bulbs and Mandelbrot dendritic islands](https://dhushara.com/DarkHeart/DarkHeart.htm) in the left image, and the pattern approximately following the [external rays](https://en.wikipedia.org/wiki/External_ray) of the set in the right image.&#xD;
&#xD;
As a comparison, here is the result from the same region, iteration steps and resolution using the built-in `MandelbrotSetPlot` function.&#xD;
&#xD;
```&#xD;
AbsoluteTiming[&#xD;
                MandelbrotSetPlot[{-2 - 1.2 I, 1 + 1.2 I}, MaxIterations -&amp;gt; 9, ImageResolution -&amp;gt; 501]&#xD;
              ] //&#xD;
     pipe[&#xD;
           branch[pipe[First, Quantity[#, &amp;#034;Seconds&amp;#034;] &amp;amp;, Echo[#, &amp;#034;Computing time:&amp;#034;] &amp;amp;], Last], Last&#xD;
         , #[[1, 1]] &amp;amp;, Reverse, Image[#, ImageSize -&amp;gt; Dimensions[#][[1]]] &amp;amp;&#xD;
         ]&#xD;
&#xD;
(* Computing time: 0.187943 s *)&#xD;
```&#xD;
&#xD;
![MandelbrotSetPlotOver(-2-1.2I,1+1.2I)][12]&#xD;
&#xD;
Clearly at this resolution scale, `MandelbrotSetPlot` is much faster than our neural-net function. But at a much larger resolution our function will eventually win.&#xD;
&#xD;
```&#xD;
myMandelbrotSetPlotTiming[resolution_Integer] := &#xD;
 Module[ {region = {-2 - 1.2 I, 1 + 1.2 I}, aspr, resol}&#xD;
       , region = region // ReIm // Transpose&#xD;
       ; aspr   = region.{-1, 1} // Reverse // Apply[Divide]&#xD;
       ; resol  = resolution {1, aspr} // Round&#xD;
       ; {resol, region} //&#xD;
            pipe[&#xD;
                  MapThread[Rescale[Range[#1] // N // Rescale, {0, 1}, #2] &amp;amp;]&#xD;
                , Tuples&#xD;
                , AssociationThread[{&amp;#034;cX&amp;#034;, &amp;#034;cY&amp;#034;}, #\[Transpose]] &amp;amp;&#xD;
                , AbsoluteTiming[mandelbrotF[#, WorkingPrecision -&amp;gt; &amp;#034;Real64&amp;#034;, TargetDevice -&amp;gt; &amp;#034;GPU&amp;#034;];][[1]] &amp;amp;&#xD;
                , {resolution, #} &amp;amp;&#xD;
                ]&#xD;
       ]&#xD;
&#xD;
myTimeTest = myMandelbrotSetPlotTiming /@ Range[101, 4001, 100];&#xD;
&#xD;
NonlinearModelFit[myTimeTest, a r^k, {a, k}, r][r] //&#xD;
  LogLogPlot[#, {r, 400, 5000}, PlotStyle -&amp;gt; Directive[Purple, AbsoluteThickness[2]], Frame -&amp;gt; True, FrameTicks -&amp;gt; All] &amp;amp; //&#xD;
 Show[ {&#xD;
         #&#xD;
       , ListLogLogPlot[myTimeTest, PlotMarkers -&amp;gt; Graphics[{FaceForm[White], EdgeForm[{Orange, AbsoluteThickness[1]}], Polygon[CirclePoints[4]]}, ImageSize -&amp;gt; 7], PlotRange -&amp;gt; All]&#xD;
       }&#xD;
     , FrameLabel -&amp;gt; {&amp;#034;ImageResolution&amp;#034;, &amp;#034;AbsoluteTiming&amp;#034;}&#xD;
     ] &amp;amp;&#xD;
```&#xD;
&#xD;
![time benchmark of NN based mandelbrot][13]&#xD;
&#xD;
Comparing with previous benchmark result of `MandelbrotSetPlot`, we can see our NN-based function has an advantage when the image resolution is large enough.&#xD;
&#xD;
![time bench comparison][14]&#xD;
&#xD;
---&#xD;
&#xD;
# Mandelbrot set on neural network -- Avoid overflow&#xD;
&#xD;
Careful readers will find that for larger iteration steps and/or a larger computing region, our naïvely implemented `mandelbrot` will lead to overflow. That is of course due to the $c$ values leading to divergency. One simple way to avoid this overflow is to constrain the nested $z$ to a bounded region at every iteration step.&#xD;
&#xD;
## The implementation&#xD;
&#xD;
### A constrained iteration core net&#xD;
&#xD;
The simplest way to constrain the nested $z$ is to clip it into a rectangle region.&#xD;
&#xD;
```&#xD;
iterNet = Module[{c = cX + cY I, z = x + y I},&#xD;
  z^2 + c // pipe[&#xD;
                   ReIm, ComplexExpand, Echo[#, &amp;#034;{Re[\!\(\*SuperscriptBox[\(z\), \(2\)]\)+c], Im[\!\(\*SuperscriptBox[\(z\), \(2\)]\)+c]}:&amp;#034;] &amp;amp;&#xD;
                 , Map@pipe[&#xD;
(* The constraint: -&amp;gt; *)     Block[{escR = 3}, escR Clip[#/escR]] &amp;amp;&#xD;
                           , Inactive[Function][{cX, cY, x, y}, #] &amp;amp;&#xD;
                           , Activate&#xD;
                           , ThreadingLayer&#xD;
                           ]&#xD;
                 , Inactive[NetGraph][#&#xD;
                                         , {&#xD;
                                                (NetPort /@ StringSplit[&amp;#034;cX,cY,x,y&amp;#034;, &amp;#034;,&amp;#034;]) -&amp;gt; # &amp;amp; /@ {1, 2}&#xD;
                                                , 1 -&amp;gt; NetPort[&amp;#034;x&amp;#034;], 2 -&amp;gt; NetPort[&amp;#034;y&amp;#034;]&#xD;
                                           }&#xD;
                                     ] &amp;amp;&#xD;
                 , Activate&#xD;
                 ]&#xD;
  ]&#xD;
```&#xD;
&#xD;
### The Mandelbrot net&#xD;
&#xD;
Re-evaluating the rest of the code leads to our simply constrained `mandelbrotCons` function.&#xD;
&#xD;
```&#xD;
nestcoreNet = NetGraph[&#xD;
                        {PartLayer[1], PartLayer[2], iterNet, zNet}&#xD;
                      , {&#xD;
                          (NetPort[#] -&amp;gt; NetPort[3, #]) &amp;amp; /@ StringSplit[&amp;#034;cX,cY&amp;#034;, &amp;#034;,&amp;#034;]&#xD;
                        , NetPort[&amp;#034;z&amp;#034;] -&amp;gt; {1, 2}&#xD;
                        , {{1, 2}, StringSplit[&amp;#034;x,y&amp;#034;, &amp;#034;,&amp;#034;]} // MapThread[(#1 -&amp;gt; NetPort[3, #2]) &amp;amp;]&#xD;
                        , {StringSplit[&amp;#034;x,y&amp;#034;, &amp;#034;,&amp;#034;], StringSplit[&amp;#034;1,2&amp;#034;, &amp;#034;,&amp;#034;]} // MapThread[(NetPort[3, #1] -&amp;gt; NetPort[4, #2]) &amp;amp;]&#xD;
                        }&#xD;
                      ]&#xD;
```&#xD;
```&#xD;
ClearAll[mandelbrotCons]&#xD;
mandelbrotCons[iterNum_Integer?Positive] :=&#xD;
     NetGraph[{&#xD;
                zNet&#xD;
              , ElementwiseLayer[0 # &amp;amp;]&#xD;
              , NetNestPartialOperator[nestcoreNet, StringSplit[&amp;#034;cX,cY&amp;#034;, &amp;#034;,&amp;#034;], &amp;#034;z&amp;#034;, iterNum]&#xD;
              },&#xD;
              {&#xD;
                {NetPort[&amp;#034;cX&amp;#034;], NetPort[&amp;#034;cY&amp;#034;]} -&amp;gt; 1 -&amp;gt; 2&#xD;
              , {2, NetPort[&amp;#034;cX&amp;#034;], NetPort[&amp;#034;cY&amp;#034;]} -&amp;gt; 3&#xD;
              }&#xD;
             ]&#xD;
```&#xD;
&#xD;
## Results&#xD;
&#xD;
Now we can go for much larger iteration steps on a larger region.&#xD;
&#xD;
```&#xD;
mandelbrotConsF = mandelbrotCons[200];&#xD;
```&#xD;
```&#xD;
result =&#xD;
  Module[{region = {-3 - 2 I, 1 + 2 I}, resol = 1001, aspr},&#xD;
         region = region // ReIm // Transpose&#xD;
         ; aspr = region.{-1, 1} // Reverse // Apply[Divide]&#xD;
         ; resol = resol {1, aspr} // Round&#xD;
         ; {resol, region} //&#xD;
             pipe[&#xD;
                   MapThread[Rescale[Range[#1] // N // Rescale, {0, 1}, #2] &amp;amp;]&#xD;
                   , Tuples&#xD;
                   , AssociationThread[{&amp;#034;cX&amp;#034;, &amp;#034;cY&amp;#034;}, #\[Transpose]] &amp;amp;&#xD;
                   , AbsoluteTiming[mandelbrotConsF[#, WorkingPrecision -&amp;gt; &amp;#034;Real64&amp;#034;, TargetDevice -&amp;gt; &amp;#034;GPU&amp;#034;]] &amp;amp;&#xD;
                   , pipe[&#xD;
                            branch[pipe[First, Quantity[#, &amp;#034;Seconds&amp;#034;] &amp;amp;, Echo[#, &amp;#034;Computing time on NN:&amp;#034;] &amp;amp;], Last]&#xD;
                            , Last]&#xD;
                   , Developer`ToPackedArray&#xD;
                   , ArrayReshape[#, {2, Sequence @@ resol}] &amp;amp;&#xD;
                   , {1, I}.# &amp;amp;&#xD;
                   , Transpose, Reverse&#xD;
                 ]&#xD;
        ];&#xD;
&#xD;
(* Computing time on NN: 6.29684 s *)&#xD;
```&#xD;
```&#xD;
result // Dimensions&#xD;
(* {1001, 1001} *)&#xD;
```&#xD;
```&#xD;
result //&#xD;
   pipe[&#xD;
         branch[&#xD;
                 pipe[ Abs&#xD;
                     , pipe[&#xD;
                             branch[Flatten /* HistogramTransform, Dimensions /* Last]&#xD;
                           , Apply@Partition&#xD;
                           ]&#xD;
                     , Rescale, (1 - #)^5 &amp;amp;&#xD;
                     ]&#xD;
               , pipe[Arg, Sin, Rescale]&#xD;
               ]&#xD;
       , Map @ pipe[&#xD;
                     Image[#, ImageSize -&amp;gt; Length[#]] &amp;amp;&#xD;
                   , Colorize[#, ColorFunction -&amp;gt; &amp;#034;DarkColorFractalGradient&amp;#034;] &amp;amp;&#xD;
                   ]&#xD;
       ]&#xD;
```&#xD;
&#xD;
![constrained result][15]&#xD;
&#xD;
Or thresholding at 2 to get the classical Mandelbrot set.&#xD;
&#xD;
```&#xD;
result // Abs // UnitStep[2 - #] &amp;amp; // Image&#xD;
```&#xD;
&#xD;
![classical Mandelbrot 200][16]&#xD;
&#xD;
### Zoom-in&#xD;
&#xD;
For zoomed-in regions, this clipped version gives interesting results.&#xD;
&#xD;
```&#xD;
result =&#xD;
  Module[{region = {-0.65 + 0.47 I, -0.4 + 0.72 I}, resol = 1001, aspr},&#xD;
         region = region // ReIm // Transpose&#xD;
         ; aspr = region.{-1, 1} // Reverse // Apply[Divide]&#xD;
         ; resol = resol {1, aspr} // Round&#xD;
         ; {resol, region} //&#xD;
             pipe[&#xD;
                   MapThread[Rescale[Range[#1] // N // Rescale, {0, 1}, #2] &amp;amp;]&#xD;
                   , Tuples&#xD;
                   , AssociationThread[{&amp;#034;cX&amp;#034;, &amp;#034;cY&amp;#034;}, #\[Transpose]] &amp;amp;&#xD;
                   , AbsoluteTiming[mandelbrotConsF[#, WorkingPrecision -&amp;gt; &amp;#034;Real64&amp;#034;, TargetDevice -&amp;gt; &amp;#034;GPU&amp;#034;]] &amp;amp;&#xD;
                   , pipe[&#xD;
                            branch[pipe[First, Quantity[#, &amp;#034;Seconds&amp;#034;] &amp;amp;, Echo[#, &amp;#034;Computing time on NN:&amp;#034;] &amp;amp;], Last]&#xD;
                            , Last]&#xD;
                   , Developer`ToPackedArray&#xD;
                   , ArrayReshape[#, {2, Sequence @@ resol}] &amp;amp;&#xD;
                   , {1, I}.# &amp;amp;&#xD;
                   , Transpose, Reverse&#xD;
                 ]&#xD;
        ];&#xD;
&#xD;
(* Computing time on NN: 6.06289 s *)&#xD;
```&#xD;
```&#xD;
result // pipe[&#xD;
                branch[&#xD;
                        pipe[ Abs&#xD;
                            , pipe[branch[Flatten /* HistogramTransform, Dimensions /* Last], Apply@Partition]&#xD;
                            , Rescale, (1 - #)^5 &amp;amp;, Sin[\[Pi]/2 #] &amp;amp;, Rescale&#xD;
                            ]&#xD;
                      , pipe[Arg, Sin[#/2] &amp;amp;, Rescale]&#xD;
                      ]&#xD;
              , Map@pipe[ Image[#, ImageSize -&amp;gt; Round[Length[#]/2]] &amp;amp;&#xD;
                        , Colorize[#, ColorFunction -&amp;gt; &amp;#034;StarryNightColors&amp;#034;] &amp;amp;&#xD;
                        ]&#xD;
              ]&#xD;
```&#xD;
&#xD;
![zoom-inAt(-0.65+0.47I,-0.4+0.72I)][17]&#xD;
&#xD;
### Complex map&#xD;
&#xD;
We can also stylize the result any way we want, say, showing the complex mapping like the [`ComplexPlot`](https://reference.wolfram.com/language/ref/ComplexPlot.html).&#xD;
&#xD;
Abs vs. Arg:&#xD;
&#xD;
```&#xD;
result // pipe[&#xD;
                branch[&#xD;
                        pipe[ Arg&#xD;
                            , branch[&#xD;
                                      pipe[Sin[#/2] &amp;amp;, Rescale]&#xD;
                                    , pipe[&#xD;
                                            Sin[50 #] &amp;amp;, ArcSin, Rescale, #^.5 &amp;amp;&#xD;
                                          ]&#xD;
                                    ]&#xD;
                            ]&#xD;
                      , pipe[&#xD;
                              Abs&#xD;
                            , Rescale, Log[10^-3 + #] &amp;amp;, Rescale&#xD;
                            , branch[&#xD;
                                      pipe[Sin[200 #] &amp;amp;, ArcSin, Rescale, #^.5 &amp;amp;]&#xD;
                                    , pipe[#^5 &amp;amp;, Rescale[#, {0, 1}, {1, .3}] &amp;amp;]&#xD;
                                    ]&#xD;
                            ]&#xD;
                      ]&#xD;
              , Apply@Function[{arg2, abs2}, {arg2[[1]], arg2[[2]] abs2[[1]], abs2[[2]]}]&#xD;
              , Image[#, ColorSpace -&amp;gt; &amp;#034;HSB&amp;#034;, Interleaving -&amp;gt; False] &amp;amp;&#xD;
              ]&#xD;
```&#xD;
&#xD;
![Complex map: Abs vs Arg][18]&#xD;
&#xD;
Or Re vs. Im:&#xD;
&#xD;
```&#xD;
result // pipe[&#xD;
                branch[&#xD;
                      pipe[&#xD;
                            ReIm, Transpose[#, {2, 3, 1}] &amp;amp;&#xD;
                          , Map@pipe[&#xD;
                                      Cos[100 2 \[Pi] #] &amp;amp;, Rescale, #^.2 &amp;amp;&#xD;
                                    ]&#xD;
                          ]&#xD;
                      , pipe[&#xD;
                              Abs&#xD;
                            , Rescale, Log[10^-3 + #] &amp;amp;, Rescale&#xD;
                            , branch[&#xD;
                                      pipe[Sin[\[Pi]/2 #] &amp;amp;, Rescale]&#xD;
                                    , pipe[#^5 &amp;amp;, Rescale[#, {0, 1}, {1, .5}] &amp;amp;]&#xD;
                                    ]&#xD;
                            ]&#xD;
                      ]&#xD;
              , Apply@Function[{reim, abs2}, {abs2[[1]], Times @@ reim, abs2[[2]]}]&#xD;
              , Image[#, ColorSpace -&amp;gt; &amp;#034;HSB&amp;#034;, Interleaving -&amp;gt; False] &amp;amp;&#xD;
              ]&#xD;
```&#xD;
&#xD;
![Complex map: Re vs Im][19]&#xD;
&#xD;
### A different region&#xD;
&#xD;
(The detailed code in this section is omitted in the post, but included in the attached notebook.)&#xD;
&#xD;
Computing over a different region (`-0.0452407411 + 0.9868162204352258 I + 2.7 10^-5 {-1 - I, 1 + I}`) and fiddling with color palettes from `ColorData[&amp;#034;ThemeGradients&amp;#034;]` gives us this wallpaper-like result (the [`ColorFunction`](https://reference.wolfram.com/language/ref/Colorize.html#777264821) used here is `&amp;#034;M10DefaultDensityGradient&amp;#034;`).&#xD;
&#xD;
![zoom-in 2][20]&#xD;
&#xD;
Also the corresponding complex map plots:&#xD;
&#xD;
![complex maps: Abs vs Arg &amp;amp; Re vs Im][21]&#xD;
&#xD;
---&#xD;
&#xD;
# References&#xD;
&#xD;
 - [Exploding the Dark Heart of Chaos](https://dhushara.com/DarkHeart/DarkHeart.htm)&#xD;
 &#xD;
 - [Wikipedia: External ray](https://en.wikipedia.org/wiki/External_ray)&#xD;
 &#xD;
 - [MathWorld: Mandelbrot Set](http://mathworld.wolfram.com/MandelbrotSet.html)&#xD;
 &#xD;
 - [Wikipedia: Mandelbrot set](https://en.wikipedia.org/wiki/Mandelbrot_set)&#xD;
&#xD;
 - [The Mandelbrot Set Browser](http://www.cuug.ab.ca/dewara/mandelbrot/Mandelbrowser.html)&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Mandelbrot_wallpaper.png&amp;amp;userId=93201&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=9_iteration_abs.png&amp;amp;userId=93201&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ReIm_Complex_map.png&amp;amp;userId=93201&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=3D_mesh.png&amp;amp;userId=93201&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=MandelbrotSetPlot.png&amp;amp;userId=93201&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=time_bench_MandelbrotSetPlot.png&amp;amp;userId=93201&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=iterNet.png&amp;amp;userId=93201&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=iterNet_Nest.png&amp;amp;userId=93201&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=NetNestPartialOperator_example.png&amp;amp;userId=93201&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=nestcoreNet.png&amp;amp;userId=93201&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=naive_result.png&amp;amp;userId=93201&#xD;
  [12]: https://community.wolfram.com//c/portal/getImageAttachment?filename=MandelbrotSetPlot2.png&amp;amp;userId=93201&#xD;
  [13]: https://community.wolfram.com//c/portal/getImageAttachment?filename=time_bench_NN.png&amp;amp;userId=93201&#xD;
  [14]: https://community.wolfram.com//c/portal/getImageAttachment?filename=time_bench_comparison.png&amp;amp;userId=93201&#xD;
  [15]: https://community.wolfram.com//c/portal/getImageAttachment?filename=constrained_result.png&amp;amp;userId=93201&#xD;
  [16]: https://community.wolfram.com//c/portal/getImageAttachment?filename=classical_Mandelbrot_200.png&amp;amp;userId=93201&#xD;
  [17]: https://community.wolfram.com//c/portal/getImageAttachment?filename=zoom_in_1.png&amp;amp;userId=93201&#xD;
  [18]: https://community.wolfram.com//c/portal/getImageAttachment?filename=AbsArg_Complex_map.png&amp;amp;userId=93201&#xD;
  [19]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ReIm_Complex_map.png&amp;amp;userId=93201&#xD;
  [20]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Mandelbrot_wallpaper.png&amp;amp;userId=93201&#xD;
  [21]: https://community.wolfram.com//c/portal/getImageAttachment?filename=complex_maps_2.png&amp;amp;userId=93201</description>
    <dc:creator>Silvia Hao</dc:creator>
    <dc:date>2019-12-19T07:59:59Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3202678">
    <title>Electric vehicle insights: battery management system - thermal dynamics</title>
    <link>https://community.wolfram.com/groups/-/m/t/3202678</link>
    <description>![System model+simulation w/ FEM: electric vehicle Tesla Model S energy, battery, drivetrain, thermal][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Slide1.PNG&amp;amp;userId=2403714&#xD;
  [2]: https://www.wolframcloud.com/obj/b779f2cd-4e78-496d-b09b-fceee440b0fc</description>
    <dc:creator>Vedat Senol</dc:creator>
    <dc:date>2024-07-01T16:27:50Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/745870">
    <title>Modeling a Trebuchet</title>
    <link>https://community.wolfram.com/groups/-/m/t/745870</link>
    <description>While going through the Wolfram Demonstration Project site, I came across an simulation of a Trebuchet:&#xD;
&#xD;
[Optimizing the Counterweight Trebuchet][1]&#xD;
&#xD;
I was wondering if it is possible to animate the Trebuchet in such a way that the projectile of the trebuchet actually leaves the sling and makes impact against a wall at a certain distance say x=&amp;#039;some constant&amp;#039;.&#xD;
&#xD;
[![enter image description here][2]][1]&#xD;
&#xD;
&#xD;
  [1]: http://demonstrations.wolfram.com/OptimizingTheCounterweightTrebuchet&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=6648popup_3.jpg&amp;amp;userId=11733</description>
    <dc:creator>Varun Kulkarni</dc:creator>
    <dc:date>2015-11-26T22:26:41Z</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/3111908">
    <title>Part 1: DALL-E AI artistic renderings predicted from graphics-generating code</title>
    <link>https://community.wolfram.com/groups/-/m/t/3111908</link>
    <description>![enter image description here][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=3781Hero1.png&amp;amp;userId=20103&#xD;
  [2]: https://www.wolframcloud.com/obj/b6f6fbbb-0aa5-43ff-937a-cf9482eaf9e2</description>
    <dc:creator>Michael Trott</dc:creator>
    <dc:date>2024-01-29T16:58:25Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2030201">
    <title>[WSS20] Implementation of level-index arithmetic for very large numbers</title>
    <link>https://community.wolfram.com/groups/-/m/t/2030201</link>
    <description>&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/e9934595-75e0-42eb-92bc-ae38528364a7&#xD;
&#xD;
&#xD;
  [Original]: https://www.wolframcloud.com/obj/ss8659/Published/WSS20-Level-Index-Arithmetic-5.nb</description>
    <dc:creator>Swastik Banerjee</dc:creator>
    <dc:date>2020-07-14T17:07:16Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2978606">
    <title>Three bicycle problems: from Sherlock Holmes to unicycle illusion to pedal paradox</title>
    <link>https://community.wolfram.com/groups/-/m/t/2978606</link>
    <description>![enter image description here][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Bicycleproblems.gif&amp;amp;userId=20103&#xD;
  [2]: https://www.wolframcloud.com/obj/92111047-bf26-4059-8d44-326bf82736e9</description>
    <dc:creator>Stan Wagon</dc:creator>
    <dc:date>2023-07-28T16:56:02Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2961701">
    <title>Lucky Palindromes: when do prime factors of palindromes make palindromes?</title>
    <link>https://community.wolfram.com/groups/-/m/t/2961701</link>
    <description>[![enter image description here][1]][2]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][3]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=43t45h545qerfgvfdsfh.jpg&amp;amp;userId=11733&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=43t45h545qerfgvfdsfh.jpg&amp;amp;userId=11733&#xD;
  [3]: https://www.wolframcloud.com/obj/ec0d857e-09b2-4862-87b8-0d0c23869f69</description>
    <dc:creator>Vitaliy Kaurov</dc:creator>
    <dc:date>2023-07-13T17:19:37Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2740397">
    <title>What is the winter solstice?</title>
    <link>https://community.wolfram.com/groups/-/m/t/2740397</link>
    <description>&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/2d627ca1-036a-4d6e-afaa-bd73bd641674</description>
    <dc:creator>Jose Martin-Garcia</dc:creator>
    <dc:date>2022-12-21T15:37:36Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/826688">
    <title>Fingerprint Identification and Matching Using Wolfram Language</title>
    <link>https://community.wolfram.com/groups/-/m/t/826688</link>
    <description>**Wolfram Language Fingerprint Identification and Matching**&#xD;
========================================================&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
Introduction&#xD;
============&#xD;
&#xD;
&#xD;
The objective of this study was to create a Mathematica program that would accurately and efficiently compare multiple fingerprints without external hardware. I began my work in August of 2014 as a member of the Wolfram Research Mentorship Program, after having attended the Wolfram Mathematica Camp earlier that summer.   &#xD;
&#xD;
Fingerprint analysis by computational means has grown in significance in modern society; fingerprint matching has been relevant in the field of criminology for a long time, but its applications are growing to complement modern technology, such as the fingerprint recognition functionality of iPhones. Detecting fingerprints accurately, however, requires either sensitive and expensive specialized fingerprinting machines or specialized technology unavailable to the public.   &#xD;
&#xD;
Thus far, there are extremely few applications that allow users to acquire and compare their fingerprints easily. In my research, I examined the ability of Mathematica and its image processing functionality to compare and analyze fingerprints extracted from live photographs.&#xD;
&#xD;
Methods/Experimentation&#xD;
=======================&#xD;
&#xD;
Acquisition of Fingerprints for Testing&#xD;
---------------------------------------&#xD;
Fingerprints for this research were acquired from several locations. These include: extracted Fingerprints from OnyxKit application, VeriFinger Fingerprint Database, FVC2 (Fingerprint Verification Contest) Sample Database, and CASIA-Fingerprint V5 Biometrics Ideal Test. All downloaded Fingerprint sets are free, but require registration. When live testing was done, fingerprints were taken from myself, close family, as well as friends. &#xD;
&#xD;
Pre-Printed Fingerprint Analysis&#xD;
--------------------------------&#xD;
&#xD;
 - **ImageKeyPoints (Testing on Pre-Printed Fingerprints)**&#xD;
&#xD;
After investigation into several other methods of fingerprint matching, the Mathematica commands ImageKeyPoints and ImageCorresponding Points were determined to be the best method of comparing fingerprints. &#xD;
&#xD;
ImageKeyPoints is a Mathematica command that uses the SURF (Speeded Up Robust Features) algorithm that uses a complex blob detector to identify points within the image that stood out in contrast to surrounding points, which are analyzed using the Haar wavelet sum. The command outputs coordinates of points which are determined to be sufficiently unique or distinct. &#xD;
&#xD;
The following code and image are an illustration of a set of key points on a Pre-Printed Fingerprint from the VeriFinger Fingerprint Database:&#xD;
&#xD;
    HighlightImage[FP1, ImageKeypoints[FP1], &amp;#034;HighlightColor&amp;#034; -&amp;gt; Yellow]&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
&#xD;
The number of key points for an image was quantified using the simple command:&#xD;
&#xD;
    Length[ImageKeyPoints[FP1]]&#xD;
&#xD;
Over every Pre-Printed Database, the number of Key Points was quantified to ensure that there was no significant difference within a set of images from the same database, as this number is used in a later calculation. When comparing a set of fingerprints, I found that there was no statistically significant difference within sets with p &amp;lt; .05.&#xD;
&#xD;
 - **ImageCorrespondingPoints (Testing on Pre-Printed Fingerprints)**&#xD;
&#xD;
ImageCorrespondingPoints (ICP) is a similar command to ImageKeyPoints; the purpose of ICP is to identify points in common between two images. These Corresponding Points are selected from the set of Key Points. A sample snippet of code as well as an image of ICP on a pair of images of a fingerprint extracted from OnyxKit application. &#xD;
&#xD;
*Corresponding Points highlighted from two different Fingerprints from the Same Individual*&#xD;
&#xD;
    Images = {FP1, FP3}; matches = &#xD;
     ImageCorrespondingPoints @@ images; MapThread[&#xD;
     Show[#1, Graphics[{Yellow, &#xD;
         MapIndexed[Inset[#2[[1]], #1] &amp;amp;, #2]}]] &amp;amp;, {images, matches}]&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
&#xD;
*Corresponding Points highlighted from two different Fingerprints from Different Individuals*&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
&#xD;
The number of Corresponding points for a pair of images was quantified using the simple command:&#xD;
&#xD;
    Length[ImageCorrespondingPoints[FP1, FP2]]&#xD;
&#xD;
 - **Determining the Threshold**&#xD;
&#xD;
A percentage similarity between two fingerprints was calculated as follows:&#xD;
&#xD;
    (2 NumberofCorrespondingPoints[FP1, FP2])/(NumberofImageKeyPoints[FP1] + NumberofImageKeyPoints[FP2])&#xD;
&#xD;
This is essentially equal to the number of points in common between the two images divided by the average number of key points. &#xD;
&#xD;
This %Similarity was calculated among thousands of pairs of images from the same finger of the same individual, as well as fingerprints from different individuals. These fingerprints were captured using OnyxKit. The key of this project was to find the proper %Similarity (threshold) with which we can say that if the calculated %Similarity &amp;gt; Threshold, then the fingerprints are the same, and if %Similarity &amp;lt; Threshold, then the fingerprints are different. The Threshold determined for pre-printed fingerprints was determined to be the surprisingly and extremely small, 1.5%. &#xD;
&#xD;
Such a low threshold is a key indicator that our method for comparing fingerprints is very accurate in predicting if fingerprints are different, allowing us to set a low threshold to capture fingerprints from the same individual that may have a low number of Corresponding Points. &#xD;
&#xD;
 - **KeyPointStrength**&#xD;
&#xD;
A key component of the analysis was determining the proper KeyPointStrength in the ImageCorrespondingPoints. KeyPointStrength is an option of ICP, which alters the requirements for a point to be considered a Key Point.  An increase in KeyPointStrength corresponds to a decreased number of Key Points found.  The values for KeyPointStrength Testing included KSP = .001, .0004, .0005, .00075. &#xD;
The code for KSP was:&#xD;
&#xD;
    ImageCorrespondingPoints[FP1, FP2, KeypointStrength -&amp;gt; ____ ]&#xD;
&#xD;
The conclusion was that at a KeypointStrength of .0004, the results were optimal: for two of the same fingerprints, the certainty of a match = 85%. For two different Fingerprints, the certainty of no match is 86%. The value of KSP was eventually changed when testing on live finger images, when a similar analysis was repeated.&#xD;
&#xD;
Live Fingerprint Analysis&#xD;
-------------------------&#xD;
&#xD;
 - **Extraction of Finger from Image**&#xD;
&#xD;
All of the prior analysis set the precedent for the investigation into live fingerprints. The purpose of this project was to allow a user to upload multiple images of fingers taken simply by a camera or phone without necessity of specialized technology.  &#xD;
&#xD;
Therefore, after pictures of fingers were uploaded to the program, a system had to be discovered to isolate only the finger from a complete image. This presents a significant Image Processing and Manipulation problem. &#xD;
&#xD;
I proposed three solutions this problem: &#xD;
&#xD;
**(1) Pure Image Manipulation (No Preparation Required)**&#xD;
&#xD;
In this method, a picture of a fingerprint is taken without regard to the background. The purpose of this code is to be able to extract a fingerprint from the uploaded image. This extracted fingerprint should be surrounded by a black background to which image key points can be applied properly on. &#xD;
&#xD;
    FPExtract[k_] := &#xD;
     ImageCrop[&#xD;
      ImageSubtract[k, &#xD;
       ColorNegate[&#xD;
        DeleteSmallComponents[&#xD;
         MorphologicalBinarize[&#xD;
          ColorCombine[ColorSeparate[k], &amp;#034;LAB&amp;#034;], {.65}]]]]]&#xD;
&#xD;
**Extraction Results:**&#xD;
&#xD;
*Original Image:*&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
&#xD;
*Extracted Image:*&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
&#xD;
**(2) Uniform Background Method**&#xD;
&#xD;
In this method, the background is taken into account. Here, the image of the fingerprint must be taken with a purely uniform background. The results of this extraction are shown below: &#xD;
&#xD;
    FPExtracted1 =  &#xD;
       ImageMultiply[&#xD;
        FP1 SelectComponents[FillingTransform@Binarize[FP1], &#xD;
          &amp;#034;Area&amp;#034;, -1]];&#xD;
    FPExtractedFinal = ImageSubtract[FP1, FPExtracted1]&#xD;
&#xD;
*Original Image:*&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
&#xD;
*Extracted Image:*&#xD;
&#xD;
![enter image description here][8]&#xD;
&#xD;
&#xD;
**(3) Flash Photography**&#xD;
&#xD;
A slightly unique method was discovered when I realized that simply turning flash on may be extremely effective. This was motivated by my desire to use a form of morphological binarize; this requires a contrast in the lighting of the finger vs the lighting of the background. Therefore, I reasoned, when the flash is aimed on the finger when a photograph is being taken, that should facilitate the use of a binarize command to extract the fingerprint. &#xD;
&#xD;
    FPExtract[a_] := &#xD;
     ImageCrop[&#xD;
      ImageSubtract[a, ColorNegate[DeleteSmallComponents[Binarize[a]]]]]&#xD;
&#xD;
*Original Image:*&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
&#xD;
*Extracted Image:*&#xD;
&#xD;
![enter image description here][10]&#xD;
&#xD;
&#xD;
**Conclusion**&#xD;
&#xD;
After large amounts of testing, it was determined that with regard to accuracy as well as practicality, the best method would be the method 3 using flash photography. The other methods are included here to reveal the potential for better solutions, especially method 1, which if improved, would be the ideal method. &#xD;
&#xD;
 - **Threshold Determination**&#xD;
&#xD;
The threshold for this portion of the project was set using the exact same method as previously described. A large set of pairs of fingerprints using method 3 was analyzed to determine the ideal threshold. It was determined that the ideal threshold to maximize correct interpretations of pairs of fingerprints was approximately 1.2%. &#xD;
&#xD;
 - **Reference Fingerprints and Probability Calculations**&#xD;
&#xD;
Most standard fingerprint matching software requires a number of reference fingerprints. This means, that give an input fingerprint FP1, and reference fingerprints FP2, FP3, ...., FPN, the input fingerprint is compared to each reference fingerprint to increase the accuracy of the final conclusion. These reference fingerprints can either be from a different individual from the input or from the same individual, and a decision is thus made. &#xD;
&#xD;
It is critical to determine the probability of making an accurate conclusion during this process. For example, as the number of reference fingerprints increases, the probability of making a correct conclusion increases. &#xD;
&#xD;
Probability calculations were done using conditional Bayesian probability. The general formula for this is: &#xD;
&#xD;
    P(B|A) = (P(B)P(A|B)) /  (P(B)P(A|B) + P(B^c)P(A|Bc) &#xD;
&#xD;
In this computation, certain information needs to be known prior to computation: this includes the general probability that a known correct match will be interpreted as a match. This was determined to be 90%. It also was needed to be known what the probability of a known invalid match being interpreted as a valid match. This was determined to be 11%. These numbers were acquired after analyzing thousands of pairs of fingerprints. &#xD;
&#xD;
There are two situations in which this is applied: &#xD;
&#xD;
**(1) Probability of Match**&#xD;
&#xD;
In this scenario, B= Probability of Correct Conclusion, and A = Number of Matches Found&#xD;
&#xD;
The following code computes the probability of a conclusion of a match, given that there are MatchCount number of determined matches that are greater than the threshold. &#xD;
&#xD;
        ProbabilityofSame = &#xD;
     ((.90)^MatchCount (1 - .90)^(Length[t] - MatchCount))/&#xD;
     (((.90)^MatchCount (1 - .90)^(Length[t] - MatchCount)) + ((.11)^MatchCount (1 - .11)^(Length[t] - MatchCount)))&#xD;
&#xD;
**(2) Probability of Invalid Match**&#xD;
&#xD;
In this scenario, B= Probability of Correct Conclusion, and A = Number of Matches Found&#xD;
&#xD;
The following code computes the probability of a conclusion of a match, given that there are MatchCount number of determined matches that are greater than the threshold. &#xD;
&#xD;
    ProbabilityofSame = &#xD;
        ((.90)^MatchCount (1 - .90)^(Length[t] - MatchCount))/&#xD;
        (((.90)^MatchCount (1 - .90)^(Length[t] - MatchCount)) + ((.11)^MatchCount (1 - .11)^(Length[t] - MatchCount)));&#xD;
&#xD;
 - **Final Determination of Results**&#xD;
&#xD;
The final conclusion of whether the result is a match or an invalid match is determined using the probabilities computed above. If the probability of a valid match is greater than the probability of an invalid match, then the result is a match, and vice versa. The final conclusion is printed as well as calculated probability that the result is correct. &#xD;
&#xD;
![enter image description here][11]&#xD;
&#xD;
&#xD;
**Conclusion:** &#xD;
&#xD;
Through this project, I have explored the use of Mathematica to identify and match fingerprints. A number of different methods were used throughout this project, but after significant data analysis, the method through Key Point analysis was determined to be the most effective. As a result, users should be able to input live photographed fingerprints and analyze them. &#xD;
&#xD;
Beyond its immediate results, this project also has several implications for future study. A significant amount of time of this study, although not included in this report, was devoted to the study of traditional Fingerprint matching techniques, such as ridge bifurcations, edges, etc. The code developed in this avenue was not further pursued, as the key points analysis was more practical, but there is room here for much further investigation. Improvements in the image processing would also be highly relevant, as improved fingerprint extraction would increase the significance of results tremendously. Finally, more data in even larger quantities would be helpful in confirming the current threshold, or establishing a new, final one. &#xD;
&#xD;
 **Acknowledgements:**&#xD;
&#xD;
I would primarily like to thank Dr. Rowland for his mentorship and assistance throughout the entire course of the project. I would also like to thank Ms. Kimball for her involvement and assistance near the end of the project, as well as the Onyx and the various Fingerprinting Databases for allowing my use of their samples. Finally, I would like to thank my parents for their constant support. &#xD;
&#xD;
**Final Code**&#xD;
&#xD;
This is the code the deploys the program directly to the cloud&#xD;
&#xD;
    CloudDeploy[FormFunction[{&#xD;
       &#xD;
       {{&amp;#034;y&amp;#034;, &amp;#034;Input Fingerprint&amp;#034;} -&amp;gt; &#xD;
         &amp;#034;Image&amp;#034;, {&amp;#034;x&amp;#034;, &amp;#034;Number of Reference Fingerprints&amp;#034;} -&amp;gt; {&amp;#034;1&amp;#034;, &amp;#034;2&amp;#034;, &#xD;
          &amp;#034;3&amp;#034;, &amp;#034;4&amp;#034;}},&#xD;
       &#xD;
       Function[&#xD;
        Table[{&amp;#034;a&amp;#034; &amp;lt;&amp;gt; ToString[i], &#xD;
           &amp;#034;Reference Fingerprint &amp;#034; &amp;lt;&amp;gt; ToString[i]} -&amp;gt; &amp;#034;Image&amp;#034;,&#xD;
         {i, ToExpression[#x]}]&#xD;
        ]},&#xD;
      &#xD;
      Module[{RefFP, FPAnalysis, MatchCount, NumberofCorrespondingPoints, &#xD;
         NumberofInputKeyPoints, NumberofReferenceKeyPoints, &#xD;
         ProbabilityofSame, ProbabilityofDifferent, FPAnalysisModified, &#xD;
         FPAnalysisFinalModified, w, u, q, n, t, b},&#xD;
        &#xD;
        t = Table[ #[&amp;#034;a&amp;#034; &amp;lt;&amp;gt; ToString[j]], {j, ToExpression[#x]}];&#xD;
        &#xD;
        b = ImageRotate[#y, 3 Pi /2];&#xD;
        &#xD;
        t = Table[ImageRotate[t[[i]], 3 Pi/2], {i, 1, Length[t]}];&#xD;
        &#xD;
        &#xD;
        &#xD;
        NumberofInputKeyPoints =&#xD;
          Length[ImageKeypoints[b]];&#xD;
        &#xD;
        NumberofReferenceKeyPoints = &#xD;
         Table[&#xD;
          Length[&#xD;
           ImageKeypoints[t[[u]]]],&#xD;
          {u, 1, Length[t]}];&#xD;
        &#xD;
        &#xD;
        NumberofCorrespondingPoints = &#xD;
         Table[&#xD;
          Length[&#xD;
           Flatten[&#xD;
             ImageCorrespondingPoints[b, t[[q]]], 1]], &#xD;
          {q, 1, Length[t]}];&#xD;
        &#xD;
        FPAnalysis =&#xD;
         &#xD;
         Table[{&#xD;
           &#xD;
           MapThread[&#xD;
            	Show[#1, &#xD;
              Graphics[{Yellow, &#xD;
                MapIndexed[Inset[#2[[1]], #1] &amp;amp;, #2]}]] &amp;amp;, {{b, t[[n]]},&#xD;
                    ImageCorrespondingPoints @@ {b, t[[n]]}}], &#xD;
           &#xD;
           Row[{N[&#xD;
              200   NumberofCorrespondingPoints[[n]]&#xD;
                / (Plus[NumberofInputKeyPoints,&#xD;
                  NumberofReferenceKeyPoints[[n]]&#xD;
                  ])], &amp;#034;%&amp;#034;}], &#xD;
           &#xD;
           Which[&#xD;
            200 NumberofCorrespondingPoints[[&#xD;
                n]]/ (Plus[NumberofInputKeyPoints,&#xD;
                 NumberofReferenceKeyPoints[[n]]]) &amp;gt; 1.2, &amp;#034;Match&amp;#034;,  &#xD;
            	&#xD;
            200 NumberofCorrespondingPoints[[&#xD;
                n]]/ (Plus[NumberofInputKeyPoints,&#xD;
                 NumberofReferenceKeyPoints[[n]]]) &amp;lt; 1.2, &#xD;
            &amp;#034;Invalid Match&amp;#034;]},&#xD;
          &#xD;
          {n, 1, Length[t]}];&#xD;
        &#xD;
        MatchCount =&#xD;
         (Length[t] - &#xD;
           Total[StringCount[Flatten[FPAnalysis][[4 ;; ;; 4]], &#xD;
             &amp;#034;Invalid Match&amp;#034;]]);&#xD;
        &#xD;
        ProbabilityofSame = &#xD;
         ((.90)^&#xD;
             MatchCount (1 - .90)^(Length[t] - MatchCount) ) / (((.90)^&#xD;
               MatchCount (1 - .90)^(Length[t] - MatchCount) ) + ((.11)^&#xD;
               MatchCount (1 - .11)^(Length[t] - MatchCount) ));&#xD;
        &#xD;
        ProbabilityofDifferent =&#xD;
          ((.11)^&#xD;
             MatchCount (1 - .11)^(Length[t] - MatchCount) )/ (((.90)^&#xD;
               MatchCount (1 - .90)^(Length[t] - MatchCount) ) + ((.11)^&#xD;
               MatchCount (1 - .11)^(Length[t] - MatchCount) ));&#xD;
        &#xD;
        &#xD;
        FPAnalysisModified = &#xD;
         FPAnalysis /.&#xD;
          &#xD;
          &amp;#034;Match&amp;#034; -&amp;gt; &#xD;
           Item[Style[&amp;#034;Match&amp;#034;, FontWeight -&amp;gt; Bold, FontFamily -&amp;gt; Times, &#xD;
             FontSize -&amp;gt; 16], Background -&amp;gt; Green];&#xD;
        &#xD;
        FPAnalysisFinalModified = &#xD;
         FPAnalysisModified /.&#xD;
          &#xD;
          &amp;#034;Invalid Match&amp;#034; -&amp;gt; &#xD;
           Item[Style[&amp;#034;Invalid Match&amp;#034;,  FontWeight -&amp;gt; Bold, &#xD;
             FontFamily -&amp;gt; Times, FontSize -&amp;gt; 16], Background -&amp;gt; Red];&#xD;
        &#xD;
        &#xD;
        Grid[&#xD;
         {&#xD;
          {&#xD;
           Framed[&#xD;
            Grid[{{&amp;#034;Wolfram Mathematica Fingerprint Matching Research:&amp;#034;, &#xD;
               &amp;#034;Tushar Dwivedi&amp;#034;}, {&amp;#034;Final Result:&amp;#034;, &#xD;
               If[ProbabilityofSame &amp;gt; ProbabilityofDifferent, &amp;#034; MATCH &amp;#034;, &#xD;
                &amp;#034; INVALID MATCH &amp;#034;]}, { &#xD;
               &amp;#034;Number of Reference Fingerprints Input:&amp;#034;, &#xD;
               Length[t]}, {&amp;#034;Certainty of Result:&amp;#034;, If[ProbabilityofSame &amp;gt; &#xD;
                 ProbabilityofDifferent, &#xD;
                StringJoin[ToString[100  ProbabilityofSame], &amp;#034;%&amp;#034;],&#xD;
                StringJoin[ToString[100  ProbabilityofDifferent], &amp;#034;%&amp;#034;]]},&#xD;
              &#xD;
              { &amp;#034;Average Number of Critical Points:&amp;#034;,&#xD;
                &#xD;
               N[Mean[Join[&#xD;
                  NumberofReferenceKeyPoints, \&#xD;
    {NumberofInputKeyPoints}]]]}, {&#xD;
               &amp;#034;Average Number of Corresponding Points:&amp;#034;,&#xD;
                N[ Mean[NumberofCorrespondingPoints]]}}, &#xD;
             Background -&amp;gt; {{1 -&amp;gt; LightBlue, 2 -&amp;gt; LightYellow}, None}]]},&#xD;
          &#xD;
          &#xD;
          {Insert[&#xD;
            ReplacePart[&#xD;
             Grid[&#xD;
              Join[&#xD;
               {{Style[&amp;#034;Corresponding Points Display&amp;#034;, FontSize -&amp;gt; 16, &#xD;
                  FontFamily -&amp;gt; Times], SpanFromLeft,&#xD;
                 &#xD;
                 Style[&amp;#034;Threshold: 1.2%&amp;#034;, FontSize -&amp;gt; 16, &#xD;
                  FontFamily -&amp;gt; Times],&#xD;
                 Item[If[ProbabilityofSame &amp;gt; &#xD;
                    ProbabilityofDifferent &#xD;
                     &#xD;
                     Style[&amp;#034;Result: MATCH&amp;#034;, FontFamily -&amp;gt; Times, &#xD;
                      FontWeight -&amp;gt; Bold], &#xD;
                   &#xD;
                   Style[&amp;#034;Result: INVALID MATCH&amp;#034;, FontFamily -&amp;gt; Times, &#xD;
                    FontWeight -&amp;gt; Bold]], &#xD;
                  &#xD;
                  Background -&amp;gt; &#xD;
                   If[ProbabilityofSame &amp;gt; ProbabilityofDifferent, Green, &#xD;
                    Red]] }},&#xD;
               Flatten /@ FPAnalysisFinalModified]&#xD;
              ],&#xD;
             &#xD;
             &#xD;
             1 -&amp;gt; Prepend[&#xD;
               First[&#xD;
                Grid[&#xD;
                 Join[&#xD;
                  {{Style[&amp;#034;Corresponding Points Display&amp;#034;, FontSize -&amp;gt; 16, &#xD;
                     FontFamily -&amp;gt; Times], SpanFromLeft,&#xD;
                    &#xD;
                    Style[&amp;#034;Threshold: 1.2%&amp;#034;, FontSize -&amp;gt; 16, &#xD;
                     FontFamily -&amp;gt; Times], Item[If[ProbabilityofSame &amp;gt; &#xD;
                       ProbabilityofDifferent, &#xD;
                      Style[&amp;#034;Result: MATCH&amp;#034;, FontFamily -&amp;gt; Times, &#xD;
                       FontWeight -&amp;gt; Bold], &#xD;
                      &#xD;
                      Style[&amp;#034;Result: INVALID MATCH&amp;#034;, FontFamily -&amp;gt; Times, &#xD;
                       FontWeight -&amp;gt; Bold]], &#xD;
                     &#xD;
                     Background -&amp;gt; &#xD;
                      If[ProbabilityofSame &amp;gt; ProbabilityofDifferent, &#xD;
                       Green, Red]] }},&#xD;
                  Flatten /@ FPAnalysisFinalModified]&#xD;
                 &#xD;
                 ]&#xD;
                &#xD;
                ],&#xD;
               {Style[&amp;#034;Fingerprint Input&amp;#034;, FontSize -&amp;gt; 16 , &#xD;
                 FontWeight -&amp;gt; Bold, FontFamily -&amp;gt; Times], &#xD;
                Style[&amp;#034;Reference Fingerprint&amp;#034;, FontSize -&amp;gt; 16 , &#xD;
                 FontWeight -&amp;gt; Bold, FontFamily -&amp;gt; Times],&#xD;
                &#xD;
                Style[&amp;#034;Match Strength&amp;#034;, FontSize -&amp;gt; 16 , &#xD;
                 FontWeight -&amp;gt; Bold, FontFamily -&amp;gt; Times],&#xD;
                &#xD;
                Style[&amp;#034;Result&amp;#034;, FontSize -&amp;gt; 16 , FontWeight -&amp;gt; Bold, &#xD;
                 FontFamily -&amp;gt; Times]}]],&#xD;
            {Dividers -&amp;gt; All, Spacings -&amp;gt; 1.5` {1, 1}}, 2]}, &#xD;
          &#xD;
          {Framed@Text&#xD;
             [Style[&#xD;
              &#xD;
              &amp;#034; The input fingerprint was paired with each of the input \&#xD;
    reference fingerprints, and Wolfram Mathematica was used to identify \&#xD;
    critical points in all input fingerprints. These critical points \&#xD;
    include bifurcations (where  the fingerprint line branches), ridge \&#xD;
    endings (where the fingerprint line stops), and various other \&#xD;
    minuitae. The major premise of fingerprint testing is to compare the \&#xD;
    critical points in two fingerprints, and find how many of these \&#xD;
    minuitae are the same. Therefore, the number of critical points in \&#xD;
    the input that corresponded to critical points in the reference \&#xD;
    fingerprint was calculated for each pair. The Match Strength is \&#xD;
    calculated by finding the percent of the average number of critical \&#xD;
    points that correspond between the pair of fingerprints.   After \&#xD;
    testing thousands of pairs of fingerprints, the threshold for a Match \&#xD;
    Strength to qualify as a match was set at 1.2%. Thus, if the match \&#xD;
    strength was greater than 1.2% for a pair, then that pair of the \&#xD;
    input and reference was determined to be a match. To get the overall \&#xD;
    determination of a match or invalid match, Bayesian probability was \&#xD;
    used to calculate the certainty of being a match based on the number \&#xD;
    of matches or invalid matches found between the input fingerprint and \&#xD;
    each of the reference fingerprints.&amp;#034;, TextAlignment -&amp;gt; Left, &#xD;
              FontSize -&amp;gt; 14, FontFamily -&amp;gt; Times, &#xD;
              LineSpacing -&amp;gt; {1.67, 0}],  Background -&amp;gt; LightGreen]}}&#xD;
         ]&#xD;
        ] &amp;amp;, &amp;#034;PNG&amp;#034;, &#xD;
      AppearanceRules -&amp;gt; &amp;lt;|&#xD;
        &amp;#034;Title&amp;#034; -&amp;gt; &amp;#034;Wolfram Fingerprint Identification&amp;#034;, &#xD;
        &amp;#034;Description&amp;#034; -&amp;gt; &amp;#034;Match your fingerprints!&amp;#034;|&amp;gt;], &#xD;
     Permissions -&amp;gt; &amp;#034;Public&amp;#034;]&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=FinalOutputScreenshot.png&amp;amp;userId=522318&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Fingerprint1.png&amp;amp;userId=522318&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-03-20at2.31.23PM.png&amp;amp;userId=522318&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-03-20at2.31.32PM.png&amp;amp;userId=522318&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-03-20at2.31.40PM.png&amp;amp;userId=522318&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-03-20at2.31.46PM.png&amp;amp;userId=522318&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-03-20at2.31.53PM.png&amp;amp;userId=522318&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-03-20at2.31.57PM.png&amp;amp;userId=522318&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-03-20at2.32.04PM.png&amp;amp;userId=522318&#xD;
  [10]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-03-20at2.32.09PM.png&amp;amp;userId=522318&#xD;
  [11]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-03-20at2.32.22PM.png&amp;amp;userId=522318</description>
    <dc:creator>Tushar Dwivedi</dc:creator>
    <dc:date>2016-03-20T21:14: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/1485074">
    <title>Randomness of the number C[10]!, a candidate for replace Pi (random basis)</title>
    <link>https://community.wolfram.com/groups/-/m/t/1485074</link>
    <description>Hello people of the community, I&amp;#039;m an enthusiast of **Mathematica** and **Wolfram|Alpha** who&amp;#039;s been busy for the last few days with a project on possible numerical candidates to be used as random alternative bases for various applications. As I know there are amazing mathematical friends in the community, I decided to humbly expose my work and ask about opinions, etc. Only for the purpose of presenting some of my ideas and also to start an informal discussion on this kind of subject: number randomness. And maybe it can also be useful for someone here.&#xD;
&#xD;
To begin with, I understand that the randomness that I speak in this text is not truly random, but it serves as the basis for almost-random operations and distributions that need that specific degree of trust.&#xD;
&#xD;
In order to study the randomness of the transcendental numbers, candidates for transcendental and notable irrational numbers, I used a table base and developed a digit counting workbook. I only used numbers with 10000 decimal digits for the study (generated using **Mathematica** and the data later adapted to data workbook). Below is the example of the interface I used with the Pi number:&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
Each workbook of data like this above is a point on a chart, that is, many similar to this will result in the characteristic curve of each number review.&#xD;
In this study I compared four different specific characteristics (Y-axis). Using the workbook I could detail these quantities as the digits increased to 10000 on the X-axis. I used the transcendental number Pi to start the study. In this study I made my own version of properties to study the numbers and are not necessarily the conventional way of doing it. Given:&#xD;
&#xD;
C =  Deviation of the average arithmetic between all the decimal digits in the range.&#xD;
&#xD;
S = Deviation of the average count of different digits: how many nine, how many 8 etc...&#xD;
&#xD;
T = It measures the difference of how many numbers are between 0 and 4 in contrast to those between 5 and 9, such as a coin toss, result between rounding up or down situations.&#xD;
&#xD;
A = Total number of digits forming or part of doubles, triples, etc.: 11,222,5555, 333333333... (in the interval studied).&#xD;
&#xD;
I&amp;#039;ve tested several numbers and their combinations. As for example: **E^Pi, Pi^E, E^sqrt(2), 2^sqrt(2), Zeta (3), Gamma(1/3), Ln(2), Ln(Pi), E^(1/Pi), E+Pi, GoldenRatio, EulerGamma, E+Ln(2)+EulerGamma**, etc... around 30 different numbers, preferably transcendentals, irrational and other notorious candidates. There are two types of accuracy in this project, some I made with with 31 data points and some more detailed with 91 data points. &#xD;
Below is the detailed graph of **Pi** referring to the characteristics already stipulated:&#xD;
![enter image description here][2]&#xD;
In this graph each vertical line is one point to the curve and has a separation of 110 digits, there are 91 points from 100 to 10000 digits on the X-axis.&#xD;
Below are a few more examples with other notable numbers:&#xD;
&#xD;
E Number&#xD;
![enter image description here][3]&#xD;
Gamma(1/3) Number &#xD;
![enter image description here][4]&#xD;
Ln(2) Number&#xD;
![enter image description here][5]&#xD;
Each of these charts above have the space between the vertical lines of 330 digits (X-axis) and use 31 points between 100 and 10000. They represent the characteristic curve of each number (Y-axis).&#xD;
Note 1: Realize that the closer to the X-axis are the curves, in all graphics, the more well distributed and favored is the number for its use in random applications.&#xD;
&#xD;
Then the following: I calculated the **AREA** below the curve in the graphs to characterize each of its value. The method I used was to calculate the area through average trapezoids formed by the arithmetic mean, so consequently I considered its own degree of precision.&#xD;
Note 2: The important point in this study **IS NOT** the absolute values that I found (because I used a specific method), **BUT** the comparison of the values between the different numbers, since I used the same process in all objects of study, making it possible to compare. Below is the table for four important numbers using the accuracy of 31 points.&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
The Pi number has the lowest frequency to form repetitions of ALL the numbers tested (..would that be the manifestation of it irrationality?).&#xD;
Well, after a sequence of tests and more tests, in this quest to find candidates equal or almost good as Pi in this characteristic, I found by chance a very good candidate number: the number **C (10)!** , or **ChampernowneNumber(10)!** (! = factorial):&#xD;
I used **Mathematica** to generate the test numbers (examples):&#xD;
![enter image description here][7]&#xD;
In this example above are the first 500 digits of the numbers C(10) and C(10)!, but in the real study I used 10000 digits (also generated by **Mathematica**).&#xD;
Examples of digit count according to the amount of total digits. The left is the C (10)! And the right is Pi:&#xD;
![enter image description here][8]&#xD;
Below is the result of the workbook I generated for the C (10)! using 31 points of precision:&#xD;
![enter image description here][9]&#xD;
&#xD;
Full chart of Champernowne (10)! (now with 91 points, 110 in 110 digits, 100 to 10000):&#xD;
![enter image description here][10]&#xD;
![enter image description here][11]&#xD;
&#xD;
Comparing the data I got for Pi e C(10)! numbers (max accuracy, chart of 91 points):&#xD;
![enter image description here][12]&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Pigraph0.jpg&amp;amp;userId=1316061&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Pigraph1.jpg&amp;amp;userId=1316061&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=e.jpg&amp;amp;userId=1316061&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=gamma13.jpg&amp;amp;userId=1316061&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ln2.jpg&amp;amp;userId=1316061&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=tablei.jpg&amp;amp;userId=1316061&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=champernowneini.jpg&amp;amp;userId=1316061&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=tabledual.jpg&amp;amp;userId=1316061&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=tablei2.jpg&amp;amp;userId=1316061&#xD;
  [10]: http://community.wolfram.com//c/portal/getImageAttachment?filename=champernowne!.jpg&amp;amp;userId=1316061&#xD;
  [11]: http://community.wolfram.com//c/portal/getImageAttachment?filename=tablef.jpg&amp;amp;userId=1316061&#xD;
  [12]: http://community.wolfram.com//c/portal/getImageAttachment?filename=conclusao.jpg&amp;amp;userId=1316061&#xD;
I conclude that: of all the numbers tested (transcendental, irrational, etc.) the number that has the characteristic of not-repeating-numeral to those of Pi is the **ChampernowneNumber (10)**! : a possible candidate to replace it in applications that need randomness and it IS NOT possible or convenient to incorporate Pi (is that a best alternative candidate? ). Currently I take 2 minutes to do a fast previous checkup on any number with the workbook, 1 hour to create and analyze completely with the chart 31 points and 3 hours for the chart of 91 points.&#xD;
Please                if  you  liked  the work  I  did  let me know giving   a     LIKE</description>
    <dc:creator>Claudio Chaib</dc:creator>
    <dc:date>2018-09-29T21:29:53Z</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>
</rdf:RDF>

