<?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 Mechanical Engineering sorted by active.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3647332" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3503134" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3449441" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3328759" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2591848" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2534173" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2509502" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2492037" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2483319" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2030260" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2466465" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2450699" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2442313" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2408952" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2417648" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2419306" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2403814" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2399430" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2394545" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2368402" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3647332">
    <title>Similarity Solution for Axisymmetric Flow in a Tube with an Accelerating Surface Velocity</title>
    <link>https://community.wolfram.com/groups/-/m/t/3647332</link>
    <description>&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/33bddd45-7f6b-4b2b-a581-dab91355cb78</description>
    <dc:creator>Housam Binous</dc:creator>
    <dc:date>2026-02-28T21:02:03Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3503134">
    <title>[WSRP25] Helping hand to Africa:prosthetic hand&amp;#039;s kinetic movement &amp;amp; force-closure grasping analysis</title>
    <link>https://community.wolfram.com/groups/-/m/t/3503134</link>
    <description>![Helping hand to Africa:prosthetic hand&amp;#039;s kinetic movement &amp;amp; force-closure grasping analysis][1]&#xD;
&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2025-07-10at4.09.36%E2%80%AFPM.png&amp;amp;userId=3501263&#xD;
  [2]: https://www.wolframcloud.com/obj/b1e5f73f-31a2-405b-96fa-122564a24619</description>
    <dc:creator>Eunchan Hwang</dc:creator>
    <dc:date>2025-07-10T22:07:54Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3449441">
    <title>Porosity calculation of complex three-dimensional model</title>
    <link>https://community.wolfram.com/groups/-/m/t/3449441</link>
    <description>I now generate a three-dimensional model, using two methods to calculate the porosity, the first method is generated by the volume function, the second is calculated by the method of discrete mathematics, but I did not understand, the two results are not the same, is not my which method has a problem，&#xD;
L = 2 \[Pi]; d = 0.1;&#xD;
point = Table[{x, y, z}, {x, -L, L, d}, {y, -L, L, d}, {z, -L, L, &#xD;
    d}];&#xD;
point = Flatten[point, 3];&#xD;
condition = -0.5 &amp;lt; (Cos[#1] Sin[#2] + Cos[#2] Sin[#3] + &#xD;
        Cos[#3] Sin[#1] &amp;amp;) @@ # &amp;lt; 0.5 &amp;amp;;&#xD;
point1 = Select[point, condition];&#xD;
1 - N@(Length[point1]/Length[point])&#xD;
&#xD;
tpmsG := Cos[x] Sin[y] + Cos[y] Sin[z] + Cos[z] Sin[x]&#xD;
porosity[formula_, neg_, pos_] := &#xD;
 Module[{}, &#xD;
  1 - Volume[&#xD;
     ImplicitRegion[-neg &amp;lt; formula &amp;lt; &#xD;
       pos, {{x, -2 \[Pi], 2 \[Pi]}, {y, -2 \[Pi], &#xD;
        2 \[Pi]}, {z, -2 \[Pi], \[Pi]}}]]/(4 \[Pi])^3]&#xD;
porosity[tpmsG, 0.5, 0.5]&#xD;
![enter image description here][1]&#xD;
![enter image description here][2]&#xD;
Now, I have a more complex three-dimensional model of radial variation, how do I calculate its porosity&#xD;
![enter image description here][3]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE2025-04-28181142.png&amp;amp;userId=3449409&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE2025-04-28181519.png&amp;amp;userId=3449409&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE2025-04-28181730.png&amp;amp;userId=3449409</description>
    <dc:creator>扬 崔</dc:creator>
    <dc:date>2025-04-24T08:52:28Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3328759">
    <title>Enhanced Geneva mechanism animation: a detailed and complex 3D representation</title>
    <link>https://community.wolfram.com/groups/-/m/t/3328759</link>
    <description>![Enhanced Geneva mechanism animation: a detailed and complex 3D representation][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=GenevaMechanismAnimation_IsometricFrontViews3to7Slots.gif&amp;amp;userId=20103&#xD;
  [2]: https://www.wolframcloud.com/obj/3ed2b7ae-9709-4909-96b9-9dd6a356a857</description>
    <dc:creator>David Balandra</dc:creator>
    <dc:date>2024-11-26T16:17:09Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2591848">
    <title>Install Mechanical Systems Pack v 1.0.0.0 in Mathematica 12</title>
    <link>https://community.wolfram.com/groups/-/m/t/2591848</link>
    <description>I retired 20 years ago.  I want to install Mechanical Systems pack v 1.0.0.0 (circa 1995) in my Mathematica 12.  Can&amp;#039;t quite figure it out.  Anyone else had the problem of using really old add-ons iin recent versions of Mathematica?</description>
    <dc:creator>Neil Chiavaroli</dc:creator>
    <dc:date>2022-08-03T21:46:48Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2534173">
    <title>Neumann Boundary Condition for thermal radiation between two bodies</title>
    <link>https://community.wolfram.com/groups/-/m/t/2534173</link>
    <description>Hi All,&#xD;
&#xD;
I&amp;#039;m trying to formulate and solve a pde which models thermal radiation between two bodies using a Neumann boundary condition.&#xD;
&#xD;
I&amp;#039;ve created a mesh and want to capture the thermal radiation heat transfer between element 106 and element 19 in the boundary mesh wireframe plot below.&#xD;
&#xD;
 ![enter image description here][1]&#xD;
&#xD;
I&amp;#039;ve modelled convective BCs as follows:&#xD;
&#xD;
    GconvPistComb = NeumannValue[hPistComb*(TPistHeat - temp[z, r]), ElementMarker == 106];&#xD;
    GconvBlkCool = NeumannValue[hCoolWater1*(TWater1 - temp[z, r]), ElementMarker == 75]&#xD;
&#xD;
The pde with just these included looks like:&#xD;
&#xD;
    pde = {1/r D[-kMesh r D[temp[z, r], r], r] + D[-kMesh D[temp[z, r], z], &#xD;
         z] == GconvPistComb + GconvBlkCool&#xD;
&#xD;
 If I were modelling the thermal radiation from ambient gas to element 19 I would use the following Neumann BC in which TAmb is a pre-defined fixed value:&#xD;
&#xD;
    GradAmbTest = &#xD;
          NeumannValue[Epsilon Sigma (TAmb - temp[z, r])^4, &#xD;
           ElementMarker == 19];&#xD;
&#xD;
   &#xD;
&#xD;
How can I replace TAmb with an expression that represents the solved temperature field for Element 106?&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=MathematicaThermalRadiationQuestion.png&amp;amp;userId=1933607</description>
    <dc:creator>Archie Watts-Farmer</dc:creator>
    <dc:date>2022-05-18T18:11:52Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2509502">
    <title>A metafluid with multistable density and internal energy states</title>
    <link>https://community.wolfram.com/groups/-/m/t/2509502</link>
    <description>*WOLFRAM MATERIALS for the ARTICLE:*&#xD;
&amp;gt; Peretz, O., Ben Abu, E., Zigelman, A. et al.&#xD;
&#xD;
&amp;gt; *A metafluid with multistable density and internal energy states*.&#xD;
&#xD;
&amp;gt; NATURE, Nature Communications 13, 1810 (2022).&#xD;
&#xD;
&amp;gt; https://doi.org/10.1038/s41467-022-29048-3&#xD;
&#xD;
&amp;gt; [Full article in PDF][1]&#xD;
&#xD;
![enter image description here][2]  &#xD;
*Image from Nature Communications* https://doi.org/10.1038/s41467-022-29048-3&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][3]&#xD;
&#xD;
&#xD;
  [1]: https://www.nature.com/articles/s41467-022-29048-3.pdf&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=10605hero.png&amp;amp;userId=20103&#xD;
  [3]: https://www.wolframcloud.com/obj/4b9b252d-800b-4b58-8e6e-3c3d74ebe4e3</description>
    <dc:creator>Ofek Peretz</dc:creator>
    <dc:date>2022-04-12T18:50:46Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2492037">
    <title>3D stable fluids transition simulation algorithm: laminar to turbulent flow</title>
    <link>https://community.wolfram.com/groups/-/m/t/2492037</link>
    <description>This algorithm is 3D extension of our 2D algorithm published on [this page][1] and [here][2].&#xD;
We suppose that with this code we can simulate transition from laminar to turbulent flow. In this example we compute viscous flow around cuboid at Reynolds number $Re=6250$. Note, that code has been tested up to $Re=10^6$.&#xD;
&#xD;
    dif = 1/6250; pec = .72; U0 = 1.; V0 = 0.; W0 = 0.; dn0 = 1.; n = 80;&#xD;
    n1 = n + 1; sm = 500; r = 20; den = ConstantArray[dn0 , {n1, n1, n1}];&#xD;
    u0 = ConstantArray[U0, {n1, n1, n1}];&#xD;
    v0 = ConstantArray[V0, {n1, n1, n1}]; w0 = &#xD;
     ConstantArray[W0, {n1, n1, n1}]; Do[u0[[i, j, k]] = 0; &#xD;
     v0[[i, j, k]] = 0; &#xD;
     w0[[i, j, k]] = 0;, {i, 10, 20, 1}, {j, Round[n/2 - 5], &#xD;
      Round[n/2 + 5], 1}, {k, Round[n/2 - 5], Round[n/2 + 5], 1}];&#xD;
    &#xD;
    periodic[n_, up_, ud_, ul_, ur_, ub_] := &#xD;
      Module[{bd = ub}, &#xD;
       Do[bd[[n + 1, i, j]] = bd[[2, i, j]]; &#xD;
        bd[[1, i, j]] = bd[[n, i, j]];, {i, 2, n}, {j, 2, n}];&#xD;
       Do[bd[[i, 1, j]] = ud;&#xD;
        bd[[i, n + 1, j]] = up; bd[[i, j, 1]] = ul;&#xD;
        bd[[i, j, n + 1]] = ur;, {i, 1, n + 1}, {j, 1, n + 1}];&#xD;
       bd];&#xD;
    &#xD;
    diffuse[n_, r_, a_, c_, c0_] := &#xD;
      Module[{c1 = c}, &#xD;
       Do[Do[Do[&#xD;
           Do[c1[[i, j, &#xD;
                k]] = (c0[[i, j, k]] + &#xD;
                  a (c1[[i - 1, j, k]] + c1[[i + 1, j, k]] + &#xD;
                     c1[[i, j - 1, k]] + c1[[i, j + 1, k]] + &#xD;
                     c1[[i, j, k - 1]] + c1[[i, j, k + 1]]))/(1 + &#xD;
                  6 a);, {k, 2, n}];, {j, 2, n}];, {i, 2, n}];&#xD;
        Do[c1[[i, j, k]] = 0;, {i, 10, 20, 1}, {j, Round[n/2 - 5], &#xD;
          Round[n/2 + 5], 1}, {k, Round[n/2 - 5], Round[n/2 + 5], &#xD;
          1}];, {k1, 0, r}];&#xD;
       c1];&#xD;
    &#xD;
    advect[n_, d0_, u_, v_, w_, dt_] := &#xD;
      Module[{x, y, z, d1, dt0, i0, i1, j0, j1, k0, k1, s0, s1, t0, t1, &#xD;
        p1, p0, d000, d100, d010, d001, d110, d011, d101, d111}, &#xD;
       d1 = ConstantArray[0, {n + 1, n + 1, n + 1}]; dt0 = dt n;&#xD;
       Do[Do[Do[x = i - dt0 u[[i, j, k]]; y = j - dt0 v[[i, j, k]]; &#xD;
            z = k - dt0 w[[i, j, k]];&#xD;
            i0 = Which[x &amp;lt;= 1, 1, 1 &amp;lt; x &amp;lt; n, Floor[x], True, n];&#xD;
            i1 = i0 + 1;&#xD;
            j0 = Which[y &amp;lt;= 1, 1, 1 &amp;lt; y &amp;lt; n, Floor[y], True, n];&#xD;
            j1 = j0 + 1; &#xD;
            k0 = Which[z &amp;lt;= 1, 1, 1 &amp;lt; z &amp;lt; n, Floor[z], True, n];&#xD;
            k1 = k0 + 1; &#xD;
            d000 = (d0[[i0, j0, &#xD;
                k0]] + (x - i0) (d0[[i1, j0, k0]] - &#xD;
                  d0[[i0, j0, k0]]) + (y - j0) (d0[[i0, j1, k0]] - &#xD;
                  d0[[i0, j0, k0]]) + (z - k0) (d0[[i0, j0, k1]] - &#xD;
                  d0[[i0, j0, k0]])); &#xD;
            d100 = (d0[[i1, j0, &#xD;
                k0]] + (x - i1) (d0[[i1, j0, k0]] - &#xD;
                  d0[[i0, j0, k0]]) + (y - j0) (d0[[i1, j1, k0]] - &#xD;
                  d0[[i1, j0, k0]]) + (z - k0) (d0[[i1, j0, k1]] - &#xD;
                  d0[[i1, j0, k0]])); &#xD;
            d010 = (d0[[i0, j1, &#xD;
                k0]] + (x - i0) (d0[[i1, j1, k0]] - &#xD;
                  d0[[i0, j1, k0]]) + (y - j1) (d0[[i0, j1, k0]] - &#xD;
                  d0[[i0, j0, k0]]) + (z - k0) (d0[[i0, j1, k1]] - &#xD;
                  d0[[i0, j1, k0]])); &#xD;
            d001 = (d0[[i0, j0, &#xD;
                k1]] + (x - i0) (d0[[i1, j0, k1]] - &#xD;
                  d0[[i0, j0, k1]]) + (y - j0) (d0[[i0, j1, k1]] - &#xD;
                  d0[[i0, j0, k1]]) + (z - k1) (d0[[i0, j0, k1]] - &#xD;
                  d0[[i0, j0, k0]])); &#xD;
            d110 = (d0[[i1, j1, &#xD;
                k0]] + (x - i1) (d0[[i1, j1, k0]] - &#xD;
                  d0[[i0, j1, k0]]) + (y - j1) (d0[[i1, j1, k0]] - &#xD;
                  d0[[i1, j0, k0]]) + (z - k0) (d0[[i1, j1, k1]] - &#xD;
                  d0[[i1, j1, k0]])); &#xD;
            d011 = (d0[[i0, j1, &#xD;
                k1]] + (x - i0) (d0[[i1, j1, k1]] - &#xD;
                  d0[[i0, j1, k1]]) + (y - j1) (d0[[i0, j1, k1]] - &#xD;
                  d0[[i0, j0, k1]]) + (z - k1) (d0[[i0, j1, k1]] - &#xD;
                  d0[[i0, j1, k0]])); &#xD;
            d101 = (d0[[i1, j0, &#xD;
                k1]] + (x - i1) (d0[[i1, j0, k1]] - &#xD;
                  d0[[i0, j0, k1]]) + (y - j0) (d0[[i1, j1, k1]] - &#xD;
                  d0[[i1, j0, k1]]) + (z - k1) (d0[[i1, j0, k1]] - &#xD;
                  d0[[i1, j0, k0]])); &#xD;
            d111 = (d0[[i1, j1, &#xD;
                k1]] + (x - i1) (d0[[i1, j1, k1]] - &#xD;
                  d0[[i0, j1, k1]]) + (y - j1) (d0[[i1, j1, k1]] - &#xD;
                  d0[[i1, j0, k1]]) + (z - k1) (d0[[i1, j1, k1]] - &#xD;
                  d0[[i1, j1, k0]]));&#xD;
            d1[[i, j, &#xD;
              k]] = (d000 + d100 + d010 + d001 + d110 + d011 + d101 + &#xD;
                d111)/8;, {k, 2, n}];, {j, 2, n}];, {i, 1, n + 1}]; d1];&#xD;
    &#xD;
    project[n_, r_, u0_, v0_, w0_, u_, v_, w_] := &#xD;
      Module[{ux = u, vy = v, wz = w, div, p}, &#xD;
       p = ConstantArray[0, {n + 1, n + 1, n + 1}];&#xD;
       div = ConstantArray[0, {n + 1, n + 1, n + 1}];&#xD;
       ux = ConstantArray[0, {n + 1, n + 1, n + 1}];&#xD;
       vy = ConstantArray[0, {n + 1, n + 1, n + 1}]; &#xD;
       wz = ConstantArray[0, {n + 1, n + 1, n + 1}];&#xD;
       Do[div[[i, j, &#xD;
           k]] = .5/&#xD;
            n (u0[[i + 1, j, k]] - u0[[i - 1, j, k]] + v0[[i, 1 + j, k]] -&#xD;
              v0[[i, j - 1, k]] + w0[[i, j, k + 1]] - &#xD;
             w0[[i, j, k - 1]]);, {i, 2, n}, {j, 2, n}, {k, 2, n}]; &#xD;
       Do[div[[i, j, k]] = 0;, {i, 10, 20, 1}, {j, Round[n/2 - 5], &#xD;
         Round[n/2 + 5], 1}, {k, Round[n/2 - 5], Round[n/2 + 5], 1}]; &#xD;
       div = periodic[n, 0, 0, 0, 0, div];&#xD;
       Do[Do[Do[&#xD;
           Do[p[[i, j, &#xD;
                k]] = (div[[i, j, &#xD;
                   k]] + (p[[i - 1, j, k]] + p[[i + 1, j, k]] + &#xD;
                    p[[i, j - 1, k]] + p[[i, j + 1, k]] + &#xD;
                    p[[i, j, k - 1]] + p[[i, j, k + 1]]))/6;, {k, 2, &#xD;
              n}];, {j, 2, n}], {i, 2, n}];, {k1, 0, r}]; &#xD;
       Do[p[[i, j, k]] = 0;, {i, 10, 20, 1}, {j, Round[n/2 - 5], &#xD;
         Round[n/2 + 5], 1}, {k, Round[n/2 - 5], Round[n/2 + 5], 1}]; &#xD;
       p = periodic[n, 0, 0, 0, 0, p];&#xD;
       Do[ux[[i, j, k]] = &#xD;
         u0[[i, j, k]] + .5 n (p[[i + 1, j, k]] - p[[i - 1, j, k]]);&#xD;
        vy[[i, j, k]] = &#xD;
         v0[[i, j, k]] + .5 n (p[[i, j + 1, k]] - p[[i, j - 1, k]]); &#xD;
        wz[[i, j, k]] = &#xD;
         w0[[i, j, k]] + .5 n (p[[i, j, k + 1]] - p[[i, j, k - 1]]);, {i, &#xD;
         2, n}, {j, 2, n}, {k, 2, n}]; &#xD;
       Do[ux[[i, j, k]] = 0; vy[[i, j, k]] = 0; &#xD;
        wz[[i, j, k]] = 0;, {i, 10, 20, 1}, {j, Round[n/2 - 5], &#xD;
         Round[n/2 + 5], 1}, {k, Round[n/2 - 5], Round[n/2 + 5], 1}]; {ux,&#xD;
         vy, wz}];&#xD;
    &#xD;
    onestep[n_, step_, r_, a_, uin_, vin_, win_, dt_, c_] := &#xD;
     Module[{u1, v1, w1, u, v, w, u0, v0, w0},&#xD;
      u0 = ConstantArray[0., {n + 1, n + 1, n + 1}];&#xD;
      v0 = ConstantArray[0., {n + 1, n + 1, n + 1}]; &#xD;
      w0 = ConstantArray[0., {n + 1, n + 1, n + 1}];&#xD;
      u = ConstantArray[0., {n + 1, n + 1, n + 1}];&#xD;
      v = ConstantArray[0., {n + 1, n + 1, n + 1}]; &#xD;
      w = ConstantArray[0., {n + 1, n + 1, n + 1}];&#xD;
      u1 = ConstantArray[0., {n + 1, n + 1, n + 1}];&#xD;
      v1 = ConstantArray[0., {n + 1, n + 1, n + 1}]; &#xD;
      w1 = ConstantArray[0., {n + 1, n + 1, n + 1}]; u0 = uin; v0 = vin; &#xD;
      w0 = win; &#xD;
      Do[u0[[i, j, k]] = 0; v0[[i, j, k]] = 0; &#xD;
       w0[[i, j, k]] = 0;, {i, 10, 20, 1}, {j, Round[n/2 - 5], &#xD;
        Round[n/2 + 5], 1}, {k, Round[n/2 - 5], Round[n/2 + 5], 1}];&#xD;
      u0 = advect[n, u0, u0, v0, w0, dt]; &#xD;
      v0 = advect[n, v0, u0, v0, w0, dt]; &#xD;
      w0 = advect[n, w0, u0, v0, w0, dt]; &#xD;
      Do[u0[[i, j, k]] = 0; &#xD;
       v0[[i, j, k]] = 0;, {i, 10, 20, 1}, {j, Round[n/2 - 5], &#xD;
        Round[n/2 + 5], 1}, {k, Round[n/2 - 5], Round[n/2 + 5], 1}];&#xD;
      u0 = periodic[n, 0, 0, 0, 0, u0]; v0 = periodic[n, 0, 0, 0, 0, v0]; &#xD;
      w0 = periodic[n, 0, 0, 0, 0, w0];&#xD;
      u0 = diffuse[n, r, a, c, u0]; v0 = diffuse[n, r, a, c, v0]; &#xD;
      w0 = diffuse[n, r, a, c, w0]; &#xD;
      Do[u0[[i, j, k]] = 0; v0[[i, j, k]] = 0; &#xD;
       w0[[i, j, k]] = 0;, {i, 10, 20, 1}, {j, Round[n/2 - 5], &#xD;
        Round[n/2 + 5], 1}, {k, Round[n/2 - 5], Round[n/2 + 5], 1}];&#xD;
      u0 = periodic[n, 0, 0, 0, 0, u0]; v0 = periodic[n, 0, 0, 0, 0, v0]; &#xD;
      w0 = periodic[n, 0, 0, 0, 0, w0];&#xD;
      {u0, v0, w0} = project[n, r, u0, v0, w0, u, v, w]; &#xD;
      Do[u0[[i, j, k]] = 0; v0[[i, j, k]] = 0; &#xD;
       w0[[i, j, k]] = 0;, {i, 10, 20, 1}, {j, Round[n/2 - 5], &#xD;
        Round[n/2 + 5], 1}, {k, Round[n/2 - 5], Round[n/2 + 5], 1}];&#xD;
      u0 = periodic[n, 0, 0, 0, 0, u0]; v0 = periodic[n, 0, 0, 0, 0, v0]; &#xD;
      w0 = periodic[n, 0, 0, 0, 0, w0]; {u0, v0, w0}]&#xD;
    &#xD;
    cf = With[{cg = Compile`GetElement, hp = HoldPattern, &#xD;
         dv = DownValues}, &#xD;
        Hold@Compile[{{u0argu, _Real, 3}, {v0argu, _Real, &#xD;
                  3}, {w0argu, _Real, 3}, {denargu, _Real, &#xD;
                  3}, {sm, _Integer}, {n, _Integer}, {r, _Integer}, dif, &#xD;
                 pec}, Module[{u0 = u0argu, v0 = v0argu, w0 = w0argu, uu, &#xD;
                  vv, ww, dd, den = denargu, &#xD;
                  c = Table[0., {n + 1}, {n + 1}, {n + 1}], dt = 40./n^2, &#xD;
                  a, dnup = den[[1, n + 1, 1]], dnd = den[[1, 1, 1]], &#xD;
                  dnl = den[[1, 1, 1]], dnr = den[[1, 1, n + 1]]}, &#xD;
                 a = dt dif n n;&#xD;
                 &#xD;
                 uu = vv = &#xD;
                   ww = dd = &#xD;
                     Table[0., {sm + 1}, {n + 1}, {n + 1}, {n + 1}];&#xD;
                 &#xD;
                 Do[{u0, v0, w0} = &#xD;
                   onestep[n, step, r, a, u0, v0, w0, dt, c];&#xD;
                  uu[[step + 1]] = u0;&#xD;
                  vv[[step + 1]] = v0; ww[[step + 1]] = w0;&#xD;
                  den = diffuse[n, r, a/pec, c, den]; &#xD;
                  Do[den[[i, j, k]] = 0;, {i, 10, 20, 1}, {j, &#xD;
                &#xD;
                       Round[n/2 - 5], Round[n/2 + 5], 1}, {k, &#xD;
                    Round[n/2 - 5], Round[n/2 + 5], 1}];&#xD;
                  den = periodic[n, dnup, dnd, dnl, dnr, den];&#xD;
                  den = advect[n, den, u0, v0, w0, dt]; &#xD;
                  Do[den[[i, j, k]] = 0;, {i, 10, 20, 1}, {j, &#xD;
                    Round[n/2 - 5], Round[n/2 + 5], 1}, {k, &#xD;
                    Round[n/2 - 5], Round[n/2 + 5], 1}];&#xD;
                  den = periodic[n, dnup, dnd, dnl, dnr, den];&#xD;
                  dd[[step + 1]] = den;, {step, 0, sm}]; {uu, vv, ww, &#xD;
                  dd}], CompilationTarget -&amp;gt; &amp;#034;C&amp;#034;, &#xD;
                RuntimeOptions -&amp;gt; &amp;#034;Speed&amp;#034;] /. dv@onestep /. &#xD;
             Flatten[dv /@ {advect, diffuse, periodic, project}] /. &#xD;
            hp@ConstantArray[c_, {i_, j_, kc_}] :&amp;gt; &#xD;
             Table[0., {i}, {j}, {kc}] /. hp@Part[a__] :&amp;gt; cg[a] /. &#xD;
          hp[cg[a__] = rhs_] :&amp;gt; (Part[a] = rhs) // &#xD;
         ReleaseHold]; &#xD;
    &#xD;
    &#xD;
    &#xD;
    rst = cf[u0, v0, w0, den, sm, n, r, dif, pec]; &#xD;
&#xD;
## Visualization&#xD;
&#xD;
    Do[lst11[s] = &#xD;
      Table[{{(i - 1)/n, (j - 1)/n, (k - 1)/n}, rst[[1, s, i, j, k]]}, {i,&#xD;
         n1}, {j, n1}, {k, n1}];&#xD;
     lst12[s] = &#xD;
      Table[{{(i - 1)/n, (j - 1)/n, (k - 1)/n}, rst[[2, s, i, j, k]]}, {i,&#xD;
         n1}, {j, n1}, {k, n1}]; &#xD;
     lst13[s] = &#xD;
      Table[{{(i - 1)/n, (j - 1)/n, (k - 1)/n}, rst[[3, s, i, j, k]]}, {i,&#xD;
         n1}, {j, n1}, {k, n1}];, {s, 25, sm, 25}]&#xD;
    &#xD;
    Do[su1[i] = &#xD;
      Interpolation[Flatten[lst11[i], 2], InterpolationOrder -&amp;gt; 3]; &#xD;
     sv2[i] = Interpolation[Flatten[lst12[i], 2], &#xD;
       InterpolationOrder -&amp;gt; 3]; &#xD;
     sw3[i] = Interpolation[Flatten[lst13[i], 2], &#xD;
       InterpolationOrder -&amp;gt; 3];, {i, 25, sm, 25}]&#xD;
    &#xD;
    Table[Show[&#xD;
      DensityPlot3D[&#xD;
       Norm[{su1[i][x, y, z], sv2[i][x, y, z], sw3[i][x, y, z]}], {x, 0, &#xD;
        1}, {y, 0.44, 1}, {z, 0, 1}, BoxRatios -&amp;gt; Automatic, &#xD;
       ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, PlotLabel -&amp;gt; i], &#xD;
      VectorPlot3D[{su1[i][x, y, z], sv2[i][x, y, z], &#xD;
        sw3[i][x, y, z]}, {x, 0, 1}, {y, 0, .5}, {z, 0, 1}, &#xD;
       VectorPoints -&amp;gt; Fine, VectorMarkers -&amp;gt; &amp;#034;Arrow&amp;#034;], &#xD;
      Graphics3D[{{Blue, &#xD;
         Cuboid[{10, Round[n/2 - 5] - 1/2, &#xD;
            Round[n/2 - 5] - 1/2}/(n + 1), {20, Round[n/2 + 5] - 1/2, &#xD;
            Round[n/2 + 5] - 1/2}/(n + 1)]}}]], {i, 50, sm, 50}]&#xD;
&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
## Animation&#xD;
&#xD;
    Do[lstu1[k] = &#xD;
       Flatten[Table[{{(i - 1)/n, (j - 1)/n}, &#xD;
          rst[[1, k, i, Round[(n + 1)/2], j]]}, {i, n1}, {j, n1}], 1]; &#xD;
      lstw1[k] = &#xD;
       Flatten[Table[{{(i - 1)/n, (j - 1)/n}, &#xD;
          rst[[2, k, i, Round[(n + 1)/2], j]]}, {i, n1}, {j, n1}], &#xD;
        1];, {k, sm}];&#xD;
    Do[Uvel1[i] = Interpolation[lstu1[i], InterpolationOrder -&amp;gt; 3];, {i, &#xD;
       1, sm}];&#xD;
    Do[Wvel1[i] = Interpolation[lstw1[i], InterpolationOrder -&amp;gt; 3];, {i, &#xD;
       1, sm}];&#xD;
    frame = Table[&#xD;
       Show[DensityPlot[&#xD;
         Norm[{Uvel[m][x, y], Vvel[m][x, y]}], {x, 0, 1}, {y, 0, 1}, &#xD;
         PlotRange -&amp;gt; All, ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, &#xD;
         Frame -&amp;gt; False, ImageSize -&amp;gt; Tiny, PlotLabel -&amp;gt; m, &#xD;
         PlotPoints -&amp;gt; 50], &#xD;
        Graphics[{Gray, &#xD;
          Rectangle[{10, Round[n/2 - 5] - 1/2}/(n + 1), {20, &#xD;
             Round[n/2 + 5] - 1/2}/(n + 1)]}]], {m, 5, sm, 3}];&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
The question is about code improvement. How can we define parameter *r* to solve Laplace and Poison equations in this code? Note, *r* is number of iterations in *diffuse* and *project* module (we use Gauss-Seidel relaxation to solve Laplace and Poison&amp;#039;s equations).&#xD;
&#xD;
**Update 1.** We can reduce *r* from *r=20* as above to *r=5* as below. Globally there is no difference in two animations.&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
But if we compare velocity in some point like $x=0.65, y=0.5$ then we have good agreement for $r=5$ (red points) and $r=20$ (gray points) in laminar flow at $t&amp;lt;0.5$, but a big difference in the turbulent flow at $t&amp;gt;0.5$.&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
**Update 1.** To test the Gauss-Seidel relaxation method itself we can compute viscous flow in a plane channel with external force (gravity) as follows&#xD;
&#xD;
    ClearAll[&amp;#034;Global`*&amp;#034;]&#xD;
    &#xD;
    dif = 1/80; pec = 1; U0 = 0; V0 = 0; n = 11; n1 = n + 1; dt = &#xD;
     2./n^2; sm = 3000; r = 7; n2 = Round[n/2]; a = dt dif n n; c = &#xD;
     ConstantArray[0, {n1, n1}]; c0 = ConstantArray[0, {n1, n1}];; u0 = &#xD;
     ConstantArray[0, {n1, n1}]; v0 = ConstantArray[0, {n1, n1}]; u = &#xD;
     ConstantArray[0, {n1, n1}]; v = ConstantArray[0, {n1, n1}];&#xD;
    &#xD;
    periodic[n_, up_, ud_, ub_] := &#xD;
      Module[{bd = ub}, &#xD;
       Do[bd[[1, i]] = .5 (bd[[n, i]] + bd[[2, i]]); &#xD;
        bd[[n + 1, i]] = bd[[1, i]]; bd[[i, 1]] = ud; &#xD;
        bd[[i, n + 1]] = up;, {i, 2, n}]; bd[[1, 1]] = ud; &#xD;
       bd[[n + 1, n + 1]] = up; bd[[n + 1, 1]] = ud; bd[[1, n + 1]] = up; &#xD;
       bd];&#xD;
    &#xD;
    diffuse[n_, r_, a_, c_, c0_] := &#xD;
     Module[{c1 = c}, c1 = ConstantArray[0, {n + 1, n + 1}]; &#xD;
      Do[Do[Do[c1[[i, &#xD;
             j]] = (c0[[i, j]] + &#xD;
               a (c1[[i - 1, j]] + c1[[i + 1, j]] + c1[[i, j - 1]] + &#xD;
                  c1[[i, j + 1]]))/(1 + 4 a);, {j, 2, n}];, {i, 2, n}]; &#xD;
       c1 = periodic[n, 0, 0, c1];, {k, 0, r}]; c1]; &#xD;
    advect[n_, b_, d_, d0_, u_, v_, dt_] := &#xD;
     Module[{x, y}, d1 = ConstantArray[0, {n + 1, n + 1}]; dt0 = dt n; &#xD;
      Do[Do[x = i - dt0 u[[i, j]]; y = j - dt0 v[[i, j]]; &#xD;
         i0 = Which[x &amp;lt;= 1, 1, 1 &amp;lt; x &amp;lt; n, Floor[x], x &amp;gt;= n, n]; &#xD;
         i1 = i0 + 1; &#xD;
         j0 = Which[y &amp;lt;= 1, 1, 1 &amp;lt; y &amp;lt; n, Floor[y], y &amp;gt;= n, n];&#xD;
         j1 = j0 + 1; s1 = x - i0; s0 = 1 - s1; t1 = y - j0; t0 = 1 - t1; &#xD;
         d1[[i, j]] = &#xD;
          s0 (t0 d0[[i0, j0]] + t1 d0[[i0, j1]]) + &#xD;
           s1 (t0 d0[[i1, j0]] + t1 d0[[i1, j1]]);, {j, 1, n + 1}];, {i, &#xD;
        1, n + 1}]; d1]; &#xD;
    project[n_, r_, u0_, v0_, u_, v_] := &#xD;
      Module[{ux = u, vy = v}, p = ConstantArray[0, {n1, n1}]; &#xD;
       div = ConstantArray[0, {n1, n1}]; ux = ConstantArray[0, {n1, n1}]; &#xD;
       vy = ConstantArray[0, {n1, n1}]; &#xD;
       Do[div[[i, &#xD;
           j]] = -.5 /&#xD;
            n (u0[[i + 1, j]] - u0[[i - 1, j]] + v0[[i, 1 + j]] - &#xD;
             v0[[i, j - 1]]);, {i, 2, n}, {j, 2, n}]; &#xD;
       Do[Do[Do[&#xD;
           p[[i, j]] = (div[[i, &#xD;
                 j]] + (p[[i - 1, j]] + p[[i + 1, j]] + p[[i, j - 1]] + &#xD;
                  p[[i, j + 1]]))/4;, {j, 2, n}], {i, 2, n}];, {k, 0, r}];&#xD;
        Do[ux[[i, j]] = u0[[i, j]] - .5 n (p[[i + 1, j]] - p[[i - 1, j]]);&#xD;
         vy[[i, j]] = &#xD;
         v0[[i, j]] - .5 n (p[[i, j + 1]] - p[[i, j - 1]]);, {i, 2, &#xD;
         n}, {j, 2, n}]; {ux, vy}];   &#xD;
    (*force*)&#xD;
    Fx[t_, x_, y_] := 1/10; Fy[t_, x_, y_] := 0;&#xD;
    f1 = ConstantArray[0, {n1, n1}]; f2 = ConstantArray[0, {n1, n1}];&#xD;
    &#xD;
    Do[u0 = advect[n, 0, c, u0, u0, v0, dt]; &#xD;
      v0 = advect[n, 0, c, v0, u0, v0, dt];&#xD;
      u0 = periodic[n, 0, 0, u0]; v0 = periodic[n, 0, 0, v0];&#xD;
      u0 = diffuse[n, r, a, c, u0]; v0 = diffuse[n, r, a, c, v0];&#xD;
      u0 = periodic[n, 0, 0, u0]; v0 = periodic[n, 0, 0, v0];&#xD;
      Do[f1[[i, j]] = Fx[dt (step + .5), (i - 1)/n, (j - 1)/n]; &#xD;
       f2[[i, j]] = Fy[dt (step + .5), (i - 1)/n, (j - 1)/n];, {i, 2, &#xD;
        n1}, {j, 2, n1}]; u0 += f1 dt; &#xD;
      v0 += f2 dt; {u0, v0} = project[n, r, u0, v0, u, v]; &#xD;
      u0 = periodic[n, 0, 0, u0]; v0 = periodic[n, 0, 0, v0]; &#xD;
      uu[step] = u0; vv[step] = v0;, {step, 0, sm}];&#xD;
&#xD;
## Visualization of flow velocity and absolute error&#xD;
&#xD;
    Do[lstu[k] = &#xD;
       Flatten[Table[{{(i - 1)/n, (j - 1)/n}, uu[k][[i, j]]}, {i, n1}, {j,&#xD;
           n1}], 1]; &#xD;
      lstv[k] = &#xD;
       Flatten[Table[{{(i - 1)/n, (j - 1)/n}, vv[k][[i, j]]}, {i, n1}, {j,&#xD;
           n1}], 1];, {k, 0, sm}];&#xD;
    Do[Uvel[i] = Interpolation[lstu[i], InterpolationOrder -&amp;gt; 3];, {i, 1, &#xD;
      sm}]&#xD;
    Do[Vvel[i] = Interpolation[lstv[i], InterpolationOrder -&amp;gt; 3];, {i, 1, &#xD;
       sm}];&#xD;
    &#xD;
    {StreamDensityPlot[{Uvel[sm][x, y], Vvel[sm][x, y]}, {x, 0, 1}, {y, 0,&#xD;
        1}, ColorFunction -&amp;gt; &amp;#034;RoseColors&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotLegends -&amp;gt; Automatic], &#xD;
     Plot3D[Uvel[sm][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;RoseColors&amp;#034;]}&#xD;
    &#xD;
    {ListPlot[Table[{i dt, Max[uu[i]]}, {i, sm}], &#xD;
      AxesLabel -&amp;gt; {&amp;#034;t&amp;#034;, &amp;#034;Umax&amp;#034;}], &#xD;
     Plot[{-4 (-y + y^2), Uvel[sm][.5, y]}, {y, 0, 1}, &#xD;
      PlotStyle -&amp;gt; {Thick, {Red, Dashed}}, Frame -&amp;gt; True, &#xD;
      FrameLabel -&amp;gt; {&amp;#034;y&amp;#034;, &amp;#034;u&amp;#034;}, &#xD;
      PlotLegends -&amp;gt; {&amp;#034;Exact solution&amp;#034;, &amp;#034;Numeric solution&amp;#034;}], &#xD;
     Plot[Abs[-Uvel[sm][.5, y] - 4 (-y + y^2)], {y, 0, 1}, Frame -&amp;gt; True, &#xD;
      FrameLabel -&amp;gt; {&amp;#034;y&amp;#034;, &amp;#034;Error&amp;#034;}]}&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
Actually for *r=7* we have a good convergence to the exact solution on the grid of 12 points with error of $10^{−2}$. For *r=5* the error is about 0.2 and for *r=10* error is about $10^{−2}$, therefore *r=7* is optimal value.&#xD;
&#xD;
**Update 2.** In the module *advect* we can use trilinear interpolation as follows&#xD;
&#xD;
    advect[n_, d0_, u_, v_, w_, dt_] := &#xD;
      Module[{x, y, z, d1, dt0, i0, i1, j0, j1, k0, k1, s0, s1, t0, t1, &#xD;
        p1, p0, d00, d10, d01, d11, cd0, cd1, xd, yd, zd}, &#xD;
       d1 = ConstantArray[0, {n + 1, n + 1, n + 1}]; dt0 = dt n;&#xD;
       Do[Do[Do[x = i - dt0 u[[i, j, k]]; y = j - dt0 v[[i, j, k]]; &#xD;
            z = k - dt0 w[[i, j, k]];&#xD;
            i0 = Which[x &amp;lt;= 1, 1, 1 &amp;lt; x &amp;lt; n, Floor[x], True, n];&#xD;
            i1 = i0 + 1;&#xD;
            j0 = Which[y &amp;lt;= 1, 1, 1 &amp;lt; y &amp;lt; n, Floor[y], True, n];&#xD;
            j1 = j0 + 1; &#xD;
            k0 = Which[z &amp;lt;= 1, 1, 1 &amp;lt; z &amp;lt; n, Floor[z], True, n];&#xD;
            k1 = k0 + 1;(*Trilinear interpolation*)xd = x - i0; &#xD;
            yd = y - j0; zd = z - k0;&#xD;
            d00 = d0[[i0, j0, k0]] (1 - xd) + d0[[i1, j0, k0]] xd; &#xD;
            d01 = d0[[i0, j0, k1]] (1 - xd) + d0[[i1, j0, k1]] xd; &#xD;
            d10 = d0[[i0, j1, k0]] (1 - xd) + d0[[i1, j1, k0]] xd; &#xD;
            d11 = d0[[i0, j1, k1]] (1 - xd) + d0[[i1, j1, k1]] xd;&#xD;
            cd0 = d00 (1 - yd) + d10 yd; cd1 = d01 (1 - yd) + d11 yd; &#xD;
            d1[[i, j, k]] = cd0 (1 - zd) + cd1 zd;&#xD;
            , {k, 2, n}];, {j, 2, n}];, {i, 1, n + 1}]; d1];&#xD;
&#xD;
## Update: testing projection step&#xD;
&#xD;
To test  `projection` step itself we can use Mathematica FEM and exact benchmark solution from well known paper  [EXACT FULLY 3D NAVIER-STOKES SOLUTIONS FOR BENCHMARKING by C. ROSS ETHIER AND D. A. STEINMAN][8]  as follows. First, we consider projection step as an implementation of the predictor-corrector algorithm &#xD;
$$\frac{u-u_n}{\tau}+(u.\nabla)u-\nu\nabla^2 u=0$$&#xD;
$$\frac{u_{n+1}-u}{\tau}+\nabla p =0$$&#xD;
here $\tau$ is time step, $u_n, u, u_{n+1}$ if velocity field on previous, intermediate and next step consequently, and $p$ is a pressure.  We suppose that $\nabla.u_{n+1}=0$, and therefore&#xD;
$$\nabla^2p-\frac{\nabla.u}{\tau}=0$$&#xD;
Second, we solve NSE in the unit cuboid with Dirichlet condition using exact solution and FEM, we have code&#xD;
&#xD;
    Clear[&amp;#034;Global`*&amp;#034;]&#xD;
    Needs[&amp;#034;NDSolve`FEM`&amp;#034;]&#xD;
    reg = Cuboid[];   &#xD;
    mesh = ToElementMesh[reg, MaxCellMeasure -&amp;gt; 0.001];&#xD;
    (*Exact solution*)&#xD;
    U[x_, y_, z_, &#xD;
      t_] := -a Exp[-d^2 t] (Exp[a x] Sin[a y + d z] + &#xD;
        Exp[a z] Cos[a x + d y]); &#xD;
    V[x_, y_, z_, &#xD;
      t_] := -a Exp[-d^2 t] (Exp[a y] Sin[a z + d x] + &#xD;
        Exp[a x] Cos[a y + d z]); &#xD;
    W[x_, y_, z_, &#xD;
      t_] := -a Exp[-d^2 t] (Exp[a z] Sin[a x + d y] + &#xD;
        Exp[a y] Cos[a z + d x]);&#xD;
    P[x_, y_, z_, &#xD;
      t_] := -a ^2/&#xD;
       2 Exp[-2 d^2 t] (Exp[2 a x] + Exp[2 a y] + Exp[2 a z] + &#xD;
        2 Sin[a x + d y] Exp[a (y + z)] Cos[a z + d x] + &#xD;
        2 Sin[a y + d z] Exp[a (x + z)] Cos[a x + d y] + &#xD;
        2 Sin[a z + d x] Exp[a (y + x)] Cos[&#xD;
          a y + d z]); &#xD;
    (*t0 is time step, nn is number of iterations *)&#xD;
    a = 1; d = 1; t0 = 1/400; nn = 200; \[Nu] = 1;&#xD;
    (*FEM implementation of predictor-corrector algorithm*)&#xD;
    UX[0] = U[x, y, z, 0];&#xD;
    VY[0] = V[x, y, z, 0]; WZ[0] = W[x, y, z, 0];&#xD;
    P0[0] = P[x, y, z, 0];&#xD;
    Do[&#xD;
       {UX[i], VY[i], WZ[i], P0[i]} = &#xD;
         NDSolveValue[{{-\[Nu]*&#xD;
               Laplacian[&#xD;
                u[x, y, z], {x, y, z}] + (u[x, y, z] - UX[i - 1])/t0 + &#xD;
              UX[i - 1]*D[u[x, y, z], x] + VY[i - 1]*D[u[x, y, z], y] + &#xD;
              WZ[i - 1]*D[u[x, y, z], z], -\[Nu]*&#xD;
               Laplacian[&#xD;
                v[x, y, z], {x, y, z}] + (v[x, y, z] - VY[i - 1])/t0 + &#xD;
              UX[i - 1]*D[v[x, y, z], x] + VY[i - 1]*D[v[x, y, z], y] + &#xD;
              WZ[i - 1]*D[v[x, y, z], z], -\[Nu]*&#xD;
               Laplacian[&#xD;
                w[x, y, z], {x, y, z}] + (w[x, y, z] - WZ[i - 1])/t0 + &#xD;
              UX[i - 1]*D[w[x, y, z], x] + VY[i - 1]*D[w[x, y, z], y] + &#xD;
              WZ[i - 1]*D[w[x, y, z], z], &#xD;
             Laplacian[p[x, y, z], {x, y, z}] - (&#xD;
    \!\(\*SuperscriptBox[\(u\), &#xD;
    TagBox[&#xD;
    RowBox[{&amp;#034;(&amp;#034;, &#xD;
    RowBox[{&amp;#034;1&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;}], &amp;#034;)&amp;#034;}],&#xD;
    Derivative],&#xD;
    MultilineFunction-&amp;gt;None]\)[x, y, z] + &#xD;
    \!\(\*SuperscriptBox[\(v\), &#xD;
    TagBox[&#xD;
    RowBox[{&amp;#034;(&amp;#034;, &#xD;
    RowBox[{&amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;1&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;}], &amp;#034;)&amp;#034;}],&#xD;
    Derivative],&#xD;
    MultilineFunction-&amp;gt;None]\)[x, y, z] + &#xD;
    \!\(\*SuperscriptBox[\(w\), &#xD;
    TagBox[&#xD;
    RowBox[{&amp;#034;(&amp;#034;, &#xD;
    RowBox[{&amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;1&amp;#034;}], &amp;#034;)&amp;#034;}],&#xD;
    Derivative],&#xD;
    MultilineFunction-&amp;gt;None]\)[x, y, z])/t0} == {0, 0, 0, 0}, {&#xD;
            DirichletCondition[{u[x, y, z] == &#xD;
               U[x, y, z, i t0 - t0/2] + t0 D[P[x, y, z, i t0], x], &#xD;
              v[x, y, z] == &#xD;
               V[x, y, z, i t0 - t0/2] + t0 D[P[x, y, z, i t0], y], &#xD;
              w[x, y, z] == &#xD;
               W[x, y, z, i t0 - t0/2] + t0 D[P[x, y, z, i t0], z], &#xD;
              p[x, y, z] == P[x, y, z, i t0 ]}, True]}}, {u[x, y, z] - t0 &#xD;
    \!\(\*SuperscriptBox[\(p\), &#xD;
    TagBox[&#xD;
    RowBox[{&amp;#034;(&amp;#034;, &#xD;
    RowBox[{&amp;#034;1&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;}], &amp;#034;)&amp;#034;}],&#xD;
    Derivative],&#xD;
    MultilineFunction-&amp;gt;None]\)[x, y, z], v[x, y, z] - t0 &#xD;
    \!\(\*SuperscriptBox[\(p\), &#xD;
    TagBox[&#xD;
    RowBox[{&amp;#034;(&amp;#034;, &#xD;
    RowBox[{&amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;1&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;}], &amp;#034;)&amp;#034;}],&#xD;
    Derivative],&#xD;
    MultilineFunction-&amp;gt;None]\)[x, y, z], w[x, y, z] - t0 &#xD;
    \!\(\*SuperscriptBox[\(p\), &#xD;
    TagBox[&#xD;
    RowBox[{&amp;#034;(&amp;#034;, &#xD;
    RowBox[{&amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;1&amp;#034;}], &amp;#034;)&amp;#034;}],&#xD;
    Derivative],&#xD;
    MultilineFunction-&amp;gt;None]\)[x, y, z], &#xD;
           p[x, y, z]}, {x, y, z} \[Element] mesh, &#xD;
          Method -&amp;gt; {&amp;#034;FiniteElement&amp;#034;, &#xD;
            &amp;#034;InterpolationOrder&amp;#034; -&amp;gt; {u -&amp;gt; 2, v -&amp;gt; 2, w -&amp;gt; 2, &#xD;
              p -&amp;gt; 2}}];, {i, 1, nn}]; &#xD;
Visualization of error on every 5 steps on the line $x=1/2, z=1/2$ for $u_n=(UX[n],VY[n],WZ[n])$, and $p=P0[n]$&#xD;
&#xD;
    Table[{k t0 // N, &#xD;
      Plot[Evaluate[{U[x, y, z, k t0]/UX[k] - 1} /. {x -&amp;gt; 1/2, &#xD;
          z -&amp;gt; 1/2}], {y, 0, 1}, PlotRange -&amp;gt; All], &#xD;
      Plot[Evaluate[{V[x, y, z, k t0]/VY[k] - 1} /. {x -&amp;gt; 1/2, &#xD;
          z -&amp;gt; 1/2}], {y, 0, 1}, PlotRange -&amp;gt; All], &#xD;
      Plot[Evaluate[{W[x, y, z, k t0]/WZ[k] - 1} /. {x -&amp;gt; 1/2, &#xD;
          z -&amp;gt; 1/2}], {y, 0, 1}, PlotRange -&amp;gt; All], &#xD;
      Plot[Evaluate[{P[x, y, z, k t0]/P0[k] - 1} /. {x -&amp;gt; 1/2, &#xD;
          z -&amp;gt; 1/2}], {y, 0, 1}, PlotRange -&amp;gt; All]}, {k, 5, nn, 5}]&#xD;
Please note, that in the picture shown last steps only. The relative error for pressure is about $3\times 10^{-3}$, and for velocity $1.25\times10^{-3}$ on the grid $10\times10\times 10$ on 200 steps in time with time step $\tau =1/400$. &#xD;
![Figure 1][9] &#xD;
&#xD;
&#xD;
Using exact benchmark solution we also can test linear FEM algorithm described on [Solver for unsteady flow with the use of Mathematica FEM][10] and extended to 3D below as follows&#xD;
&#xD;
    Needs[&amp;#034;NDSolve`FEM`&amp;#034;]&#xD;
    reg = Cuboid[];&#xD;
    mesh = ToElementMesh[reg, MaxCellMeasure -&amp;gt; 0.001]&#xD;
    &#xD;
    U[x_, y_, z_, &#xD;
      t_] := -a Exp[-d^2 t] (Exp[a x] Sin[a y + d z] + &#xD;
        Exp[a z] Cos[a x + d y]); &#xD;
    V[x_, y_, z_, &#xD;
      t_] := -a Exp[-d^2 t] (Exp[a y] Sin[a z + d x] + &#xD;
        Exp[a x] Cos[a y + d z]); &#xD;
    W[x_, y_, z_, &#xD;
      t_] := -a Exp[-d^2 t] (Exp[a z] Sin[a x + d y] + &#xD;
        Exp[a y] Cos[a z + d x]);&#xD;
    P[x_, y_, z_, &#xD;
      t_] := -a ^2/&#xD;
       2 Exp[-2 d^2 t] (Exp[2 a x] + Exp[2 a y] + Exp[2 a z] + &#xD;
        2 Sin[a x + d y] Exp[a (y + z)] Cos[a z + d x] + &#xD;
        2 Sin[a y + d z] Exp[a (x + z)] Cos[a x + d y] + &#xD;
        2 Sin[a z + d x] Exp[a (y + x)] Cos[&#xD;
          a y + d z]); a = 1; d = 1; t0 = 1/400; nn = 200; \[Nu] = 1;&#xD;
    UX[0] = U[x, y, z, 0];&#xD;
    VY[0] = V[x, y, z, 0]; WZ[0] = W[x, y, z, 0];&#xD;
    P0[0] = P[x, y, z, 0];&#xD;
    Do[&#xD;
       {UX[i], VY[i], WZ[i], P0[i]} = &#xD;
         NDSolveValue[{{-\[Nu]*&#xD;
               Laplacian[&#xD;
                u[x, y, z], {x, y, z}] + (u[x, y, z] - UX[i - 1])/t0 + &#xD;
              UX[i - 1]*D[u[x, y, z], x] + VY[i - 1]*D[u[x, y, z], y] + &#xD;
              WZ[i - 1]*D[u[x, y, z], z] + &#xD;
    \!\(\*SuperscriptBox[\(p\), &#xD;
    TagBox[&#xD;
    RowBox[{&amp;#034;(&amp;#034;, &#xD;
    RowBox[{&amp;#034;1&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;}], &amp;#034;)&amp;#034;}],&#xD;
    Derivative],&#xD;
    MultilineFunction-&amp;gt;None]\)[x, y, z], -\[Nu]*&#xD;
               Laplacian[&#xD;
                v[x, y, z], {x, y, z}] + (v[x, y, z] - VY[i - 1])/t0 + &#xD;
              UX[i - 1]*D[v[x, y, z], x] + VY[i - 1]*D[v[x, y, z], y] + &#xD;
              WZ[i - 1]*D[v[x, y, z], z] + &#xD;
    \!\(\*SuperscriptBox[\(p\), &#xD;
    TagBox[&#xD;
    RowBox[{&amp;#034;(&amp;#034;, &#xD;
    RowBox[{&amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;1&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;}], &amp;#034;)&amp;#034;}],&#xD;
    Derivative],&#xD;
    MultilineFunction-&amp;gt;None]\)[x, y, z], -\[Nu]*&#xD;
               Laplacian[&#xD;
                w[x, y, z], {x, y, z}] + (w[x, y, z] - WZ[i - 1])/t0 + &#xD;
              UX[i - 1]*D[w[x, y, z], x] + VY[i - 1]*D[w[x, y, z], y] + &#xD;
              WZ[i - 1]*D[w[x, y, z], z] + &#xD;
    \!\(\*SuperscriptBox[\(p\), &#xD;
    TagBox[&#xD;
    RowBox[{&amp;#034;(&amp;#034;, &#xD;
    RowBox[{&amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;1&amp;#034;}], &amp;#034;)&amp;#034;}],&#xD;
    Derivative],&#xD;
    MultilineFunction-&amp;gt;None]\)[x, y, z], (&#xD;
    \!\(\*SuperscriptBox[\(u\), &#xD;
    TagBox[&#xD;
    RowBox[{&amp;#034;(&amp;#034;, &#xD;
    RowBox[{&amp;#034;1&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;}], &amp;#034;)&amp;#034;}],&#xD;
    Derivative],&#xD;
    MultilineFunction-&amp;gt;None]\)[x, y, z] + &#xD;
    \!\(\*SuperscriptBox[\(v\), &#xD;
    TagBox[&#xD;
    RowBox[{&amp;#034;(&amp;#034;, &#xD;
    RowBox[{&amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;1&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;}], &amp;#034;)&amp;#034;}],&#xD;
    Derivative],&#xD;
    MultilineFunction-&amp;gt;None]\)[x, y, z] + &#xD;
    \!\(\*SuperscriptBox[\(w\), &#xD;
    TagBox[&#xD;
    RowBox[{&amp;#034;(&amp;#034;, &#xD;
    RowBox[{&amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;0&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;1&amp;#034;}], &amp;#034;)&amp;#034;}],&#xD;
    Derivative],&#xD;
    MultilineFunction-&amp;gt;None]\)[x, y, z])} == {0, 0, 0, 0}, {&#xD;
            DirichletCondition[{u[x, y, z] == U[x, y, z, i t0], &#xD;
              v[x, y, z] == V[x, y, z, i t0], &#xD;
              w[x, y, z] == W[x, y, z, i t0], &#xD;
              p[x, y, z] == P[x, y, z, i t0]}, True]}}, {u[x, y, z] , &#xD;
           v[x, y, z] , w[x, y, z] , p[x, y, z]}, {x, y, z} \[Element] &#xD;
           mesh, Method -&amp;gt; {&amp;#034;FiniteElement&amp;#034;, &#xD;
            &amp;#034;InterpolationOrder&amp;#034; -&amp;gt; {u -&amp;gt; 2, v -&amp;gt; 2, w -&amp;gt; 2, &#xD;
              p -&amp;gt; 1}}];, {i, 1, nn}]; &#xD;
Visualization of error on every 5 steps on the line $y=1/2,z=1/2$ for $u_n=(UX[n],VY[n],WZ[n])$, and $p=P0[n]$&#xD;
&#xD;
    Table[{k t0 // N, &#xD;
      Plot[Evaluate[{U[x, y, z, k t0]/UX[k] - 1} /. {y -&amp;gt; 1/2, &#xD;
          z -&amp;gt; 1/2}], {x, 0, 1}, PlotRange -&amp;gt; All], &#xD;
      Plot[Evaluate[{V[x, y, z, k t0]/VY[k] - 1} /. {y -&amp;gt; 1/2, &#xD;
          z -&amp;gt; 1/2}], {x, 0, 1}, PlotRange -&amp;gt; All], &#xD;
      Plot[Evaluate[{W[x, y, z, k t0]/WZ[k] - 1} /. {y -&amp;gt; 1/2, &#xD;
          z -&amp;gt; 1/2}], {x, 0, 1}, PlotRange -&amp;gt; All], &#xD;
      Plot[Evaluate[{P[x, y, z, k t0]/P0[k] - 1} /. {y -&amp;gt; 1/2, &#xD;
          z -&amp;gt; 1/2}], {x, 0, 1}, PlotRange -&amp;gt; All]}, {k, 5, nn, 5}]&#xD;
Note, that in the picture shown last steps only. The relative error for pressure is about $2×10^{−3}$, and for velocity $1.5×10^{−4}$ on the grid 10×10×10 on 200 steps in time with time step τ=1/400.&#xD;
![Figure 1][11]&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
 &#xD;
&#xD;
  [1]: https://mathematica.stackexchange.com/questions/246091/stable-fluids-code-for-electromagnetic-mixture-application&#xD;
  [2]: https://community.wolfram.com/groups/-/m/t/2399430&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=qzbqN.jpg&amp;amp;userId=20103&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=UlIzg.gif&amp;amp;userId=20103&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1zwVo.gif&amp;amp;userId=20103&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=GSzFn.png&amp;amp;userId=20103&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=uYoQq.png&amp;amp;userId=20103&#xD;
 [8]: https://www.ljll.math.upmc.fr/~frey/papers/Navier-Stokes/Ethier%20C.R.,%20Steinman%20D.A.,%20Exact%20fully%203d%20Navier-Stokes%20solutions%20for%20benchmarking.pdf&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=uvwperr.jpg&amp;amp;userId=1218692&#xD;
  [10]: https://community.wolfram.com/groups/-/m/t/1433064?p_p_auth=kiX86GkA&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=err.jpg&amp;amp;userId=1218692</description>
    <dc:creator>Alexander Trounev</dc:creator>
    <dc:date>2022-03-17T17:52:07Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2483319">
    <title>Error using OutputResponse?</title>
    <link>https://community.wolfram.com/groups/-/m/t/2483319</link>
    <description>Hi everyone, i have the next problem, this is my transferfunction as you can see its a firts order system with time death delay&#xD;
&#xD;
    gf = TransferFunctionModel[{{{13.138*E^(-1.919*s)}}, {{1 + &#xD;
          171.18*s}}}, s]&#xD;
&#xD;
I use PIDtune to get a PIDcontrol for my system:&#xD;
&#xD;
    Gc = PIDTune[gf, &amp;#034;PID&amp;#034;, &amp;#034;ReferenceOutput&amp;#034;]&#xD;
the I want to see the output response, but it gives me an error evaluating the system, and I was trying, it always happens when I put a system delayed with:&#xD;
&#xD;
    out1 = OutputResponse[Gc, 4.5, {t, 1, 100}];&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=OUTPUT.png&amp;amp;userId=2304918&#xD;
&#xD;
You know I&amp;#039;m really disappointed with this, I was finding by myself at least 3 days, but I didn&amp;#039;t find nothing and documentation about outputresponse its not really helpful because outputresponse doesn&amp;#039;t have options, I&amp;#039;m new in this so I hope you can help me, I&amp;#039;m very grateful for your time reading this.</description>
    <dc:creator>Jairo Smith Quilumbaquin Lanchimba</dc:creator>
    <dc:date>2022-03-02T02:46:38Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2030260">
    <title>[WSS20] ThermodynamicCycle: for parameters &amp;amp; properties at each state</title>
    <link>https://community.wolfram.com/groups/-/m/t/2030260</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=CapturadeTela2020-11-20a%CC%80s18.42.07.png&amp;amp;userId=2029333&#xD;
  [2]: https://www.wolframcloud.com/obj/64ef0cca-d762-4a13-81fa-609012f78f17</description>
    <dc:creator>Gino Andrade</dc:creator>
    <dc:date>2020-07-14T17:20:46Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2466465">
    <title>Suggesting a fluid in SystemModeler</title>
    <link>https://community.wolfram.com/groups/-/m/t/2466465</link>
    <description>v13.0 of System Modeler provides access to many fluids (bravo!). Unfortunately, I need one more fluid available in NIST/RefProp but not in the list of fluids for v13.0. Can I ask that the fluid be added? Or can you provide access to RefProp directly (most helpful) through System Modeler?</description>
    <dc:creator>Patrick Fourspring</dc:creator>
    <dc:date>2022-02-08T13:14:34Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2450699">
    <title>Solving quadratic equations involving Quaternion variables</title>
    <link>https://community.wolfram.com/groups/-/m/t/2450699</link>
    <description>I am solving a system of quadratic equations that comes from the 3D rotational kinematics problem expressed by Quaternion variables after simplifying the expressions:&#xD;
&#xD;
    Solve[{-2/dT (-qbr1 qbrp0 + qbr0 qbrp1 - qbr3 qbrp2 + qbr2 qbrp3) + &#xD;
         2 constC (-qb1 qbr0 + qb0 qbr1 - qb3 qbr2 + qb2 qbr3) (qb0 qbr0 +&#xD;
             qb1 qbr1 + qb2 qbr2 + qb3 qbr3) == &#xD;
        const1 &amp;amp;&amp;amp; -2/&#xD;
          dT (-qbr2 qbrp0 + qbr3 qbrp1 + qbr0 qbrp2 - qbr1 qbrp3) + &#xD;
         2 constC (-qb2 qbr0 + qb3 qbr1 + qb0 qbr2 - qb1 qbr3) (qb0 qbr0 +&#xD;
             qb1 qbr1 + qb2 qbr2 + qb3 qbr3) == &#xD;
        const2 &amp;amp;&amp;amp; -2/&#xD;
          dT (-qbr3 qbrp0 - qbr2 qbrp1 + qbr1 qbrp2 + qbr0 qbrp3) - &#xD;
         2 constC (qb3 qbr0 + qb2 qbr1 - qb1 qbr2 - qb0 qbr3) (qb0 qbr0 + &#xD;
            qb1 qbr1 + qb2 qbr2 + qb3 qbr3) == const3 &amp;amp;&amp;amp; &#xD;
       qbr0*qbr0 + qbr1*qbr1 + qbr2*qbr2 + qbr3*qbr3 == 1}, {qbr0, qbr1, &#xD;
      qbr2, qbr3}, Cubics -&amp;gt; False, Quartics -&amp;gt; False]&#xD;
&#xD;
It keeps running but, so far for 5 hours, cannot get the solution yet.  This seems possible to solve and not too difficult.  Did I make something wrong, or should I solve using other methods or functions?  Please advise me.</description>
    <dc:creator>Bank Pitakwatchara</dc:creator>
    <dc:date>2022-01-20T10:39:48Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2442313">
    <title>How can I model a scissor mechanism in SystemModeler?</title>
    <link>https://community.wolfram.com/groups/-/m/t/2442313</link>
    <description>I&amp;#039;m new to SystemModeler and the underlying modeling Language Modelica.   I would like to do model a [scissor mechanism][1] and I don&amp;#039;t quite see how to do it within the Modelica Mechanics Library.&#xD;
&#xD;
I want an idealized model so I want to neglect the mass of the mechanism and let it act as a linear motion amplificator.  That is, given its three connectors a, b and c,  I want the component to simply impose the equation `xb - xa = lambda * (xc - xa)`, where lambda is a scalar parameter between 0 and 1.&#xD;
&#xD;
I want to work in one dimension so I suppose I should be able to use the `Modelica.Mechanics.Translational` library, but even that seems complicated.  As I see it, most components in the library have two flanges, not three.   Maybe I should extend `PartialTwoFlangesAndSupport`?   Or should I write my own component without deriving it from the library?  If so what would it look like?  Would it have a third flange name `flange_c`?&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
  [1]: https://en.wikipedia.org/wiki/Scissors_mechanism</description>
    <dc:creator>Lucien Grondin</dc:creator>
    <dc:date>2022-01-11T07:41:33Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2408952">
    <title>Rational bracings of regular polygons</title>
    <link>https://community.wolfram.com/groups/-/m/t/2408952</link>
    <description>&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/c7065049-7ed0-403f-ad2c-766d75eaa94e</description>
    <dc:creator>Jeremy Tan</dc:creator>
    <dc:date>2021-11-18T05:17:56Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2417648">
    <title>RotorWith3DEffects modeling problems inconsistent with Mathematica</title>
    <link>https://community.wolfram.com/groups/-/m/t/2417648</link>
    <description>This is a question directly related to several other previous questions of mine, however most directly related to [Torn Equations][1]&#xD;
&#xD;
Besides that question, I have also (through Mathematica) modeled, simulated and controlled a [flywheel inverted pendulum][2]  (youtube link)&#xD;
&#xD;
This works well, and I have a good mathematical understanding of the model equations, which is why it, and the other previous testbench (as seen in my Torn equations question) are my direct comparisons to models I&amp;#039;ve made SystemModeler. &#xD;
&#xD;
When improving my models using `RotorWith3DEffects` I realized that this particular class isn&amp;#039;t quite used as exactly as the other `Rotor` and also isn&amp;#039;t quite connected the same in order to achieve the 1DOF inertia on a 3D body. When reading the documentation there is a single line &#xD;
&#xD;
&amp;gt; Gyroscopic torques appear, if the vector of the carrier body&amp;#039;s angular velocity is not parallel to the vector of the rotor&amp;#039;s axis.&#xD;
&#xD;
Which for my English is a bit cryptic, but fine. When looking at suggested other examples, such as `&#xD;
GyroscopicEffects` &#xD;
&#xD;
![gryo][3]&#xD;
&#xD;
It shows that the class is connected via the Housing connector. So I do this as well in my models, which produce great results that match the real model and the Mathematica version. &#xD;
&#xD;
My issue now comes that when trying to improve my BLDC motor model, which is a maxon EC45 Flat, an &amp;#034;aussen roller&amp;#034; Or namely a motor with rotating housing, clearly also has a rotating inertia that I want to include to complete my model. &#xD;
&#xD;
![motor][4]&#xD;
&#xD;
Because I want to use this in a library/package later for reuse, I want to the motor model to be complete, and not simply add it&amp;#039;s inertia to an outside class. &#xD;
&#xD;
The problem here arises, when I want to connect the motor model shaft of the inner `RotorWith3DEffects` to an &amp;#039;shaft&amp;#039; or outer `RotorWith3DEffects` the gyroscopic effects disappear. &#xD;
&#xD;
But this is fine, clearly I have a misunderstanding. So I tried to experiment with 5 different modeling/connection techniques to figure out how to connect this model correctly.&#xD;
&#xD;
Unfortunately, I now have 5 different results, none of which are similar, and only one that sort of resembles the model from Mathematica, except it appears to have energy being constantly added to the system, instead of it dissipating. &#xD;
&#xD;
The Mathematica ODEs are :&#xD;
&#xD;
Where $\alpha(t)$ is the pendulum angle, and $\phi(t)$ is the motor angle. with various inertias, friction and masses. &#xD;
&#xD;
$$\left\{g \sin (\alpha (t)) (k \text{mw}+l \text{mb})+\text{jw} \phi &amp;#039;&amp;#039;(t)+\Theta  \alpha &amp;#039;&amp;#039;(t)=-\text{rb} \alpha &amp;#039;(t)-\mu  \tanh \left(\frac{\alpha &amp;#039;(t)}{\iota }\right),\text{jw} \left(\alpha &amp;#039;&amp;#039;(t)+\phi &amp;#039;&amp;#039;(t)\right)=\tau  u(t)-\text{rw} \phi &amp;#039;(t)\right\}$$&#xD;
&#xD;
When given a simple constant input of 0.6 at $u(t)$ from hanging position of initial angle $\alpha(0) = 0$ the Motor spins up, causes swinging and short lived constant offset before the system falls back to angle zero as seen here:&#xD;
&#xD;
![rotor][5]&#xD;
&#xD;
Also&#xD;
![plot][6]&#xD;
&#xD;
When using the actual physical model, this also happens, pretty much exactly the same, as such I am confident this is modeled fairly well. &#xD;
&#xD;
As mentioned unfortunately, when doing this same within my 5 different experiments, I don&amp;#039;t get any of the same results but instead either no displacement whatsoever, a constant non-dissipating oscillation or a constant angle accumulation that eventually breaks the simulation, as seen here:&#xD;
&#xD;
![models][7] &#xD;
![models][8]&#xD;
![more plots][9]&#xD;
&#xD;
TLDR:  I want to be able to use `RotorWith3DEffects` like `Rotor` to get gyroscopic effects with my internal motor model, and be able to use the rotors shafts as connection points, rather the housing, however it seems this isn&amp;#039;t possible in the way I expect it, and when comparing different connect methods, against Mathematica, I get wildly different results, and I don&amp;#039;t know which one is correct, and baring all of them are wrong, then I&amp;#039;m completely stuck.&#xD;
&#xD;
How do I use this class correctly, the description and one single example within the documentation don&amp;#039;t specify this enough for me, and the many test results don&amp;#039;t match up with my real world model or Mathematicas. &#xD;
&#xD;
I have included the Mathematica files and System modeler file within this post for your own testing, done in System modeler 12.3. Thanks for the help. &#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com/groups/-/m/t/2403814?p_p_auth=J60QE3xh&#xD;
  [2]: https://www.youtube.com/watch?v=Lzw3ZGTuMUU&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2021-12-02at10.28.38.png&amp;amp;userId=1222283&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2021-12-02at10.32.57.png&amp;amp;userId=1222283&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=rotar.gif&amp;amp;userId=1222283&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=plot.png&amp;amp;userId=1222283&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2021-12-02at10.51.19.png&amp;amp;userId=1222283&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2021-12-02at11.07.17.png&amp;amp;userId=1222283&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2021-12-02at10.51.46.png&amp;amp;userId=1222283</description>
    <dc:creator>Mor Bo</dc:creator>
    <dc:date>2021-12-02T10:03:21Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2419306">
    <title>[GiF] Love heart jewelry III: the outcome of Cupid&amp;#039;s arrow</title>
    <link>https://community.wolfram.com/groups/-/m/t/2419306</link>
    <description>![enter image description here][1]&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=show.gif&amp;amp;userId=569571&#xD;
  [2]: https://www.wolframcloud.com/obj/b8c3a801-10c0-41b4-9074-484ba0d003e7</description>
    <dc:creator>Frederick Wu</dc:creator>
    <dc:date>2021-12-05T11:02:53Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2403814">
    <title>Torn Equations and solving Nonlinear problems within SystemModeler</title>
    <link>https://community.wolfram.com/groups/-/m/t/2403814</link>
    <description>I am working on a little project to help learn more of SystemModeler and modeling within that environment. &#xD;
&#xD;
I have a working physical test bench of the system I choose to simulate, I would like to simulate and design and test different control schemes via SystemModeler, Mathematica and the Microcontroller Kit. &#xD;
&#xD;
The system being a 3d inverted pendulum, like the [Cubli][1]. &#xD;
&#xD;
When simulating the single degree of freedom, I have great stabilization. &#xD;
&#xD;
 ![single degree][2] &#xD;
&#xD;
&#xD;
This model is in-fact the second version of it I have designed, the first version using `Bodyshapes` classes while this newer version uses `Rotorswith3Deffects`&#xD;
&#xD;
I have changed the model to use the rotors as the angle/control reactions in the first did not reflect reality with the physical test bench, while the newer version is almost nearly identical...but I digress. &#xD;
&#xD;
When inverting this model to stand on its corner to be a 3DOF, 3D pendulum, I am now getting constant &amp;#034;torn&amp;#034; errors, which I can view with the Equation browser, however I can&amp;#039;t begin to understand how this is helpful, or what I can do, beyond what it *seems* to be setting initial conditions to repair the problem...this however leads to an ever increasing cascade in *more* torn system errors. ![torn][3]&#xD;
&#xD;
My model isn&amp;#039;t particularly large I think but I am using several custom subsystems and functions, I realize, but for an idea of what I have built, see the below images.&#xD;
&#xD;
The *working* Single DOF system with control. &#xD;
&#xD;
![single][4]&#xD;
&#xD;
The Same system with 3 DOF activated, causing torn system.&#xD;
&#xD;
![3dof][5]&#xD;
&#xD;
I don&amp;#039;t think this is a particularly interesting or difficult nonlinear system to Solve for SystemModeler...I feel this has something to do with the `Rotorswith3dEffects` but since this works in the 1DOF systems, I am somewhat at a loss. &#xD;
&#xD;
How can I fix the torn system via the equation browser? Is this is the wrong direction to follow? Is there a better way or thing to look out for?&#xD;
&#xD;
  I have looked at the `GyroscopicEffects` example from recommendations from previous questions...which is how I managed to come up with the model I have (which again works great in the 1DOF simulation). &#xD;
&#xD;
My physical test bench for reference:&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
&#xD;
  [1]: https://www.youtube.com/watch?v=n_6p-1J551Y&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2021-11-10at13.06.33.png&amp;amp;userId=1222283&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2021-11-10at13.17.40.png&amp;amp;userId=1222283&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2021-11-10at13.19.59.png&amp;amp;userId=1222283&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2021-11-10at13.25.10.png&amp;amp;userId=1222283&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=0F2B6A00-0719-46B8-B365-7F99323C99B9.JPG&amp;amp;userId=1222283</description>
    <dc:creator>Mor Bo</dc:creator>
    <dc:date>2021-11-10T12:38:29Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2399430">
    <title>Rogue wave: stable fluids algorithm for air/water interface simulation</title>
    <link>https://community.wolfram.com/groups/-/m/t/2399430</link>
    <description>*SUPPLEMENTARY WOLFRAM MATERIALS for the ARTICLE:*&#xD;
&amp;gt; Sergio Manzetti, Alexander Trounev (2021).&#xD;
&#xD;
&amp;gt; A Navier-Stokes model for Rogue wave simulation.&#xD;
&#xD;
&amp;gt; ResearchGate, Technical Report. https://www.researchgate.net/publication/354527324&#xD;
&#xD;
&#xD;
------&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
ABSTRACT&#xD;
--------------------------------------&#xD;
&#xD;
Rogue waves are anomalous phenomena occurring over large sea bodies, where they are said appear out of nowhere and disappear without a trace. Simulations of rogue waves have been carried over the last 40 years, with several models published. In this paper we investigate the formation of rogue waves by two models: I. the Navier-Stokes equation where we take into account density and viscosity gradient on the air-water interface due to diffusion and II. a Korteveg de Vries-type model for quantum jumps which we developed earlier. We derive also a stable fluids algorithm which we use to compute nonlinear waves interaction produced by the wind. The results are discussed and compared.&#xD;
&#xD;
This code solves problem of viscous incompressible flow with gravitational force in a rectangle with periodic boundary condition on the left and right side and with Dirichlet condition on the top and bottom side. &#xD;
In the initial condition fluid velocity is periodic wave, and density has unit step like distribution on the air/water interface. &#xD;
Some other application of this code has been discussed on https://mathematica.stackexchange.com/questions/246091/stable-fluids-code-for-electromagnetic-mixture-application&#xD;
&#xD;
This model has been discussed in our report  [A Navier-Stokes model for Rogue wave simulation][2]&#xD;
&#xD;
Two phase model of air-water interface&#xD;
--------------------------------------&#xD;
&#xD;
Let us consider the system of equations describing nonlinear waves on the air-water interface. As it well known the air and the water can be considered as viscous incompressible fluids with density $\rho_a, \rho_w$,  and dynamical viscosity $\mu_a, \mu_w$ consequently. Taking into account the gravity force and diffusion on the air-water interface, we have &#xD;
$$\nabla.\bf{u}=0\\&#xD;
 \frac{\partial \mathbf{u}}{\partial t}+(\mathbf{u}.\nabla)\mathbf{u}+\frac{\nabla P}{\rho_i}=\nu_i\nabla ^2\mathbf{u}+\mathbf{f}\\\&#xD;
 \frac{\partial \phi}{\partial t} +(\mathbf{u}.\nabla)\phi=\frac{\nu_i}{Sc_i}\nabla ^2\phi\\ &#xD;
$$&#xD;
Here it is indicated $\rho_i, i=a,w $ - air and water density, $\mathbf{u}=(u_x,u_y)$ - flow velocity,  $P$ - pressure; $\bf{f}$ - force acting on the volume of the air-water mixture; $\phi$ - the interface function describing the averaged density of the air-water mixture; $Sc_i$ - analog of the Schmidt number characterized water diffusion in the air and air diffusion in the water. Note that we considered averaged effect of mass transfer on the air-water interface including drops and bubbles. &#xD;
Let us define the Cartesian coordinate system so that the $y$ axis is directed against the direction of the gravitational acceleration vector and the $x$ axis is parallel to horizon. Let suppose that the water surface relief is described by the equation $y=r(t,x,y)$ - Figure 1.&#xD;
![Figure 1. Flow geometry on the air-water interface with waves of small (left) and large (right) amplitude][3]&#xD;
&#xD;
We set the boundary conditions for the flow parameters on the top and bottom part of the boundary layer and periodic boundary conditions by coordinate $x$ as follows:&#xD;
&#xD;
$$ y=0: \mathbf{u}=0,\phi=\rho_w\\&#xD;
 y=H: \mathbf{u}=(U_0,0), \phi=\rho_a\\&#xD;
 \mathbf{u}(t,0,y)=\mathbf{u}(t,L,y)\\&#xD;
 \phi(t,0,y)=\phi(t,L,y).&#xD;
$$&#xD;
Here $H$ is the height of the boundary layer,$U_0$ is the wind velocity, $L$ is the period of the wave tray.&#xD;
We assume that at the initial time the flow velocity and interface function are given by&#xD;
&#xD;
$$ t=0, y&amp;lt;H/2:u_x = 0, u_y=V_0 \sin(2 \pi n x/L), \phi =\rho_w\\ &#xD;
 t=0, y\ge H/2: u_x=U_0, u_y=V_0\sin (2 \pi n x/L), \phi =\rho_a\\&#xD;
 $$&#xD;
This problem can be solved with using numerical methods and an appropriate turbulence model. &#xD;
We have used stable fluids algorithm (Stam1999, Stam 2000) to solve 2D Navier-Stokes equations and to simulate nonlinear waves interaction on the air-water interface with a given wind velocity on the top of the boundary layer. While in the standard gravity wave theory the air-water interface is considered mainly as a potential flow, in our approach we take into account velocity, viscosity and density gradients on the interface. Since air/water density ratio is about $10^{-3}$ we have some challenging numerical problem. To solve this problem we made some simplifications in the basic Navier-Stokes equations. First, we suppose that velocity is a continues field at $t&amp;gt;0$ so that flow in the water and flow in the air is an united flow continuously distributed from the bottom to the top and the periodic one in the $x$ direction. We neglect by the surface tension due to large scale of the waves.  Therefore we don&amp;#039;t need any boundary condition on the air-water interface. Second, at $t&amp;gt;0$ we introduce continues density as $\rho=\phi$ to compute velocity field on every step. Third, we use stable fluid algorithm in time in the very specific order described below.&#xD;
&#xD;
&#xD;
Stable fluids algorithm&#xD;
-----------------------&#xD;
&#xD;
&#xD;
&#xD;
1) Solve advection equation with using boundary conditions, initial data from the previous step, and an implicit algorithm&#xD;
&#xD;
$$ \frac{\partial \mathbf{u}_1}{\partial t}+(\mathbf{u}_1.\nabla) \bf{u}_1=0 $$&#xD;
&#xD;
2) Solve diffusion equation with $\nu_i=\nu_i(\phi)$, initial data $\mathbf{u}_1$, boundary conditions  and with using, for example, Gauss-Seidel relaxation algorithm  &#xD;
&#xD;
$$ \frac{\partial \mathbf {u}_2}{\partial t}-\nu_i \nabla^2 \mathbf{u}_2=0$$&#xD;
&#xD;
here $$\nu_i(\phi)=\nu_w \phi ^k, k=-0.4029$$ for the air temperature of 20C.&#xD;
&#xD;
3)  Add force to the velocity field from the previous step as follows&#xD;
&#xD;
$$&#xD;
\mathbf{u}_3=\mathbf{u}_2+\mathbf{f} dt\\&#xD;
$$&#xD;
&#xD;
To simulate force acting on the volume of air-water mixture we used approximation &#xD;
$$ f_y=-\frac{(\rho_w-\phi)(\phi-\rho_w/2)(\phi-\rho_a)}{\rho_w^2(\rho_w-\rho_a)Fr^2}&#xD;
 $$&#xD;
4) Make projection step. Here we can use two models. First model is standard projection (Stam 1999)  by solving Poison equation&#xD;
$$ t&amp;gt;0, \nabla^2 q=\nabla . \bf{u}_3\\&#xD;
 \bf{u}_4=\bf{u}_3-\nabla q&#xD;
  $$&#xD;
Note, that this step  allows us to define divergent free velocity field. &#xD;
   &#xD;
5) Update velocity field $\bf{u}_4\longrightarrow \bf{u}_5$ with using boundary conditions.&#xD;
&#xD;
6) Make diffusion step with interface function by solving diffusion equation with initial condition from the previous step, with boundary conditions, and with $\nu=\nu_i(\phi)/Sc$ as follows  &#xD;
$$ \frac{\partial \phi_1}{\partial t}-\nu \nabla^2 \phi_1=0&#xD;
$$&#xD;
7) Make advection step by solving advection equation with initial data from step 6 with boundary conditions using  an implicit algorithm (from step 1, for example),  &#xD;
$$ \frac{\partial \phi_2}{\partial t}+(\bf{u}_5.\nabla) \phi_2=0&#xD;
 $$&#xD;
8) Update interface function with boundary conditions.&#xD;
&#xD;
9) Return to step 1 with updated velocity and interface function.&#xD;
&#xD;
This algorithm can be also used in some different order, for example, in the beginning we can compute step 3 (Stam1999). Also we can make steps 6-8 first, and then compute velocity field with steps 1-5. The question about stability of the stable fluids algorithm not really solved yet. From our experience, we can&amp;#039;t do arbitrary time step, but $dt$ is limiting by the grid size as usual for more precise computation. In our computations we have used $dt=2/N$ for $N\times N$ grid. In general case the numerical solution depends on the Froude number $Fr=\frac{U_0}{\sqrt{g L}}$, Reynolds number $Re=\frac{U_0 L}{\nu_w}$, Schmidt number and number of waves in the initial data. In our computations we fixed the Froude number, so that we can put $H=L=1$. We also fixed the Reynolds number, therefore we can put $U_0=1.5, V_0=0.5$. The algorithm 1-9 has been implemented with FDM  and compiled to C with using Mathematica 12.3.  &#xD;
&#xD;
Code to simulate air/water interface with $Re=10^4, Fr=1$&#xD;
----&#xD;
&#xD;
    rhoWater20C = 1.027; nuW20C = 0.01007; rhoAir20C = 0.001204; nuA20C = 0.151;dif = 1/10000; pec = .1; U0 = 1.5; V0 = .5; dn0 = 0.997658; dn1 = 0.514102; kap = 1; n = 81; Fr = 1; F0 = 1; n1 = n + 1; sm = 600; r = 20; den = &#xD;
     ConstantArray[dn1 (1 + dn0 Tanh[-kap Range[-n1/2, n1/2]]), n1];u0 = ConstantArray[0, {n1, n1}]; Do[&#xD;
      u0[[i, j]] = U0 (1 + Tanh[kap (j - n1/2)])/2;, {i, n1}, {j, n1}];&#xD;
     v0 = ConstantArray[0., {n1, n1}]; Do[&#xD;
      v0[[i, j]] = V0 Sin[10 Pi (i - 1)/n];, {i, n1}, {j, n1}];periodic[n_, up_, ud_, ub_] := &#xD;
        Module[{bd = ub}, Do[bd[[1, i]] = .5 (bd[[n, i]] + bd[[2, i]]);&#xD;
          bd[[n + 1, i]] = bd[[1, i]]; bd[[i, 1]] = ud;&#xD;
          bd[[i, n + 1]] = up;, {i, 2, n}];&#xD;
         bd[[1, 1]] = .5 (bd[[2, 1]] + bd[[1, 2]]);&#xD;
         bd[[n + 1, n + 1]] = .5 (bd[[n, n + 1]] + bd[[n + 1, n]]);&#xD;
         bd[[n + 1, 1]] = .5 (bd[[n, 1]] + bd[[n + 1, 2]]);&#xD;
         bd[[1, n + 1]] = .5 (bd[[1, n]] + bd[[2, n + 1]]); bd];&#xD;
      &#xD;
      diffuse[n_, r_, a_, c_, c0_] := &#xD;
        Module[{c1 = c}, &#xD;
         Do[Do[Do[&#xD;
             c1[[i, j]] = (c0[[i, &#xD;
                   j]] + (a/den[[i, j]]^.4029) (c1[[i - 1, j]] + &#xD;
                     c1[[i + 1, j]] + c1[[i, j - 1]] + &#xD;
                     c1[[i, j + 1]]))/(1 + 4 a/den[[i, j]]^.4029);, {j, 2, &#xD;
              n}];, {i, 2, n}];&#xD;
          Do[c1[[1, i]] = c1[[n, i]]; c1[[n + 1, i]] = c1[[2, i]];&#xD;
           c1[[i, 1]] = c0[[i, 1]];&#xD;
           c1[[i, n + 1]] = c0[[i, n + 1]];, {i, 2, n}];&#xD;
          c1[[1, 1]] = .5 (c1[[2, 1]] + c1[[1, 2]]);&#xD;
          c1[[n + 1, n + 1]] = .5 (c1[[n, n + 1]] + c1[[n + 1, n]]);&#xD;
          c1[[n + 1, 1]] = .5 (c1[[n, 1]] + c1[[n + 1, 2]]);&#xD;
          c1[[1, n + 1]] = .5 (c1[[1, n]] + c1[[2, n + 1]]);, {k, 0, r}];&#xD;
         c1];&#xD;
      &#xD;
      advect[n_, d0_, u_, v_, dt_] := &#xD;
        Module[{x, y, d1, dt0, i0, i1, j0, j1, s0, s1, t0, t1}, &#xD;
         d1 = ConstantArray[0, {n + 1, n + 1}]; dt0 = dt n;&#xD;
         Do[Do[x = i - dt0 u[[i, j]]; y = j - dt0 v[[i, j]];&#xD;
            i0 = Which[x &amp;lt;= 1, 1, 1 &amp;lt; x &amp;lt; n, Floor[x], True, n];&#xD;
            i1 = i0 + 1;&#xD;
            j0 = Which[y &amp;lt;= 1, 1, 1 &amp;lt; y &amp;lt; n, Floor[y], True, n];&#xD;
            j1 = j0 + 1; s1 = x - i0; s0 = 1 - s1; t1 = y - j0; t0 = 1 - t1;&#xD;
            d1[[i, j]] = &#xD;
             s0 (t0 d0[[i0, j0]] + t1 d0[[i0, j1]]) + &#xD;
              s1 (t0 d0[[i1, j0]] + t1 d0[[i1, j1]]);, {j, 1, n + 1}];, {i, &#xD;
           1, n + 1}]; d1];&#xD;
      &#xD;
      project[n_, r_, u0_, v0_, u_, v_] := &#xD;
        Module[{ux = u, vy = v, div, p}, &#xD;
         p = ConstantArray[0, {n + 1, n + 1}];&#xD;
         div = ConstantArray[0, {n + 1, n + 1}];&#xD;
         ux = ConstantArray[0, {n + 1, n + 1}];&#xD;
         vy = ConstantArray[0, {n + 1, n + 1}];&#xD;
         Do[div[[i, &#xD;
             j]] = -.5/&#xD;
              n (u0[[i + 1, j]] - u0[[i - 1, j]] + v0[[i, 1 + j]] - &#xD;
               v0[[i, j - 1]]);, {i, 2, n}, {j, 2, n}];&#xD;
         Do[Do[Do[&#xD;
             p[[i, j]] = (div[[i, &#xD;
                   j]] + (p[[i - 1, j]] + p[[i + 1, j]] + p[[i, j - 1]] + &#xD;
                    p[[i, j + 1]]))/4;, {j, 2, n}], {i, 2, n}];, {k, 0, r}];&#xD;
         Do[ux[[i, j]] = u0[[i, j]] - .5 n (p[[i + 1, j]] - p[[i - 1, j]]);&#xD;
          vy[[i, j]] = &#xD;
           v0[[i, j]] - .5 n (p[[i, j + 1]] - p[[i, j - 1]]);, {i, 2, &#xD;
           n}, {j, 2, n}]; {ux, vy}];&#xD;
      &#xD;
      Fx[t_, x_, y_] := 0;&#xD;
      Fy[t_, x_, y_] := -1/Fr^2;&#xD;
      &#xD;
      onestep[n_, step_, r_, a_, uin_, vin_, dt_, c_] := &#xD;
       Module[{u1, v1, f1, f2, u, v, u0, v0}, &#xD;
        f1 = ConstantArray[0, {n + 1, n + 1}];&#xD;
        f2 = ConstantArray[0., {n + 1, n + 1}];&#xD;
        u0 = ConstantArray[0., {n + 1, n + 1}];&#xD;
        v0 = ConstantArray[0., {n + 1, n + 1}];&#xD;
        u = ConstantArray[0., {n + 1, n + 1}];&#xD;
        v = ConstantArray[0., {n + 1, n + 1}];&#xD;
        u1 = ConstantArray[0., {n + 1, n + 1}];&#xD;
        v1 = ConstantArray[0., {n + 1, n + 1}]; u0 = uin; v0 = vin; Do[&#xD;
         f2[[i, j]] = &#xD;
           1/Fr^2 (den[[i, j]] - rhoWater20C/2) (rhoWater20C - &#xD;
              den[[i, j]]) (den[[i, j]] - rhoAir20C)/(rhoWater20C - &#xD;
                rhoAir20C)/rhoWater20C^2;, {i, 2, n}, {j, 2, n}];&#xD;
        v0 += f2 dt;&#xD;
        u0 = advect[n, u0, u0, v0, dt]; v0 = advect[n, v0, u0, v0, dt]; &#xD;
        mnV = 0;&#xD;
        u0 = periodic[n, U0, 0, u0]; v0 = periodic[n, mnV, mnV, v0];&#xD;
        u0 = diffuse[n, r, a, c, u0]; v0 = diffuse[n, r, a, c, v0];&#xD;
        u0 = periodic[n, U0, 0, u0]; v0 = periodic[n, mnV, mnV, v0];&#xD;
        {u1, v1} = project[n, r, u0, v0, u, v];&#xD;
        u0 = periodic[n, U0, 0, u1]; &#xD;
        v0 = periodic[n, mnV, mnV, v1]; {u0, v0}]&#xD;
      &#xD;
      cf = With[{cg = Compile`GetElement, hp = HoldPattern, &#xD;
          dv = DownValues}, &#xD;
         Hold@Compile[{{u0argu, _Real, 2}, {v0argu, _Real, &#xD;
                   2}, {denargu, _Real, &#xD;
                   2}, {sm, _Integer}, {n, _Integer}, {r, _Integer}, dif, &#xD;
                  pec, F0}, &#xD;
                 Module[{u0 = u0argu, v0 = v0argu, uu, vv, dd, &#xD;
                   den = denargu, c = Table[0., {n + 1}, {n + 1}], &#xD;
                   dt = 40./n^2, a, dnup = den[[1, n + 1]], &#xD;
                   dnd = den[[1, 1]]}, a = dt dif n n;&#xD;
                  uu = vv = dd = Table[0., {sm + 1}, {n + 1}, {n + 1}];&#xD;
                  Do[&#xD;
                   &#xD;
                   den = advect[n, den, u0, v0, dt];&#xD;
                   den = periodic[n, dnup, dnd, den]; &#xD;
                   den = diffuse[n, r, a/pec, c, den];&#xD;
                   den = periodic[n, dnup, dnd, den];&#xD;
                   &#xD;
                   dd[[step + 1]] = den; {u0, v0} = &#xD;
                    onestep[n, step, r, a, u0, v0, dt, c];&#xD;
                   uu[[step + 1]] = u0;&#xD;
                   vv[[step + 1]] = v0;, {step, 0, sm}]; {uu, vv, dd}], &#xD;
                 CompilationTarget -&amp;gt; C, RuntimeOptions -&amp;gt; &amp;#034;Speed&amp;#034;] /. &#xD;
               dv@onestep /. &#xD;
              Flatten[dv /@ {Fx, Fy, advect, diffuse, periodic, project}] /. &#xD;
             hp@ConstantArray[c_, {i_, j_}] :&amp;gt; Table[0., {i}, {j}] /. &#xD;
            hp@Part[a__] :&amp;gt; cg[a] /. hp[cg[a__] = rhs_] :&amp;gt; (Part[a] = rhs) //&#xD;
           ReleaseHold];&#xD;
&#xD;
Visualization&#xD;
-------------&#xD;
&#xD;
    rst = cf[u0, v0, den, sm, n, r, dif, pec, F0];Do[lstu[k] = &#xD;
       Flatten[Table[{{(i - 1)/n, (j - 1)/n}, rst[[1, k, i, j]]}, {i, &#xD;
          n1}, {j, n1}], 1]; &#xD;
      lstv[k] = &#xD;
       Flatten[Table[{{(i - 1)/n, (j - 1)/n}, rst[[2, k, i, j]]}, {i, &#xD;
          n1}, {j, n1}], 1];, {k, sm}];&#xD;
    Do[Uvel[i] = Interpolation[lstu[i], InterpolationOrder -&amp;gt; 3];, {i, 1, &#xD;
       sm}];&#xD;
    Do[Vvel[i] = Interpolation[lstv[i], InterpolationOrder -&amp;gt; 3];, {i, 1, &#xD;
      sm}]; Do[lst4[k] = &#xD;
       Flatten[Table[{{(i - 1)/n, (j - 1)/n}, rst[[3, k, i, j]]}, {i, &#xD;
          n1}, {j, n1}], 1];, {k, sm}];&#xD;
    Do[rh[k] = Interpolation[lst4[k], InterpolationOrder -&amp;gt; 3];, {k, sm}];{ContourPlot[Uvel[10][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 15, ContourStyle -&amp;gt; Yellow, PlotLegends -&amp;gt; Automatic], &#xD;
     ContourPlot[Vvel[10][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 15, ContourStyle -&amp;gt; Yellow, PlotLegends -&amp;gt; Automatic], &#xD;
     ContourPlot[1 - rh[10][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 15, ContourStyle -&amp;gt; Yellow, PlotLegends -&amp;gt; Automatic], &#xD;
     ContourPlot[Uvel[sm][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 15, ContourStyle -&amp;gt; Yellow, PlotLegends -&amp;gt; Automatic], &#xD;
     ContourPlot[Vvel[sm][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 15, ContourStyle -&amp;gt; Yellow, PlotLegends -&amp;gt; Automatic], &#xD;
     ContourPlot[1 - rh[sm][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 8, ContourStyle -&amp;gt; Yellow, PlotLegends -&amp;gt; Automatic]}&#xD;
In this Figure are shown velocity components $u_x$ (left), $u_y$ (middle) and 1- density (right) on step 10 (upper line) and on final step $sm=600$&#xD;
![Figure 2][4]  &#xD;
&#xD;
UPDATE&#xD;
----------&#xD;
&#xD;
Next step is to animate wave transformation using interface function. We can show velocity field over density as follows&#xD;
&#xD;
    Show[ContourPlot[1 - rh[sm][x, y]/rhoWater20C, {x, 0, 1}, {y, 0, 1}, &#xD;
      PlotRange -&amp;gt; All, ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Contours -&amp;gt; 8,&#xD;
       ContourStyle -&amp;gt; Yellow, Frame -&amp;gt; False, PlotLegends -&amp;gt; Automatic], &#xD;
     StreamPlot[{Uvel[sm][x, y], Vvel[sm][x, y]}, {x, 0, 1}, {y, 0, 1}, &#xD;
      PlotRange -&amp;gt; All, StreamColorFunction -&amp;gt; None, VectorPoints -&amp;gt; Fine,&#xD;
       VectorColorFunction -&amp;gt; Hue, PlotLegends -&amp;gt; Automatic, &#xD;
      StreamColorFunctionScaling -&amp;gt; True, StreamStyle -&amp;gt; LightGray]]&#xD;
![Figure 3][5]&#xD;
&#xD;
We can also compute frames for animation with using interface function  &#xD;
&#xD;
    frames=Table[ContourPlot[1 - rh[i][x, y], {x, 0, 1}, {y, 0, 1}, &#xD;
      ColorFunction -&amp;gt; &amp;#034;BlueGreenYellow&amp;#034;, Frame -&amp;gt; False, &#xD;
      PlotRange -&amp;gt; All, ImageSize -&amp;gt; Small, MaxRecursion -&amp;gt; 2, &#xD;
      Contours -&amp;gt; 8, ContourStyle -&amp;gt; Yellow, PlotLabel -&amp;gt; i], {i, 20, sm, &#xD;
      20}]; Animate[frames]&#xD;
![Figure 4][6]&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
References&#xD;
----------&#xD;
Jos Stam. Stable fluids. In Computer Graphics Proceedings Annual Conference Series, Los Angeles, Aug. 3&amp;#x2013;8, 199.&#xD;
&#xD;
Jos Stam. Interacting with smoke and fire in real time. Communications&#xD;
of the ACM, 43(7):77&amp;#x2013;83, July 2000.&#xD;
      &#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=RogueWave.gif&amp;amp;userId=11733&#xD;
  [2]: https://www.researchgate.net/publication/354527324_A_Navier-Stokes_model_for_Rogue_wave_simulation&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Figure1.jpg&amp;amp;userId=1218692&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Figure2.jpg&amp;amp;userId=1218692&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Figure3.jpg&amp;amp;userId=1218692&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Fr3v3.AW1300Q5.gif&amp;amp;userId=1218692</description>
    <dc:creator>Alexander Trounev</dc:creator>
    <dc:date>2021-11-03T06:49:53Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2394545">
    <title>How can i get the poles of a DiscreteTransferFunction with delay?</title>
    <link>https://community.wolfram.com/groups/-/m/t/2394545</link>
    <description>Hi everyone, help me please, I have a problem with this TransferFunctionModel, When I want to obtain the poles from the Discrete Model Wolfram gives me an error, what am I doing wrong? Could it be the delay of the model?&#xD;
![enter image description here][1]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=tf_1.png&amp;amp;userId=2304918</description>
    <dc:creator>Jairo Smith Quilumbaquin Lanchimba</dc:creator>
    <dc:date>2021-10-28T01:42:19Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2368402">
    <title>Modeling a cart-pole system in Wolfram SystemModeler</title>
    <link>https://community.wolfram.com/groups/-/m/t/2368402</link>
    <description>&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/cc535bd8-c504-4d33-8147-41e164c8c6ae</description>
    <dc:creator>Alec Graves</dc:creator>
    <dc:date>2021-09-17T02:02:25Z</dc:date>
  </item>
</rdf:RDF>

