<?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 Chemistry sorted by most likes.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2411604" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/131302" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/787142" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2026904" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1551098" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1190717" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2546972" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2927764" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1799757" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2305648" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3191339" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/981261" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2115501" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2429832" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/828033" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3242770" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2731070" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2068787" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1835986" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1052348" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2411604">
    <title>[WSG21] Daily Study Group: Differential Equations (begins November 29)</title>
    <link>https://community.wolfram.com/groups/-/m/t/2411604</link>
    <description>A new study group devoted to Differential Equations begins next Monday! A list of daily topics can be found on our [Daily Study Groups][1] page. This group will be led by one of our outstanding Wolfram certified instructors, Luke Titus, and will meet daily, Monday to Friday, over the next three weeks. Luke will share the excellent lesson videos created by him for the upcoming Wolfram U course &amp;#034;[Introduction to Differential Equations][2]&amp;#034;. Study group sessions include time for exercises, discussion and Q&amp;amp;A. This study group will help you achieve the &amp;#034;Course Completion&amp;#034; certificate for the &amp;#034;Introduction to Differential Equations&amp;#034; course after you complete the course quizzes.&#xD;
&#xD;
Sign up: [Study group registration page][3]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolfram.com/wolfram-u/special-event/study-groups/&#xD;
  [2]: https://www.wolfram.com/wolfram-u/introduction-to-differential-equations/&#xD;
  [3]: https://www.bigmarker.com/series/daily-study-group-intro-to-differential-equations/series_details?utm_bmcr_source=community</description>
    <dc:creator>Devendra Kapadia</dc:creator>
    <dc:date>2021-11-22T16:35:30Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/131302">
    <title>Plotting electronic orbitals with Wolfram Language</title>
    <link>https://community.wolfram.com/groups/-/m/t/131302</link>
    <description>I am reposting this here from the [url=http://mathematica.blogoverflow.com/]Stackexchange Mathematica blog[/url] so that more people might see it.  I&amp;#039;d be very happy to get some feedback on this plotting function.  If anyone can use the function, let me know how it works out for you, and if you&amp;#039;d recommend any changes.  If so, I can edit this post to have to most up-to-date version.&#xD;
&#xD;
As a chemist it is often useful to plot electronic orbitals.  These are used to describe the wave function of electrons in atoms or molecules.  Typically, these are output from electronic structure software in the form of a cube file, first developed by Gaussian.  These files contain volumetric data for a given orbital on a three-dimensional grid.&#xD;
&#xD;
&#xD;
There exist many applications to visualize cube files, such as [url=http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/cubeplugin.html]VMD [/url]or [url=http://www.gaussian.com/g_tech/gv5ref/results.htm]GaussView[/url], but I wanted to take advantage of Mathematicas  capability to easily combine graphics, as well as the ability to automate the process in order to efficiently create frames for a [url=http://www.pnas.org/content/suppl/2013/09/05/1308604110.DCSupplemental/sm01.mp4]movie[/url].&#xD;
&#xD;
First off, we need a function to extract the data from the cube file. In the process, we will create the text for an XYZ file, a format also developed by Gaussian. The function [b]OutForm[/b] is used here to mimic the printf function found in other programming languages.&#xD;
&#xD;
[mcode]OutForm[num_?NumericQ, width_Integer, ndig_Integer, &#xD;
   OptionsPattern[]] :=&#xD;
  Module[{mant, exp, val},&#xD;
   {mant, exp} = MantissaExponent[num];&#xD;
   mant = ToString[NumberForm[mant, {ndig, ndig}]];&#xD;
   exp = If[Sign[exp] == -1, &amp;#034;-&amp;#034;, &amp;#034;+&amp;#034;] &amp;lt;&amp;gt; IntegerString[exp, 10, 2];&#xD;
   val = mant &amp;lt;&amp;gt; &amp;#034;E&amp;#034; &amp;lt;&amp;gt; exp;&#xD;
   StringJoin@PadLeft[Characters[val], width, &amp;#034; &amp;#034;]&#xD;
   ];&#xD;
&#xD;
ReadCube[cubeFileName_?StringQ] := Module[&#xD;
   {moltxt, nAtoms, lowerCorner, nx, ny, nz, xstep, ystep, zstep, &#xD;
    atoms, desc1, desc2, xyzText, cubeDat, xgrid, ygrid, zgrid, &#xD;
    dummy1, dummy2, atomicNumber, atomx, atomy, atomz, tmpString, &#xD;
    headerTxt,bohr2angstrom},&#xD;
   bohr2angstrom = 0.529177249;&#xD;
   moltxt = OpenRead[cubeFileName];&#xD;
   desc1 = Read[moltxt, String];&#xD;
   desc2 = Read[moltxt, String];&#xD;
   lowerCorner = {0, 0, 0}; &#xD;
   {nAtoms, lowerCorner[[1]], lowerCorner[[2]], lowerCorner[[3]]} = &#xD;
    Read[moltxt, String] // ImportString[#, &amp;#034;Table&amp;#034;][[1]] &amp;amp;;&#xD;
   xyzText = ToString[nAtoms] &amp;lt;&amp;gt; &amp;#034;\n&amp;#034;;&#xD;
   xyzText = xyzText &amp;lt;&amp;gt; desc1 &amp;lt;&amp;gt; desc2 &amp;lt;&amp;gt; &amp;#034;\n&amp;#034;;&#xD;
   {nx, xstep, dummy1, dummy2} = &#xD;
    Read[moltxt, String] // ImportString[#, &amp;#034;Table&amp;#034;][[1]] &amp;amp;;&#xD;
   {ny, dummy1, ystep, dummy2} = &#xD;
    Read[moltxt, String] // ImportString[#, &amp;#034;Table&amp;#034;][[1]] &amp;amp;;&#xD;
   {nz, dummy1, dummy2, zstep} = &#xD;
    Read[moltxt, String] // ImportString[#, &amp;#034;Table&amp;#034;][[1]] &amp;amp;;&#xD;
   Do[&#xD;
    {atomicNumber, dummy1, atomx, atomy, atomz} = &#xD;
     Read[moltxt, String] // ImportString[#, &amp;#034;Table&amp;#034;][[1]] &amp;amp;;&#xD;
    xyzText = If[Sign[lowerCorner[[1]]] == 1,&#xD;
      xyzText &amp;lt;&amp;gt; ElementData[atomicNumber, &amp;#034;Abbreviation&amp;#034;] &amp;lt;&amp;gt; &#xD;
       OutForm[atomx, 17, 7] &amp;lt;&amp;gt; OutForm[atomy, 17, 7] &amp;lt;&amp;gt; &#xD;
       OutForm[atomz, 17, 7] &amp;lt;&amp;gt; &amp;#034;\n&amp;#034;,&#xD;
      xyzText &amp;lt;&amp;gt; ElementData[atomicNumber, &amp;#034;Abbreviation&amp;#034;] &amp;lt;&amp;gt; &#xD;
       OutForm[bohr2angstrom atomx, 17, 7] &amp;lt;&amp;gt; &#xD;
       OutForm[bohr2angstrom atomy, 17, 7] &amp;lt;&amp;gt; &#xD;
       OutForm[bohr2angstrom atomz, 17, 7] &amp;lt;&amp;gt; &amp;#034;\n&amp;#034;];&#xD;
    , {nAtoms}];&#xD;
   cubeDat = &#xD;
    Partition[Partition[ReadList[moltxt, Number, nx ny nz], nz], ny];&#xD;
   Close[moltxt];&#xD;
   moltxt = OpenRead[cubeFileName];&#xD;
   headerTxt = Read[moltxt, Table[String, {2 + 4 + nAtoms}]];&#xD;
   Close[moltxt];&#xD;
   headerTxt = StringJoin@Riffle[headerTxt, &amp;#034;\n&amp;#034;];&#xD;
   xgrid = &#xD;
    Range[lowerCorner[[1]], lowerCorner[[1]] + xstep (nx - 1), xstep];&#xD;
   ygrid = &#xD;
    Range[lowerCorner[[2]], lowerCorner[[2]] + ystep (ny - 1), ystep];&#xD;
   zgrid = &#xD;
    Range[lowerCorner[[3]], lowerCorner[[3]] + zstep (nz - 1), zstep];&#xD;
   {cubeDat, xgrid, ygrid, zgrid, xyzText, headerTxt}&#xD;
   ];[/mcode]&#xD;
If you need to create a cube file, then the following function can be used:&#xD;
[mcode]WriteCube[cubeFileName_?StringQ, headerTxt_?StringQ, cubeData_] := &#xD;
 Module[{stream}, &#xD;
  stream = OpenWrite[cubeFileName, FormatType -&amp;gt; FortranForm];&#xD;
  WriteString[stream, headerTxt, &amp;#034;\n&amp;#034;];&#xD;
  Map[WriteString[stream, ##, &amp;#034;\n&amp;#034;] &amp;amp; @@ &#xD;
     Riffle[ScientificForm[#, {3, 4}, &#xD;
         NumberFormat -&amp;gt; (Row[{#1, &amp;#034;E&amp;#034;, If[#3 == &amp;#034;&amp;#034;, &amp;#034;+00&amp;#034;, #3], &#xD;
              &amp;#034;\t&amp;#034;}] &amp;amp;), NumberPadding -&amp;gt; {&amp;#034;&amp;#034;, &amp;#034;0&amp;#034;}, &#xD;
         NumberSigns -&amp;gt; {&amp;#034;-&amp;#034;, &amp;#034; &amp;#034;}] &amp;amp; /@ #, &amp;#034;\n&amp;#034;, {7, -1, 7}] &amp;amp;, &#xD;
   cubeData, {2}];&#xD;
  Close[stream];][/mcode]Next we need the function to plot the orbital,&#xD;
[mcode]CubePlot[{cub_, xg_, yg_, zg_, xyz_}, plotopts : OptionsPattern[]] := &#xD;
   Module[{xyzplot, bohr2picometer, datarange3D, pr},&#xD;
    bohr2picometer = 52.9177249;&#xD;
    datarange3D = &#xD;
      bohr2picometer {{xg[[1]], xg[[-1]]}, {yg[[1]], &#xD;
         yg[[-1]]}, {zg[[1]], zg[[-1]]}};&#xD;
    xyzplot = ImportString[xyz, &amp;#034;XYZ&amp;#034;];&#xD;
    Show[xyzplot, &#xD;
     ListContourPlot3D[Transpose[cub, {3, 2, 1}], &#xD;
       Evaluate[FilterRules[{plotopts}, Options[ListContourPlot3D]]], &#xD;
       Contours -&amp;gt; {-.02, .02}, ContourStyle -&amp;gt; {Blue, Red}, &#xD;
       DataRange -&amp;gt; datarange3D, MeshStyle -&amp;gt; Gray, &#xD;
       Lighting -&amp;gt; {{&amp;#034;Ambient&amp;#034;, White}}], &#xD;
       Evaluate[&#xD;
        FilterRules[{plotopts}, {ViewPoint, ViewVertical, ImageSize}]]]&#xD;
    ];    [/mcode]Lets look at an example.  First we need to read in a cube file, download this cube file and place it in your base directory:  [url=https://dl.dropboxusercontent.com/s/rdsxcnqudn1s76n/cys-MO35.cube]cys-MO35cube[/url]&#xD;
[mcode]{cubedata,xg,yg,zg,xyz,header}= ReadCube[&amp;#034;cys-MO35.cube&amp;#034;];[/mcode]Then plot it via[mcode]CubePlot[{cubedata, xg, yg, zg, xyz}][/mcode][img=width: 300px; height: 291px;]http://mathematica.blogoverflow.com/files/2013/09/pizCq-300x291.jpg[/img]&#xD;
When I want to create a movie file, I want all the images to have exactly the same [b]ViewAngle[/b], [b]ViewPoint[/b], and [b]ViewCenter[/b].  When you give these options to [b]CubePlot[/b], it feeds them directly to the [b]Show[/b] function&#xD;
[mcode]vp = {ViewCenter -&amp;gt; {0.5, 0.5, 0.5}, &#xD;
   ViewPoint -&amp;gt; {1.072, 0.665, -3.13}, &#xD;
   ViewVertical -&amp;gt; {0.443, 0.2477, 1.527}};&#xD;
&#xD;
&#xD;
CubePlot[{cubedata, xg, yg, zg, xyz}, vp][/mcode][img=width: 280px; height: 300px;]http://mathematica.blogoverflow.com/files/2013/09/Q1mjs-280x300.jpg[/img]&#xD;
Finally, you can also give any options that normally go to [b]ListContourPlot3D[/b][mcode]CubePlot[{cubedata, xg, yg, zg, xyz}, vp, &#xD;
 ContourStyle -&amp;gt; {Texture[ExampleData[{&amp;#034;ColorTexture&amp;#034;, &amp;#034;Vavona&amp;#034;}]], &#xD;
   Texture[ExampleData[{&amp;#034;ColorTexture&amp;#034;, &amp;#034;Amboyna&amp;#034;}]]}, &#xD;
 Contours -&amp;gt; {-.015, .015}][/mcode][img=width: 288px; height: 300px;]http://mathematica.blogoverflow.com/files/2013/09/fLyJ7-288x300.jpg[/img]&#xD;
&#xD;
Many thanks to Daniel Healion for the [b]ReadCube[/b] and [b]WriteCube[/b] functions.</description>
    <dc:creator>Jason Biggs</dc:creator>
    <dc:date>2013-09-27T18:35:45Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/787142">
    <title>Crystallica: A package to plot crystal structures</title>
    <link>https://community.wolfram.com/groups/-/m/t/787142</link>
    <description>## General information and download links ##&#xD;
&#xD;
If you&amp;#039;re interested in crystal structures, you can now download the Crystallica application from the Wolfram Library Archive, and then you can do things like this:&#xD;
&#xD;
    Needs[&amp;#034;Crystallica`&amp;#034;];&#xD;
    CrystalPlot[&#xD;
    {{5.4,0,0},{0,5.4,0},{0,0,5.4}},&#xD;
    {{0,0,0},{0,0,.5},{0,.5,0},{.5,0,0},{.24,.24,.24},{.24,.76,.76},{.76,.24,.76},{.76,.76,.24}},&#xD;
    {1,2,2,2,3,3,3,3},&#xD;
    AtomCol-&amp;gt;{&amp;#034;Firebrick&amp;#034;,&amp;#034;YellowGreen&amp;#034;,White},AtomRad-&amp;gt;.4,&#xD;
    BondStyle-&amp;gt;2,BondDist-&amp;gt;3,&#xD;
    CellLineStyle-&amp;gt;False,AddQ-&amp;gt;True,Lighting-&amp;gt;{{&amp;#034;Directional&amp;#034;,White,ImageScaled[{0,0,1}]}},Background-&amp;gt;Black]&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
Here are the download links for Crystallica and two other packages you may need:&#xD;
&#xD;
[Crystallica][2] - contains the functions `CrystalPlot` and `CrystalChange`&#xD;
&#xD;
[CifImport][3] - contains an import function for CIF files&#xD;
&#xD;
[VaspImport][4] - contains an import function for files related to [VASP][5]&#xD;
&#xD;
Once you&amp;#039;ve installed Crystallica (by saving the entire Crystallica folder - not the zip archive - to `$USerBaseDirectory/Applications` and re-starting the Kernel), you can enter Crystallica into the Documentation Center and you&amp;#039;ll find lots of useful examples. Most of the examples in this post are taken from the Documentation. For the other two packages, just install them and evaluate this:&#xD;
&#xD;
    ?CifImport&#xD;
    ?VaspImport&#xD;
&#xD;
I&amp;#039;ll first show you a few things the `CrystalPlot` function can do when you already have crystal structure data inside Mathematica, wherever it may have come from. Then we&amp;#039;ll take a look at how to get the data into Mathematica in the first place, which is where `CifImport` and `VaspImport` will come into play - but we&amp;#039;ll get data from other sources as well. I&amp;#039;ll cover the different import solutions in separate replies to this thread, because I have a feeling that I&amp;#039;ll be rambling on and on and on...&#xD;
&#xD;
## Simple plot ##&#xD;
&#xD;
Traditional ball-and-stick plots are usually just fine, so the simplest thing you can do is this:&#xD;
&#xD;
    CrystalPlot[&#xD;
    {{4.5,0,0},{0,4.5,0},{0,0,3}},&#xD;
    {{0,0,0},{.5,.5,.5},{.2,.8,.5},{.3,.3,0},{.7,.7,0},{.8,.2,.5}},&#xD;
    {1,1,2,2,2,2}]&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
As you can see, `CrystalPlot` expects three arguments. The first one contains the lattice vectors, which are simply the three vectors that create the parallelepiped that constitutes the cell. The second argument contains the atomic coordinates, but they&amp;#039;re given in the basis of the lattice vectors (which is quite useful in crystallography). The third argument is a list of integers that gives the atom types, with one entry for each atom. If you want to plot a molecule instead, you can call `CrystalPlot` with just two arguments: A list of atom coordinates in cartesian space, and a list of atom types. Everything else you see in the plot - the atoms, bonds, colours, arrows etc. - represents the default settings of various layout options.&#xD;
&#xD;
## Advanced atoms and bonds ##&#xD;
&#xD;
Let&amp;#039;s take a look at some more advanced options just for fun. For instance, atoms and bonds can look any way you need them to, because you can specify your own functions for them. You can also fine-tune where to put bonds and what to do with their thickness and colour in a physically (or chemically) meaningful way, but I won&amp;#039;t show that here. So here are some customized atoms and bonds:&#xD;
&#xD;
    Row[Table[&#xD;
    CrystalPlot[{{4,0,0},{0,4,0},{0,0,4}},{{0,0,0},{.4,.4,.4},{.8,.8,.8}},{1,2,3},&#xD;
    AtomRad-&amp;gt;{.4,1.2,.7},AtomFunction-&amp;gt;style,ImageSize-&amp;gt;400],&#xD;
    {style,{&#xD;
    (Ball[#1,#2]&amp;amp;),&#xD;
    (Scale[Sphere[#1,#2],{1,1,.5}]&amp;amp;),&#xD;
    ({EdgeForm[Thick],Opacity[.7],Cuboid[#1-.5*#2,#1+.5*#2]}&amp;amp;)&#xD;
    }}]]&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
    Row[Table[&#xD;
    CrystalPlot[{{0,0,0},{5,0,0},{2.5,4,0}},{1,2,3},BondDist-&amp;gt;6,BondStyle-&amp;gt;style,ImageSize-&amp;gt;400],&#xD;
    {style,{&#xD;
    1,&#xD;
    Function[{bonds,partcol},Table[{If[ii&amp;lt;.5,partcol[#,1],partcol[#,2]],Sphere[bonds[[#,1]]+ii*(bonds[[#,2]]-bonds[[#,1]]),.15]},{ii,0,1,1/9}]&amp;amp;/@Range[Length[bonds]]],&#xD;
    Function[{bonds,partcol},Module[{spiral,points,rad=.05},&#xD;
    spiral[atoms_]:=Module[{scale=.5,dist=atoms[[2]]-atoms[[1]],curls=60,normal,rot,scaled},&#xD;
    normal=Table[{scale*Cos[ii],scale*Sin[ii],.1*ii},{ii,0,curls,\[Pi]/10}];&#xD;
    scaled={#[[1]],#[[2]],10*Norm[dist]/curls*#[[3]]}&amp;amp;/@normal;&#xD;
    rot=scaled.Quiet[RotationMatrix[{dist,{0,0,1}}]];&#xD;
    Join[{atoms[[1]]},#+atoms[[1]]&amp;amp;/@(rot[[25;;-25]]),{atoms[[2]]}]];&#xD;
    points=spiral/@bonds;&#xD;
    {partcol[#,1],Tube[BSplineCurve[points[[#,;;Round[Length[points[[#]]]/2]]],rad]],partcol[#,2],Tube[BSplineCurve[points[[#,Round[Length[points[[#]]]/2];;]],rad]]}&amp;amp;/@Range[Length[bonds]]&#xD;
    ]]&#xD;
    }}]]&#xD;
&#xD;
![enter image description here][8]&#xD;
&#xD;
## Lattice planes ##&#xD;
&#xD;
Crystallica can also add lattice planes to the plot. You can specify them using [h,k,l] Miller indices and distance to the origin.&#xD;
&#xD;
    CrystalPlot[{{3,0,0},{0,3,0},{0,0,3}},{{0,0,0}},{1},&#xD;
    AddQ-&amp;gt;True,AtomRad-&amp;gt;.3,AtomCol-&amp;gt;&amp;#034;CadmiumYellow&amp;#034;,Sysdim-&amp;gt;2,CellLineStyle-&amp;gt;2,&#xD;
    LatticePlanes-&amp;gt;Table[{{1,1,1},dist},{dist,1,5}],ContourStyle-&amp;gt;{&amp;#034;TerreVerte&amp;#034;,Opacity[.7]},BoundaryStyle-&amp;gt;Thick]&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
## Coordination polyhedra ##&#xD;
&#xD;
You can automatically search for and plot coordination polyhedra. This is not limited to the commonly occurring tetrahedra and octahedra - you can actually look for polyhedra with arbitrary numbers of corners. There are also options to fine-tune both the searching and the rendering.&#xD;
&#xD;
    plot[corners_,mixed_]:=CrystalPlot[{{0,0,0},{0,0,1.8},{-.9,-1.5,-.6},{-.9,1.5,-.6},{1.7,0,-.6},{.8,.8,.8}},{1,2,2,2,2,3},&#xD;
    BondStyle-&amp;gt;False,ImageSize-&amp;gt;250,&#xD;
    PolyMode[corners]-&amp;gt;{&amp;#034;Show&amp;#034;-&amp;gt;All,&amp;#034;AllowMixed&amp;#034;-&amp;gt;mixed},PolyStyle[corners]-&amp;gt;Directive[Opacity[.5],EdgeForm[Thick]]];&#xD;
    Grid[{{&#xD;
    &amp;#034;&amp;#034;,&#xD;
    &amp;#034;Search for polyhedra with \n4 corners&amp;#034;,&#xD;
    &amp;#034;Search for polyhedra with \n5 corners&amp;#034;&#xD;
    },{&#xD;
    &amp;#034;Allow \nmixed corners&amp;#034;,&#xD;
    plot[4,True],&#xD;
    plot[5,True]&#xD;
    },{&#xD;
    &amp;#034;Don&amp;#039;t allow \nmixed corners&amp;#034;,&#xD;
    plot[4,False],&#xD;
    plot[5,False]&#xD;
    }},Dividers-&amp;gt;All]&#xD;
&#xD;
![enter image description here][10]&#xD;
&#xD;
    CrystalPlot[{{2.5,-4.3,0},{2.5,4.3,0},{0,0,5.5}},&#xD;
    {{.5,0,0},{0,.5,.7},{.5,.5,.3},{.2,.4,.5},{.6,.8,.2},{.2,.8,.8},{.8,.6,.5},{.4,.2,.2},{.8,.2,.8}},{1,1,1,2,2,2,2,2,2},&#xD;
    PolyMode[4]-&amp;gt;True,PolyStyle[4]-&amp;gt;EdgeForm[None],AddQ-&amp;gt;True,&#xD;
    Sysdim-&amp;gt;2,AtomRad-&amp;gt;0,CellLineStyle-&amp;gt;False,AtomCol-&amp;gt;{&amp;#034;SlateGray&amp;#034;,&amp;#034;Firebrick&amp;#034;},&#xD;
    ViewAngle-&amp;gt;.4,ViewPoint-&amp;gt;{3.2,0,1.1},ViewVertical-&amp;gt;{.5,0,1.2}]&#xD;
&#xD;
![enter image description here][11]&#xD;
&#xD;
## Other things ##&#xD;
&#xD;
Visualization aside, you can also build supercells, change cell shapes, or add, remove and sort atoms... but that&amp;#039;s a bit boring to read, so I&amp;#039;ll refer you to the Documentation page of the `CrystalChange` function instead.&#xD;
&#xD;
If you&amp;#039;re interested, we can use this thread to talk about any questions you may have, or you can share your use of the package (if you decide to use it). I&amp;#039;m not offering full support here, but I&amp;#039;ll be floating around, and I&amp;#039;d like to hear your feedback. We don&amp;#039;t have any intentions to be involved in further development. But if you have a good idea and some time, then by all means, work on it for yourself, or host it on your favourite code collaboration site.&#xD;
&#xD;
Bianca Eifert and Christian Heiliger&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=teaser.png&amp;amp;userId=69107&#xD;
  [2]: http://library.wolfram.com/infocenter/MathSource/9372/&#xD;
  [3]: http://library.wolfram.com/infocenter/MathSource/9373/&#xD;
  [4]: http://library.wolfram.com/infocenter/MathSource/9375/&#xD;
  [5]: http://vasp.at/&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=9692simple.png&amp;amp;userId=69107&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=atoms.png&amp;amp;userId=69107&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=bonds.png&amp;amp;userId=69107&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=planes.png&amp;amp;userId=69107&#xD;
  [10]: http://community.wolfram.com//c/portal/getImageAttachment?filename=polys.png&amp;amp;userId=69107&#xD;
  [11]: http://community.wolfram.com//c/portal/getImageAttachment?filename=polys2.png&amp;amp;userId=69107&#xD;
  [12]: http://rruff.geo.arizona.edu/AMS/CIF_text_files/13532_cif.txt&#xD;
  [13]: http://cms.mpi.univie.ac.at/vasp/vasp/POSCAR_file.html&#xD;
  [14]: http://wiki.jmol.org/index.php/File:Caffeine.mol</description>
    <dc:creator>Bianca Eifert</dc:creator>
    <dc:date>2016-02-05T18:43:18Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2026904">
    <title>[WSS20]Design &amp;amp; Implementation of Data Structure of Crystalline Atomic Data</title>
    <link>https://community.wolfram.com/groups/-/m/t/2026904</link>
    <description>![frontimage][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=imagefront.jpg&amp;amp;userId=1316061&#xD;
  [2]: https://www.wolframcloud.com/obj/88bd85e6-8a15-4fe1-ab85-7da71b0ce10b</description>
    <dc:creator>Claudio Chaib</dc:creator>
    <dc:date>2020-07-14T02:04:22Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1551098">
    <title>Modeling jump conditions in interphase mass transfer</title>
    <link>https://community.wolfram.com/groups/-/m/t/1551098</link>
    <description>***NOTE: Download Full Article as a Notebook from the Attachment Below***&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
Interphase mass transfer operations such as gas absorption or liquid-liquid extraction pose a modeling challenge because the molar species concentration can jump between 2 states at the interface as shown below (from [here][2]).&#xD;
![enter image description here][3]&#xD;
I wanted to see if I could create a Finite Element Method (FEM) model of jump conditions in the Wolfram Language. I found the results to be reasonable, aesthetically pleasing, and somewhat mesmerizing. The remainder of this post documents my workflow for those that might be interested.  I have attached a notebook to reproduce the results.&#xD;
## Preamble on analytical solutions to PDE&amp;#039;s&#xD;
&#xD;
There seems to be quite a few posts where people are trying to find the analytical solution to a system of PDE&amp;#039;s. Generally, closed formed analytical solutions only exist in rare-highly symmetric cases.  Let us consider the heat equation below.&#xD;
&#xD;
$$\frac{\partial T}{\partial t}=\alpha \frac{\partial^2 T}{\partial x^2}$$&#xD;
&#xD;
For the case of a semi-infinite bar subjected to a unit step change in temperature at $x=0$, Mathematica&amp;#039;s DSolve\[\] handles this readily.&#xD;
&#xD;
    u[x, t] /. &#xD;
     First@DSolve[{ D[u[x, t], t] == alpha D[u[x, t], {x, 2}], &#xD;
        u[x, 0] == 0, u[0, t] == UnitStep[t]}, u[x, t], {x, t}, &#xD;
       Assumptions -&amp;gt; alpha &amp;gt; 0 &amp;amp;&amp;amp; 0 &amp;lt; x]&#xD;
    (*Erfc[x/(2*Sqrt[alpha]*Sqrt[t])]*)&#xD;
&#xD;
So far so good. Now, let us break symmetry by making it a finite bar of length $l$ (See [Documentation][4]).&#xD;
&#xD;
    heqn = D[u[x, t], t] == alpha D[u[x, t], {x, 2}];&#xD;
    bc = {u[0, t] == 1, u[l, t] == 0};&#xD;
    ic = u[x, 0] == 0;&#xD;
    sol = DSolve[{heqn, bc, ic}, u[x, t], {x, t}]&#xD;
    (*{{u[x, t] -&amp;gt; 1 - x/l - (2*Inactive[Sum][Sin[(Pi*x*K[1])/l]/(E^((alpha*Pi^2*t*K[1]^2)/l^2)*&#xD;
             K[1]), {K[1], 1, Infinity}])/Pi}}*)&#xD;
&#xD;
This little change going from a semi-infinite to finite domain has turned the solution into an unwieldy infinite sum. We should expect that it will only go down hill from here if we add additional complexity to the equation or system of equations. My advice is to abandon the search for an analytical solution quickly because it will likely take great effort and will be unlikely to yield a result. Instead, focus efforts on more productive avenues such as dimensional analysis and numerical solutions.&#xD;
&#xD;
# Introduction&#xD;
&#xD;
&amp;gt;&amp;#034;All models are wrong, some are useful.&amp;#034; -- George E. P. Box&#xD;
&amp;gt;&amp;#034;However, many systems are highly complex, so that valid&#xD;
mathematical models of them are themselves complex, precluding any&#xD;
possibility of an analytical solution. In this case, the model must be studied&#xD;
by means of simulation, i.e. , numerically exercising the model for the inputs&#xD;
in question to see how they affect the output measures of performance.&amp;#034; -- Dr. Averill Law, Simulation Modeling and Analysis&#xD;
&#xD;
I find the quotes above help me overcome inertia when starting a modeling and simulation project.  Create your wrong model.  Calibrate how wrong it is versus a known standard. If it is not too bad, put the model through its paces.&#xD;
&#xD;
One thing that I appreciate about the Wolfram Language is that I can document a modeling workflow development process from beginning to end in a single notebook.  The typical model workflow development process includes:&#xD;
&#xD;
* A sketch of the system of interest.&#xD;
* Equations.&#xD;
    * Initial development.&#xD;
    * Simplification.&#xD;
    * Non-dimensionalization for better scaling and reducing parameter space.&#xD;
* Mathematica implementation.&#xD;
    * Mesh&#xD;
        * Boundaries&#xD;
        * Refinement&#xD;
    * NDSolve set-up&#xD;
    * Post-process results&#xD;
* Verification/Validation&#xD;
&#xD;
Mathematica notebooks tend to age well. I routinely resurrect notebooks that are over a decade old and they generally still work. &#xD;
&#xD;
## Absorption&#xD;
I did a quick Google search on absorption and came across this figure describing gas absorption in an open access article by [Danish _et al_][5].&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
This image looked very similar to an image that I produced in a [related post](http://community.wolfram.com/groups/-/m/t/1470252) to the Wolfram community regarding porous media energy transport.&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
The systems look so similar, that we ought to be able to reuse much of the modeling. An area of concern would be for gas absorption where the ratio of the gas diffusion coefficient to liquid diffusion coefficient can exceed 4 orders of magnitude.  Such differences often can cause instability in numerical approaches.&#xD;
# Modeling&#xD;
## System description&#xD;
For clarity, I always like to begin with a system description. Typically, absorption processes utilize gravity to create a thin liquid film to contact the gas. To reuse the modeling that we did for porous media, we will assume that gravity is in the positive $x$ direction leading us to the image below.&#xD;
&#xD;
![enter image description here][8]&#xD;
&#xD;
We will assume that the liquid film is a uniform thickness and is laminar (note that for gas liquid contact the liquid velocity is fastest at the interface leading to the parabolic profile shown).  We will assume that the gas has a uniform velocity. Further, we will assume that the incoming concentrations of the absorbing species are zero and we will impose a concentration of $C=C_0$ at the lower boundary.&#xD;
&#xD;
The basic dimensions of the box are shown below. For simplicity, we will make the height and length unit dimensions and set $R$ to be $\frac{1}{2}$.&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
## Balance equations&#xD;
### Dilute species balance&#xD;
For the purposes of this exercise, we will consider the system to be dilute such that diffusion does not affect the overall flow velocities. Within a single phase, the molar balance of concentration is given by equation (1). We will assume steady-state operation with no reactions so that we can eliminate the red terms. &#xD;
&#xD;
$${\color{Red}{\frac{{\partial {C}}}{{\partial t}}}} + &#xD;
\mathbf{v} \cdot \nabla C -&#xD;
 \nabla \cdot \mathcal{D} \nabla C - {\color{Red}{r^{&amp;#039;&amp;#039;&amp;#039;}}}&#xD;
 = 0 \qquad (1)$$&#xD;
 &#xD;
### Species balance in each phase&#xD;
For convenience, I will denote the phases by a subscript G and L for gas and liquid with the understanding that these equations could also apply to a liquid-liquid extraction problem.  This leads to the following concentration balance equations for the liquid and gas phases.&#xD;
 &#xD;
$$\begin{gathered} &#xD;
\begin{matrix}&#xD;
\mathbf{v}_L \cdot \nabla C_L +&#xD;
 \nabla \cdot \left(-\mathcal{D}_L \nabla C_L\right)  = 0 &amp;amp; x,y\in \Omega_L  &amp;amp; (2*) \\ &#xD;
\mathbf{v}_G \cdot \nabla C_G +&#xD;
 \nabla \cdot \left(-\mathcal{D}_G \nabla C_G\right)  = 0 &amp;amp; x,y\in \Omega_G  &amp;amp; (3*) \\&#xD;
\end{matrix}&#xD;
\end{gathered}$$&#xD;
&#xD;
Or in Laplacian form&#xD;
&#xD;
$$\begin{gathered} &#xD;
\begin{matrix}&#xD;
\mathbf{v}_L \cdot \nabla C_L -\mathcal{D}_L&#xD;
 \nabla^2 C_L  = 0 &amp;amp; x,y\in \Omega_L  &amp;amp; (2*) \\ &#xD;
\mathbf{v}_G \cdot \nabla C_G -\mathcal{D}_G&#xD;
 \nabla^2 C_G  = 0 &amp;amp; x,y\in \Omega_G  &amp;amp; (3*)  \\&#xD;
\end{matrix}&#xD;
\end{gathered}$$&#xD;
&#xD;
#### Creating a No-Flux Boundary Condition at the Interface&#xD;
To prevent the gas species diffusing into the liquid layer and _vice versa_, I will set the velocities to zero and the diffusion coefficients to a very small value in the other phase.  From a visualization standpoint, it will appear that the gas species has diffused into the liquid layer and _vice versa_, but the flux is effectively zero.  To clean up the visualization, we will define plot ranges by gas, interphase, and liquid regions.&#xD;
&#xD;
### Species balance including a thin interphase region&#xD;
&#xD;
We will define a thin Interphase region between the 2 phases that will allow us to couple the phases in the interphase region via a source term creating the jump discontinuity in concentration as shown in the figure below.&#xD;
&#xD;
![enter image description here][10]&#xD;
&#xD;
We will modify (2\*) and (3\*) with the coupling source term as shown below.&#xD;
&#xD;
$$\begin{gathered} &#xD;
\begin{matrix}&#xD;
\mathbf{v}_L \cdot \nabla C_L -\mathcal{D}_L&#xD;
 \nabla^2 C_L -&#xD;
\sigma\left(\Omega \right )k\left(K C_G-C_L \right ) = 0 &amp;amp; x,y\in \Omega  &amp;amp; (2) \\ &#xD;
\mathbf{v}_G \cdot \nabla C_G -\mathcal{D}_G&#xD;
 \nabla^2 C_G + \sigma\left(\Omega \right )k\left(K C_G-C_L \right ) = 0 &amp;amp; x,y\in \Omega  &amp;amp; (3)  \\&#xD;
\end{matrix}&#xD;
\end{gathered}$$&#xD;
&#xD;
Where $K$ is a vapor-liquid equilibrium constant, $k$ is in interphase mass transfer coefficient (we will make this large because we want a fast approach to equilibrium), and $\sigma$ is a switch that turns on (=1) in the interface region and 0 otherwise.&#xD;
&#xD;
## Dimensional analysis&#xD;
&#xD;
We will multiply equations (2) and (3) by $\frac{{R^2}}{C_0 \mathcal{D}_G}$ to obtain their non-dimensionalized forms (4) and (5).&#xD;
&#xD;
$$\begin{gathered} &#xD;
\begin{matrix}&#xD;
 C_0\left (\frac{\mathbf{v}_L}{R} \cdot \nabla^* C_{L}^{*} -\frac{\mathcal{D}_L}{R^2}&#xD;
 \nabla^{*2} C_{L}^{*} -&#xD;
\sigma\left(\Omega \right )k\left(K C_{G}^{*}-C_{L}^{*} \right )  \right ) =  0\left\| {\frac{{R^2}}{C_0 \mathcal{D}_G}} \right.  \\ &#xD;
C_0\left (\frac{\mathbf{v}_G}{R} \cdot \nabla^* C_{G}^{*} -\frac{\mathcal{D}_G}{R^2}&#xD;
 \nabla^{*2} C_{G}^{*} + \sigma\left(\Omega \right )k\left(K C_{G}^{*}-C_{L}^{*} \right )  \right ) = 0\left\| {\frac{{R^2}}{C_0 \mathcal{D}_G}} \right. \\&#xD;
\end{matrix}&#xD;
\end{gathered}$$&#xD;
&#xD;
$$\begin{gathered} &#xD;
\begin{matrix}&#xD;
\frac{\mathcal{D}_L}{\mathcal{D}_G} \frac{R\mathbf{v}_L}{\mathcal{D}_L} \cdot \nabla^* C_{L}^{*} -\delta &#xD;
 \nabla^{*2} C_{L}^{*} -&#xD;
\sigma\left(\Omega \right )\kappa\left(K C_{G}^{*}-C_{L}^{*} \right )  = 0  \\ &#xD;
\frac{R\mathbf{v}_G}{\mathcal{D}_G} \cdot \nabla^* C_{G}^{*} -&#xD;
 \nabla^{*2} C_{G}^{*} + \sigma\left(\Omega \right )\kappa\left(K C_{G}^{*}-C_{L}^{*} \right ) = 0\\&#xD;
\end{matrix}&#xD;
\end{gathered}$$&#xD;
&#xD;
$$\begin{gathered} &#xD;
\begin{matrix}&#xD;
 \delta{Pe}_L\mathbf{v}_{L}^* \cdot \nabla^* C_{L}^{*} -\delta &#xD;
 \nabla^{*2} C_{L}^{*} -&#xD;
\sigma\left(\Omega \right )\kappa\left(K C_{G}^{*}-C_{L}^{*} \right )  = 0 &amp;amp; (4)  \\ &#xD;
{Pe}_G\mathbf{v}_{G}^* \cdot \nabla^* C_{G}^{*} -&#xD;
 \nabla^{*2} C_{G}^{*} + \sigma\left(\Omega \right )\kappa\left(K C_{G}^{*}-C_{L}^{*} \right ) = 0 &amp;amp;(5)\\&#xD;
\end{matrix}&#xD;
\end{gathered}$$&#xD;
&#xD;
Where&#xD;
&#xD;
$$\delta=\frac{\mathcal{D}_L}{\mathcal{D}_G}$$&#xD;
$$Pe_L=\frac{R\mathbf{v}_L}{\mathcal{D}_L}$$&#xD;
$$Pe_G=\frac{R\mathbf{v}_G}{\mathcal{D}_G}$$&#xD;
&#xD;
With a good dimensionless model in place, we can start with our Wolfram Language implementation.&#xD;
&#xD;
# Wolfram Language Implementation&#xD;
&#xD;
## Mesh creation&#xD;
We start by loading the FEM package.&#xD;
&#xD;
    Needs[&amp;#034;NDSolve`FEM`&amp;#034;]&#xD;
&#xD;
When I started this effort, I considered co-current flow only. I realized that converting the model to counter-current flow was a simple matter of changing boundary markers.  I wrapped the process up in a module that returns an association whose parameters can be used to set up an NDSolve solution.  In the counter-current case, I changed the bottom boundary to a wall and the gas inlet concentration to 1.&#xD;
&#xD;
    makeMesh[h_, l_, rat_, gf_, cf_] := &#xD;
     Module[{bR, tp, bt, lf, rt, th, interfacel, interfaceg, buf, bnds, &#xD;
       rgs, crds, lelms, boundaryMarker, bcEle, bmsh, liquidCenter, &#xD;
       liquidReg, interfaceCenter, interfaceReg, gasCenter, gasReg, &#xD;
       meshRegs, msh, mDic},&#xD;
      (* Domain Dimensions *)&#xD;
      bR = rat h;&#xD;
      tp = bR;&#xD;
      bt = bR - h;&#xD;
      lf = 0;&#xD;
      rt = l;&#xD;
      th = h/gf;&#xD;
      interfacel = 0;&#xD;
      interfaceg = interfacel - th;&#xD;
      buf = 2.5 th;&#xD;
      &#xD;
      (* Use associations for clearer assignment later *)&#xD;
      bnds = &amp;lt;|liquidinlet -&amp;gt; 1, gasinlet -&amp;gt; 2, bottom -&amp;gt; 3|&amp;gt;;&#xD;
      rgs = &amp;lt;|gas -&amp;gt; 10, liquid -&amp;gt; 20, interface -&amp;gt; 15|&amp;gt;;&#xD;
      &#xD;
      (* Meshing Definitions *)&#xD;
      (* Coordinates *)&#xD;
      crds = {{lf, bt}(*1*), {rt, bt}(*2*), {rt, tp}(*3*), {lf, &#xD;
         tp}(*4*), {lf, interfacel}(*5*), {rt, interfacel}(*6*), {lf, &#xD;
         interfaceg}(*7*), {rt, interfaceg}(*8*)};&#xD;
      &#xD;
      (* Edges *)&#xD;
      lelms = {{1, 7}, {7, 5}, {5, 4}, {1, 2},&#xD;
               {2, 8}, {8, 6}, {6, 3}, {3, 4}, &#xD;
               {5, 6}, {7, 8}};&#xD;
      &#xD;
      (* Conditional Boundary Markers depending on configuration *)&#xD;
      boundaryMarker := {bnds[gasinlet], bnds[liquidinlet], &#xD;
         bnds[liquidinlet], bnds[bottom], 4, 4, 4, 4, 4, 4} /; cf == &amp;#034;Co&amp;#034;;&#xD;
      boundaryMarker := {4, 4, bnds[liquidinlet], bnds[bottom], &#xD;
         bnds[gasinlet], 4, 4, 4, 4, 4} /; cf == &amp;#034;Counter&amp;#034;;&#xD;
      &#xD;
      (* Create Boundary Mesh *)&#xD;
      bcEle = {LineElement[lelms, boundaryMarker]};&#xD;
      bmsh = ToBoundaryMesh[&amp;#034;Coordinates&amp;#034; -&amp;gt; crds, &#xD;
        &amp;#034;BoundaryElements&amp;#034; -&amp;gt; bcEle];&#xD;
      &#xD;
      (* 2D Regions *)&#xD;
      (* Identify Center Points of Different Material Regions *)&#xD;
      liquidCenter = {(lf + rt)/2, (tp + interfacel)/2};&#xD;
      liquidReg = {liquidCenter, rgs[liquid], 0.0005};&#xD;
      interfaceCenter = {(lf + rt)/2, (interfacel + interfaceg)/2};&#xD;
      interfaceReg = {interfaceCenter, rgs[interface], 0.5*0.000005};&#xD;
      gasCenter = {(lf + rt)/2, (bt + interfaceg)/2};&#xD;
      gasReg = {gasCenter, rgs[gas], 0.0005};&#xD;
      meshRegs = {liquidReg, interfaceReg, gasReg};&#xD;
      &#xD;
      msh = ToElementMesh[bmsh, &amp;#034;RegionMarker&amp;#034; -&amp;gt; meshRegs,&#xD;
        MeshRefinementFunction -&amp;gt; Function[{vertices, area},&#xD;
          Block[{x, y},&#xD;
           {x, y} = Mean[vertices];&#xD;
           If[&#xD;
            (y &amp;gt; interfaceCenter[[2]] - buf &amp;amp;&amp;amp;&#xD;
                y &amp;lt; interfaceCenter[[2]] + buf)  ||&#xD;
             (y &amp;lt; bt + 1.5 buf &amp;amp;&amp;amp;&#xD;
                x &amp;lt; lf + 1.5 buf)&#xD;
            , area &amp;gt; 0.0000125, area &amp;gt; 0.01&#xD;
            ]&#xD;
           ]&#xD;
          ]&#xD;
        ];&#xD;
      &#xD;
      mDic = &amp;lt;|&#xD;
        height -&amp;gt; h,&#xD;
        length -&amp;gt; l,&#xD;
        ratio -&amp;gt; rat,&#xD;
        gapfactor -&amp;gt; gf,&#xD;
        r -&amp;gt; bR,&#xD;
        top -&amp;gt; tp,&#xD;
        bot -&amp;gt; bt,&#xD;
        left -&amp;gt; lf,&#xD;
        right -&amp;gt; rt,&#xD;
        intl -&amp;gt; interfacel,&#xD;
        intg -&amp;gt; interfaceg,&#xD;
        intcx -&amp;gt; interfaceCenter[[1]],&#xD;
        intcy -&amp;gt; interfaceCenter[[2]],&#xD;
        buffer -&amp;gt; buf,&#xD;
        mesh -&amp;gt; msh,&#xD;
        bmesh -&amp;gt; bmsh,&#xD;
        bounds -&amp;gt; bnds,&#xD;
        regs -&amp;gt; rgs,&#xD;
        cfg -&amp;gt; cf&#xD;
        |&amp;gt;;&#xD;
      mDic]&#xD;
    &#xD;
    Options[meshfn] = {height -&amp;gt; 1, length -&amp;gt; 1, ratio -&amp;gt; 0.5, &#xD;
       gapfactor -&amp;gt; 100, config -&amp;gt; &amp;#034;Co&amp;#034;};&#xD;
    meshfn[OptionsPattern[]] := &#xD;
     makeMesh[OptionValue[height], OptionValue[length],&#xD;
      OptionValue[ratio], OptionValue[gapfactor], OptionValue[config]]&#xD;
&#xD;
We can create a mesh instance of a co-current flow case by invoking the meshfn\[\]. I will color the liquid inlet $\color{Green}{Green}$, the gas inlet $\color{Red}{Red}$ and the bottom boundary $\color{Orange}{Orange}$ (the rest of the boundaries are default).&#xD;
&#xD;
    mDicCo = meshfn[config -&amp;gt; &amp;#034;Co&amp;#034;];&#xD;
    mDicCo[bmesh][&#xD;
     &amp;#034;Wireframe&amp;#034;[&amp;#034;MeshElementMarkerStyle&amp;#034; -&amp;gt; Blue, &#xD;
      &amp;#034;MeshElementStyle&amp;#034; -&amp;gt; {Green, Red, Orange, Black}, &#xD;
      ImageSize -&amp;gt; Large]]&#xD;
&#xD;
![enter image description here][11]&#xD;
&#xD;
By setting the optional config parameter to &amp;#034;Counter&amp;#034;, we can easily generate a counter-current case as shown below (note how the gas inlet shifted to the right side.&#xD;
&#xD;
    mDic = meshfn[config -&amp;gt; &amp;#034;Counter&amp;#034;];&#xD;
    mDic[bmesh][&#xD;
     &amp;#034;Wireframe&amp;#034;[&amp;#034;MeshElementMarkerStyle&amp;#034; -&amp;gt; Blue, &#xD;
      &amp;#034;MeshElementStyle&amp;#034; -&amp;gt; {Green, Red, Orange, Black}, &#xD;
      ImageSize -&amp;gt; Large]]&#xD;
&#xD;
![enter image description here][12]&#xD;
&#xD;
For the co-current case, the bottom wall and the gas inlet have inconsistent Dirichlet conditions.  To reduce the effect, I refined the mesh in the lower left corner as shown below.&#xD;
&#xD;
![enter image description here][13]&#xD;
&#xD;
I also meshed the interface region finely.&#xD;
&#xD;
![enter image description here][14]&#xD;
&#xD;
Sometimes it can get confusing to setup alternative boundaries.  To visualize the coordinate IDs, you could use something like:&#xD;
&#xD;
    With[{pts = mDic[bmesh][&amp;#034;Coordinates&amp;#034;]}, &#xD;
     Graphics[{Opacity[1], Black, &#xD;
       GraphicsComplex[pts, &#xD;
        Text[Style[ToString[#], Background -&amp;gt; White, 12], #] &amp;amp; /@ &#xD;
         Range[Length[pts]]]}]]&#xD;
&#xD;
![enter image description here][15]&#xD;
&#xD;
## Solving and Visualization&#xD;
&#xD;
I have created a module that will solve and visualize depending on the mesh type (co-flow or counter-flow).  Hopefully, it is well enough commented that further discussion is not needed.&#xD;
&#xD;
    model[md_, kequil_, d_, pel_, peg_, title_] := &#xD;
      Module[{n, pecletgas, por, vl, vg, fac, facg, coefl, coefg, &#xD;
        dcliquidinletliquid, dcliquidinletgas, dcinletgas, &#xD;
        dcgasinletliquid, dcgasinletgas, dcbottomliquid, dcbottomgas, &#xD;
        eqnliquid, eqngas, eqns, ifun, pltl, pltint, pltg, pltarr, sz, &#xD;
        grid, lf, rt, tp, bt, interfaceg, interfacel, interfaceCenterY, &#xD;
        plrng, arrequil, arrdiff, arrgas, &#xD;
        arrliq},&#xD;
       (*localize Mesh Dict Values*)lf = md[left];&#xD;
       rt = md[right];&#xD;
       tp = md[top];&#xD;
       bt = md[bot];&#xD;
       interfaceg = md[intg];&#xD;
       interfacel = md[intl];&#xD;
       interfaceCenterY = md[intcy];&#xD;
       (*Must swtich gas flow direction for counter-flow*)&#xD;
       pecletgas = If[md[cfg] == &amp;#034;Co&amp;#034;, peg, -peg];&#xD;
       (*Dimensionless Mass Transfer Coefficient in Interphase Region*)&#xD;
       n = 10000;&#xD;
       (*&amp;#034;Porosity&amp;#034; to weight concentration in interphase*)&#xD;
       por[y_, intg_, intl_] := (y - intg)/(intl - intg);&#xD;
       (*Region Dependent Properties with Piecewise \&#xD;
    Functions*)(*velocity*)(*Liquid parabolic profile*)&#xD;
       vl = Evaluate[&#xD;
         Piecewise[{{{pel d (1 - (y/md[r])^2), 0}, &#xD;
            ElementMarker == md[regs][liquid]}, {{pecletgas, 0}, &#xD;
            ElementMarker == md[regs][gas]}, {{0, 0}, True}}]];&#xD;
       (*Gas Uniform Velocity*)&#xD;
       vg = Evaluate[&#xD;
         Piecewise[{{{pecletgas, 0}, &#xD;
            ElementMarker == md[regs][gas]}, {{pel d (1 - (y/md[r])^2), &#xD;
             0}, ElementMarker == md[regs][liquid]}, {{0, 0}, True}}]];&#xD;
       (*fac switches on mass transfer coefficient in interphase*)&#xD;
       fac = Evaluate[If[ElementMarker == md[regs][interface], n, 0]];&#xD;
       (*diffusion coefficients*)(*Liquid*)&#xD;
       coefl = Evaluate[&#xD;
         Piecewise[{{d, ElementMarker == md[regs][liquid]}, {1, &#xD;
            ElementMarker == md[regs][interface]}, {d/1000000, &#xD;
            True} (*Effectively No Flux at Interface*)}]];&#xD;
       (*Gas*)coefg = &#xD;
        Evaluate[&#xD;
         Piecewise[{{1, ElementMarker == md[regs][gas]}, {1, &#xD;
            ElementMarker == md[regs][interface]}, {d/1000000, &#xD;
            True} (*Effectively No Flux at Interface*)}]];&#xD;
       (*Dirichlet Conditions for Liquid at Inlets*)&#xD;
       dcliquidinletliquid = &#xD;
        DirichletCondition[cl[x, y] == 0, &#xD;
         ElementMarker == md[bounds][liquidinlet]];&#xD;
       dcliquidinletgas = &#xD;
        DirichletCondition[cg[x, y] == 0, &#xD;
         ElementMarker == md[bounds][liquidinlet]];&#xD;
       dcgasinletliquid = &#xD;
        DirichletCondition[cl[x, y] == 0, &#xD;
         ElementMarker == md[bounds][gasinlet]];&#xD;
       (*Conditional BCs for gas dependent on configuration*)&#xD;
       dcgasinletgas := &#xD;
        DirichletCondition[cg[x, y] == 0, &#xD;
          ElementMarker == md[bounds][gasinlet]] /; md[cfg] == &amp;#034;Co&amp;#034;;&#xD;
       dcgasinletgas := &#xD;
        DirichletCondition[cg[x, y] == 1, &#xD;
          ElementMarker == md[bounds][gasinlet]] /; md[cfg] == &amp;#034;Counter&amp;#034;;&#xD;
       (*Dirichlet Conditions for the Bottom Wall*)&#xD;
       dcbottomliquid = &#xD;
        DirichletCondition[cl[x, y] == 0, &#xD;
         ElementMarker == md[bounds][bottom]];&#xD;
       dcbottomgas = &#xD;
        DirichletCondition[cg[x, y] == 1, &#xD;
         ElementMarker == md[bounds][bottom]];&#xD;
       (*Balance Equations for Gas and Liquid Concentrations*)&#xD;
       eqnliquid = &#xD;
        vl.Inactive[Grad][cl[x, y], {x, y}] - &#xD;
          coefl Inactive[Laplacian][cl[x, y], {x, y}] - &#xD;
          fac (kequil cg[x, y] - cl[x, y]) == 0;&#xD;
       eqngas = &#xD;
        vg.Inactive[Grad][cg[x, y], {x, y}] - &#xD;
          coefg Inactive[Laplacian][cg[x, y], {x, y}] + &#xD;
          fac (kequil cg[x, y] - cl[x, y]) == 0;&#xD;
       (*Equations to be solved depending on configuration*)&#xD;
       eqns := {eqnliquid, eqngas, dcliquidinletliquid, dcliquidinletgas, &#xD;
          dcgasinletliquid, dcgasinletgas, dcbottomliquid, dcbottomgas} /;&#xD;
          md[cfg] == &amp;#034;Co&amp;#034;;&#xD;
       eqns := {eqnliquid, eqngas, dcliquidinletliquid, dcliquidinletgas, &#xD;
          dcgasinletliquid, dcgasinletgas} /; md[cfg] == &amp;#034;Counter&amp;#034;;&#xD;
       (*Solve the PDE*)&#xD;
       ifun = NDSolveValue[eqns, {cl, cg}, {x, y} \[Element] md[mesh]];&#xD;
       (*Visualizations*)(*Create Arrows to represent magnitude of \&#xD;
    dimensionless groups*)(*Equilibrium Arrow*)&#xD;
       arrequil = {CapForm[&amp;#034;Square&amp;#034;], Red, Arrowheads[0.03], &#xD;
         Arrow[Tube[{{1 - 0.0125, 0.025, 1}, {1 - 0.0125, 0.025, kequil}},&#xD;
            0.005], -0.03]};&#xD;
       (*Diffusion Arrow*)&#xD;
       arrdiff = {Darker[Green, 1/2], &#xD;
         Arrowheads[0.03, Appearance -&amp;gt; &amp;#034;Flat&amp;#034;], &#xD;
         Arrow[Tube[{{-0.025, 0.0, 0.0 .025}, {-0.025, &#xD;
             0.5 (1 + Log10[d]/4), 0.025}}, 0.005], -0.03]};&#xD;
       (*Liquid Peclet Arrow*)&#xD;
       arrliq = {Blue, Dashed, Arrowheads[1.5 0.03], &#xD;
         Arrow[Tube[{{0.0, mDic[top] + 0.025, 0.035}, {pel/50, &#xD;
             mDic[top] + 0.025, 0.035}}, 1.5 0.005], -0.03 1.5]};&#xD;
       (*Conditional Gas Peclet Arrow*)&#xD;
       arrgas := {Black, Dashed, Arrowheads[1.5 0.03], &#xD;
          Arrow[Tube[{{0.0, mDic[bot], 1.035}, {peg/50, mDic[bot], &#xD;
              1.035}}, 1.5 0.005], -0.03 1.5]} /; md[cfg] == &amp;#034;Co&amp;#034;;&#xD;
       arrgas := {Black, Dashed, Arrowheads[1.5 0.03], &#xD;
          Arrow[Tube[{{mDic[right], mDic[bot], &#xD;
              1.035}, {mDic[right] - peg/50, mDic[bot], 1.035}}, &#xD;
            1.5 0.005], -0.03 1.5]} /; md[cfg] == &amp;#034;Counter&amp;#034;;&#xD;
       (*Set up plots*)(*Common plot options*)&#xD;
       plrng = {{lf, rt}, {bt, tp}, {0, 1}};&#xD;
       SetOptions[Plot3D, PlotRange -&amp;gt; plrng, PlotPoints -&amp;gt; {200, 200}, &#xD;
        ColorFunction -&amp;gt; &#xD;
         Function[{x, y, z}, Directive[ColorData[&amp;#034;DarkBands&amp;#034;][z]]], &#xD;
        ColorFunctionScaling -&amp;gt; False, MeshFunctions -&amp;gt; {#3 &amp;amp;}, &#xD;
        Mesh -&amp;gt; 18, AxesLabel -&amp;gt; Automatic, ImageSize -&amp;gt; Large];&#xD;
       (*Liquid Plot*)&#xD;
       pltl = Plot3D[ifun[[1]][x, y], {x, lf, rt}, {y, interfacel, tp}, &#xD;
         MeshStyle -&amp;gt; {Black, Thick}];&#xD;
       (*Interface region Plot*)&#xD;
       pltint = &#xD;
        Plot3D[ifun[[2]][x, y] (1 - por[y, interfaceg, interfacel]) + &#xD;
          por[y, interfaceg, interfacel] ifun[[1]][x, y], {x, lf, rt}, {y,&#xD;
           interfaceg, interfacel}, &#xD;
         MeshStyle -&amp;gt; {DotDashed, Black, Thick}];&#xD;
       (*Gas Plot*)&#xD;
       pltg = Plot3D[ifun[[2]][x, y], {x, lf, rt}, {y, bt, interfaceg}, &#xD;
         MeshStyle -&amp;gt; {Dashed, Black, Thick}];&#xD;
       (*Grid Plot*)sz = 300;&#xD;
       grid = &#xD;
        Grid[{{Show[{pltl, pltint, pltg}, &#xD;
            ViewProjection -&amp;gt; &amp;#034;Orthographic&amp;#034;, ViewPoint -&amp;gt; Front, &#xD;
            ImageSize -&amp;gt; sz, Background -&amp;gt; RGBColor[0.84`, 0.92`, 1.`], &#xD;
            Boxed -&amp;gt; False], &#xD;
           Show[{pltl, pltint, pltg}, ViewProjection -&amp;gt; &amp;#034;Orthographic&amp;#034;, &#xD;
            ViewPoint -&amp;gt; Left, ImageSize -&amp;gt; sz, &#xD;
            Background -&amp;gt; RGBColor[0.84`, 0.92`, 1.`], &#xD;
            Boxed -&amp;gt; False]}, {Show[{pltl, pltint, pltg}, &#xD;
            ViewProjection -&amp;gt; &amp;#034;Orthographic&amp;#034;, ViewPoint -&amp;gt; Top, &#xD;
            ImageSize -&amp;gt; sz, Background -&amp;gt; RGBColor[0.84`, 0.92`, 1.`], &#xD;
            Boxed -&amp;gt; False], &#xD;
           Show[{pltl, pltint, pltg}, ViewProjection -&amp;gt; &amp;#034;Perspective&amp;#034;, &#xD;
            ViewPoint -&amp;gt; {Above, Left, Back}, ImageSize -&amp;gt; sz, &#xD;
            Background -&amp;gt; RGBColor[0.84`, 0.92`, 1.`], Boxed -&amp;gt; False]}}, &#xD;
         Dividers -&amp;gt; Center];&#xD;
       (*Reset Plot Options to Default*)&#xD;
       SetOptions[Plot3D, PlotStyle -&amp;gt; Automatic];&#xD;
       pltarr = &#xD;
        Grid[{{Text[Style[title, Blue, Italic, 24]]}, {Style[&#xD;
            StringForm[&#xD;
             &amp;#034;\!\(\*SubscriptBox[\(K\), \(C\)]\)=``, \[Delta]=``, \&#xD;
    \!\(\*SubscriptBox[\(Pe\), \(L\)]\)=``, and \&#xD;
    \!\(\*SubscriptBox[\(Pe\), \(G\)]\)=``&amp;#034;, &#xD;
             NumberForm[kequil, {3, 2}, NumberPadding -&amp;gt; {&amp;#034; &amp;#034;, &amp;#034;0&amp;#034;}], &#xD;
             NumberForm[d, {5, 4}, NumberPadding -&amp;gt; {&amp;#034; &amp;#034;, &amp;#034;0&amp;#034;}], &#xD;
             NumberForm[pel, {2, 1}, NumberPadding -&amp;gt; {&amp;#034; &amp;#034;, &amp;#034;0&amp;#034;}], &#xD;
             NumberForm[peg, {2, 1}, NumberPadding -&amp;gt; {&amp;#034; &amp;#034;, &amp;#034;0&amp;#034;}]], &#xD;
            18]}, {Show[{pltl, pltint, pltg, &#xD;
             Graphics3D[{arrequil, arrdiff, arrliq, arrgas}](*,arrequil,&#xD;
             arrdiff,arrliq,arrgas*)}, ViewProjection -&amp;gt; &amp;#034;Perspective&amp;#034;, &#xD;
            ViewPoint -&amp;gt; {Above, Left, Back}, ImageSize -&amp;gt; 640, &#xD;
            Background -&amp;gt; RGBColor[0.84`, 0.92`, 1.`], Boxed -&amp;gt; False, &#xD;
            PlotRange -&amp;gt; {{md[left] - 0.05, md[right]}, {md[bot], &#xD;
               md[top] + 0.05}, {0, 1 + 0.1}}]}}];&#xD;
       (*Return values*){ifun, {pltl, pltint, pltg}, pltarr, grid}];&#xD;
    &#xD;
    Options[modelfn] = {md -&amp;gt; mDic, k -&amp;gt; 0.5, dratio -&amp;gt; 1, pel -&amp;gt; 50, &#xD;
       peg -&amp;gt; 50, title -&amp;gt; &amp;#034;Test&amp;#034;};&#xD;
    modelfn[OptionsPattern[]] := &#xD;
     model[OptionValue[md], OptionValue[k], OptionValue[dratio], &#xD;
      OptionValue[pel], OptionValue[peg], OptionValue[title]]&#xD;
&#xD;
## Testing of Meshing and Solving Modules&#xD;
Now, that we wrapped our meshing and solving work flow into modules, I will demonstrate how to create an instance of a simulation.&#xD;
&#xD;
    (* Create a Co-Flow Mesh *)&#xD;
    mDic = meshfn[config -&amp;gt; &amp;#034;Co&amp;#034;];&#xD;
    (* Simulate and return results *)&#xD;
    res = modelfn[md -&amp;gt; mDic, k -&amp;gt; 0.5, dratio -&amp;gt; 0.1, pel -&amp;gt; 10, &#xD;
       peg -&amp;gt; 5, title -&amp;gt; &amp;#034;Co-Flow&amp;#034;];&#xD;
&#xD;
To visualize a 3D plot with arrows representing the magnitude of dimensionless parameters, we access the third part of the results list.&#xD;
&#xD;
    res[[3]]&#xD;
&#xD;
![enter image description here][16]&#xD;
&#xD;
The solid lines, dashed lines, and dashed-dotted lines represent contours of species concentration in the liquid, gas, and interphase regions, respectively.  The $\color{Red}{Red}$ arrow is proportional to (1-K), the $\color{Green}{Green}$ arrow is proportional to the log of the diffusion ratio $\delta$, the $\color{Blue}{Blue}$ arrow is proportional to $Pe_L$, and the $\color{Black}{Black}$ arrow is proportional to $Pe_G$.  Multiple views are contained in part 4 of the results list.&#xD;
&#xD;
    res[[4]]&#xD;
&#xD;
![enter image description here][17]&#xD;
&#xD;
## Validation (Comparison to another code)&#xD;
&#xD;
Before continuing, it is always good practice to validate your model versus experiment or at least another code.  The other code supports a partition conditions for the concentration jump so that I do not need to create an interface layer.  The results are shown below:&#xD;
&#xD;
![enter image description here][18]&#xD;
&#xD;
The contour plots look very similar to the image in the lower left corner of the grid plot.  To be more quantitative, I have highlighted contours at approximately y=-0.15 and y=0.05 in the gas and liquid layers at x=1 corresponding to concentrations of 0.68 and 0.28, respectively.  The first part of the results list returns an interpolation function of the liquid and gas species.  We can see that we are within a percent of the other code, which is reasonable given that the interface layer is about 1% of the domain.  This check gives me good confidence that my model is not too wrong and that I can start to make it useful (i.e., exercising the model by changing parameters). &#xD;
&#xD;
    res[[1]][[2]][1, -0.15] (*0.6769985984321076`*)&#xD;
    res[[1]][[1]][1, 0.05] (* 0.27374616012596314`*)&#xD;
&#xD;
# Generating Animations&#xD;
&#xD;
I like to animate.  For me, animations are the best way to demonstrate how a system evolves as a function of time or parameter changes. We can export an animated gif file to study the effects of dimensionless parameter changes for both flow configurations as shown in the following code. It will take about 30 minutes per animation and about 5 GB of RAM. Undoubtedly, this code could be optimized for speed and memory usage, but you still can create a dozen animations while you sleep.&#xD;
&#xD;
    SetDirectory[NotebookDirectory[]];&#xD;
    &#xD;
    f = ((#1 - #2)/(#3 - #2)) &amp;amp;; (* Scale for progress bar *)&#xD;
    &#xD;
    mDic = meshfn[config -&amp;gt; &amp;#034;Counter&amp;#034;]; (* Create Mesh Instance *)&#xD;
        &#xD;
    Export[&amp;#034;CounterFlow.gif&amp;#034;,&#xD;
     Monitor[&#xD;
      Table[&#xD;
       modelfn[md -&amp;gt; mDic, k -&amp;gt; kc, dratio -&amp;gt; 1, pel -&amp;gt; 0, peg -&amp;gt; 0, &#xD;
         title -&amp;gt; &amp;#034;Counter-Flow&amp;#034;][[3]], {kc, 1, 0.01, -0.01}&#xD;
       	],&#xD;
      Grid[&#xD;
       	{{&amp;#034;Total progress:&amp;#034;, &#xD;
         ProgressIndicator[&#xD;
          Dynamic[f[kc, 1, &#xD;
            0.01, -0.01]]]}, {&amp;#034;\!\(\*SubscriptBox[\(K\), \(C\)]\)=&amp;#034;, \&#xD;
    {Dynamic@kc}}}]&#xD;
      	],&#xD;
     &amp;#034;AnimationRepetitions&amp;#034; -&amp;gt; \[Infinity]]&#xD;
&#xD;
# Examples&#xD;
&#xD;
I combined the co- (left) and counter-current (right) gif animations for several cases below. Péclet numbers approaching 100 start to look uninteresting visually (all the action is very close to the interface).  This should inform the user that perhaps another model is in order with new assumptions to study the small-scale behavior near the interface.&#xD;
&#xD;
## Changing the Equilibrium Constant @ No Flow&#xD;
&#xD;
![enter image description here][19]&#xD;
&#xD;
As the equilibrium constant, $K$, reduces, the jump condition increases.&#xD;
&#xD;
## Changing the Diffusion Ratio $\delta$ @ No Flow&#xD;
&#xD;
![enter image description here][20]&#xD;
&#xD;
As the liquid-gas diffusion ratio, $\delta$, decreases, the concentration in the gas layer increases.  We also see that the solution does not change much for $\delta&amp;lt;0.01$.&#xD;
## Changing  $Pe_L$  @ No Gas Flow&#xD;
&#xD;
![enter image description here][21]&#xD;
&#xD;
As $Pe_L$ increases, the concentration gradient increases at the interface.&#xD;
## Changing  $Pe_G$  @ No Liquid Flow&#xD;
&#xD;
![enter image description here][22]&#xD;
&#xD;
As $Pe_G$ increases, we see the concentration in the liquid layer decrease for co-flow and increase for counter-current flow. This should make sense since the inlet concentration for co-flow is 0 and 1 for counter-current flow. &#xD;
&#xD;
## Changing the Diffusion Ratio $\delta$ @ Middle Conditions&#xD;
&#xD;
![enter image description here][23]&#xD;
&#xD;
Again, we do not see much change for $\delta&amp;lt;0.01$.  One may have noticed that the concentration in the liquid layer goes up as the diffusion coefficient ratio goes down, which may, at first, seem counterintuitive.  The reason for this behavior is that the dimensionless velocity in the liquid layer depends on both $Pe_L$ and $\delta$ so it decreases with decreasing $\delta$. &#xD;
&#xD;
# Summary&#xD;
&#xD;
- Constructed an FEM model in the Wolfram Language to study concentration jump conditions in interphase mass transfer.&#xD;
- Results compare favorably to another code designed to handle jump conditions.&#xD;
- Showed several examples of the effect of dimensionless parameter changes on two model flow configurations.&#xD;
- Notebook provided.&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=varyKlv0gv0.gif&amp;amp;userId=1402928&#xD;
  [2]: http://appliedchem.unideb.hu/Muvtan/Transport%20Processes%20and%20Unit%20Operations,%20Third%20Edition.pdf&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ConcJumps.png&amp;amp;userId=1402928&#xD;
  [4]: https://reference.wolfram.com/language/ref/DSolve.html&#xD;
  [5]: https://ac.els-cdn.com/S0307904X07000601/1-s2.0-S0307904X07000601-main.pdf?_tid=adb2e542-50f1-44ce-ad9f-54ffaaa83bcb&amp;amp;acdnat=1539987146_3e6ce710d8016d91587f466be8e4ada7&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=AbsorptionModel.png&amp;amp;userId=1402928&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=PMSystemDescription.png&amp;amp;userId=1402928&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=AbsorptionSystem.png&amp;amp;userId=1402928&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Dimensions.png&amp;amp;userId=1402928&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=AbsorptionSystem2.png&amp;amp;userId=1402928&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=CoCurrentBoundaryMesh.png&amp;amp;userId=1402928&#xD;
  [12]: https://community.wolfram.com//c/portal/getImageAttachment?filename=CounterCurrentBoundaryMesh.png&amp;amp;userId=1402928&#xD;
  [13]: https://community.wolfram.com//c/portal/getImageAttachment?filename=CornerRefinement.png&amp;amp;userId=1402928&#xD;
  [14]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Interface.png&amp;amp;userId=1402928&#xD;
  [15]: https://community.wolfram.com//c/portal/getImageAttachment?filename=CoordIDs.png&amp;amp;userId=1402928&#xD;
  [16]: https://community.wolfram.com//c/portal/getImageAttachment?filename=testresult3.png&amp;amp;userId=1402928&#xD;
  [17]: https://community.wolfram.com//c/portal/getImageAttachment?filename=TestGrid.png&amp;amp;userId=1402928&#xD;
  [18]: https://community.wolfram.com//c/portal/getImageAttachment?filename=comsolresults.png&amp;amp;userId=1402928&#xD;
  [19]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Cmb_varyKld1v0gv0.gif&amp;amp;userId=1402928&#xD;
  [20]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Cmb_varydelta.gif&amp;amp;userId=1402928&#xD;
  [21]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Cmb_varyliqvelocity.gif&amp;amp;userId=1402928&#xD;
  [22]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Cmb_varygasvelocity.gif&amp;amp;userId=1402928&#xD;
  [23]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Cmb_varydeltalv5gv5.gif&amp;amp;userId=1402928</description>
    <dc:creator>Tim Laska</dc:creator>
    <dc:date>2018-11-15T19:31:17Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1190717">
    <title>The MoleculeViewer package</title>
    <link>https://community.wolfram.com/groups/-/m/t/1190717</link>
    <description>I have just released a package entitled [&amp;#034;MoleculeViewer&amp;#034;][1], whose functionality is exactly what it says on the tin.&#xD;
&#xD;
This package was inspired in part by previous efforts by [@BoB LeSuer][at0] and [@Bianca Eifert][at1]. I took the best parts of [their][2] [packages][3], along with some of the good parts of the built-in molecule renderer, and added a few of my own tweaks. One noticeable tweak would be the depiction of multiple bonds (just like what is done in some physical models), as in the following image:&#xD;
&#xD;
    MoleculeViewer[&amp;#034;thiacloprid&amp;#034;]&#xD;
![thiacloprid][4]&#xD;
&#xD;
The package has a number of other nifty features and auxiliary functions, like highlighting:&#xD;
&#xD;
    MoleculeViewer[&amp;#034;caffeine&amp;#034;, Highlighted -&amp;gt; {&amp;#034;O&amp;#034;, &amp;#034;N&amp;#034; -&amp;gt; Orange}]&#xD;
![caffeine][5]&#xD;
&#xD;
and legends:&#xD;
&#xD;
    MoleculeViewer[RunOpenBabel[GetChemSpider[&amp;#034;calicheamicin&amp;#034;, &amp;#034;InChI&amp;#034;]], PlotLegends -&amp;gt; True]&#xD;
![calicheamicin][6]&#xD;
&#xD;
Before using the package, you will need to install [Open Babel][7] for some of its conversion functionality. Additionally, to use the [ChemSpider][8] search functionality, you will need to [register][9] to obtain an API key.&#xD;
&#xD;
Download the paclet from GitHub and [install in the usual manner][10]. Alternatively, using the technique featured [here][11], evaluate&#xD;
&#xD;
    PacletInstall[&amp;#034;MoleculeViewer&amp;#034;, &amp;#034;Site&amp;#034; -&amp;gt; &amp;#034;http://raw.githubusercontent.com/tpfto/MoleculeViewer/master&amp;#034;]&#xD;
&#xD;
Documentation and a gallery are given as separate notebooks.&#xD;
&#xD;
 [at0]: http://community.wolfram.com/web/bobthechemist&#xD;
 [at1]: http://community.wolfram.com/web/biancaeifert&#xD;
&#xD;
&#xD;
  [1]: https://github.com/tpfto/MoleculeViewer/releases&#xD;
  [2]: https://github.com/biancaeifert/multi-bond-plot&#xD;
  [3]: https://github.com/bobthechemist/molviewer&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=zotu8.png&amp;amp;userId=520181&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=eTaCP.png&amp;amp;userId=520181&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=nlZ63.png&amp;amp;userId=520181&#xD;
  [7]: http://openbabel.org/&#xD;
  [8]: http://www.chemspider.com/&#xD;
  [9]: http://www.chemspider.com/Register.aspx&#xD;
  [10]: https://mathematica.stackexchange.com/a/141888&#xD;
  [11]: https://mathematica.stackexchange.com/questions/155123</description>
    <dc:creator>J. M.</dc:creator>
    <dc:date>2017-09-23T15:31:37Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2546972">
    <title>Converting DNA strands to amino acid chains</title>
    <link>https://community.wolfram.com/groups/-/m/t/2546972</link>
    <description>&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/9f15876a-0afc-428f-809c-2859aec6189e</description>
    <dc:creator>Samikshaa Natarajan</dc:creator>
    <dc:date>2022-06-08T21:48:48Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2927764">
    <title>Introducing the Wolfram ProteinVisualization paclet!</title>
    <link>https://community.wolfram.com/groups/-/m/t/2927764</link>
    <description>![Introducing the Wolfram ProteinVisualization paclet!][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Main2.bmp&amp;amp;userId=20103&#xD;
  [2]: https://www.wolframcloud.com/obj/353c8f22-23af-4a49-b43c-b0b0f1645249</description>
    <dc:creator>Soutick Saha</dc:creator>
    <dc:date>2023-05-31T14:38:54Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1799757">
    <title>See all halomethanes</title>
    <link>https://community.wolfram.com/groups/-/m/t/1799757</link>
    <description># Introduction:&#xD;
&#xD;
*One problem in chemistry is finding all possible molecules, as there are rotations and reflections. All the possibilities of existence of halomethanes (even unstable ones) are addressed here. This is a question similar to the sequence: Doubly triangular numbers (A002817OEIS, N. J. A. Sloane, Apr 18, 2017):* *Number of inequivalent ways to color vertices of a square using &amp;lt;= n colors, allowing rotations and reflections* ... , a(n)=n*(n+1)*(n^ 2+n+2)/8.&#xD;
&#xD;
*However as described in the sequence A002817OEIS, only the total result of the possibilities is addressed, while here in this post I visually demonstrate all possibilities, both in list, 2D and 3D graphs and mass list.*&#xD;
&#xD;
# Function Code:&#xD;
&#xD;
With this function below it is possible to find and visualize **all possibilities of halomethanes**, taking into account all rotations and reflections of the molecules. I developed this function with some options (Mode) besides the list of terms. Examples of options: &amp;#034;Color&amp;#034;, &amp;#034;Visual&amp;#034;, &amp;#034;Visual3D&amp;#034;, &amp;#034;Mass&amp;#034;.&#xD;
&#xD;
Here the function demonstration is done with all halogens (except radioactive halogens, by choice), but any of the  possible elements can be used as an argument in the function. Example: {&amp;#034;H&amp;#034;}, {&amp;#034;F&amp;#034;, &amp;#034;Br&amp;#034;, &amp;#034;I&amp;#034;}, {...} ... {&amp;#034;H&amp;#034;, &amp;#034;F&amp;#034;, &amp;#034;Cl&amp;#034;, &amp;#034;Br&amp;#034;, &amp;#034;I&amp;#034; }.&#xD;
&#xD;
    Halomethanes[elem_, OptionsPattern[]] := &#xD;
     Module[{eleu, z, cc, a, a1, f, rP, ap, n, b}, z = Length@elem; &#xD;
      Options[Halomethanes] = {&amp;#034;Mode&amp;#034; -&amp;gt; &amp;#034;Table&amp;#034;}; eleu = elem[[1]]; &#xD;
      a = Tuples[elem, 4] /. {&amp;#034;Cl&amp;#034; -&amp;gt; &amp;#034;D&amp;#034;, &amp;#034;Br&amp;#034; -&amp;gt; &amp;#034;B&amp;#034;}; n[x_] := {x}; &#xD;
      cc = {&amp;#034;C&amp;#034; -&amp;gt; GrayLevel[0.5], &amp;#034;F&amp;#034; -&amp;gt; RGBColor[1, 0.5, 0.5], &#xD;
        &amp;#034;Cl&amp;#034; -&amp;gt; RGBColor[0, 0.56, 0], &amp;#034;Br&amp;#034; -&amp;gt; RGBColor[0.6, 0.4, 0.2], &#xD;
        &amp;#034;I&amp;#034; -&amp;gt; RGBColor[1, 0, 0], &amp;#034;H&amp;#034; -&amp;gt; RGBColor[0, 1, 1]}; a1 = a[[1]]; &#xD;
      f[a_] := Module[{bt, ct, dt, e1, e2, ft, gt, r1}, &#xD;
        bt = Table[StringJoin[a[[b]]], {b, 1, Length@a}]; &#xD;
        ct = Table[StringJoin@Table[a[[c]], 2], {c, 1, Length@a}]; &#xD;
        dt = Table[&#xD;
          StringJoin[a[[d]][[4]], a[[d]][[3]], a[[d]][[2]], &#xD;
           a[[d]][[1]]], {d, 1, Length@a}]; &#xD;
        e1 = Table[&#xD;
          StringCases[ct[[i]], RegularExpression[bt[[1]]]], {i, 1, &#xD;
           Length@ct}]; &#xD;
        e2 = Table[&#xD;
          StringCases[ct[[i]], RegularExpression[dt[[1]]]], {i, 1, &#xD;
           Length@ct}]; &#xD;
        ft = Table[{Length@(e1[[j]]), &#xD;
            Length@(e2[[j]])} /. {{2, 2} -&amp;gt; bt[[j]], {2, 0} -&amp;gt; &#xD;
             bt[[j]], {0, 2} -&amp;gt; {&amp;#034;copy&amp;#034;}, {0, 0} -&amp;gt; bt[[j]], {2, 1} -&amp;gt; &#xD;
             bt[[j]], {1, 2} -&amp;gt; {&amp;#034;copy&amp;#034;}, {1, 0} -&amp;gt; {&amp;#034;copy&amp;#034;}, {0, &#xD;
              1} -&amp;gt; {&amp;#034;copy&amp;#034;}, {1, 1} -&amp;gt; {&amp;#034;copy&amp;#034;}}, {j, 1, Length@ct}]; &#xD;
        gt = Table[&#xD;
          StringPartition[DeleteCases[ft, {&amp;#034;copy&amp;#034;}][[o]], 1], {o, 1, &#xD;
           Length@DeleteCases[ft, {&amp;#034;copy&amp;#034;}]}]; &#xD;
        r1 = If[gt != {}, If[gt[[1]] == a[[1]], gt[[1]], {}], {}]; {rP = &#xD;
          DeleteCases[r1, {}], &#xD;
         ap = If[r1 != {}, DeleteCases[gt, r1], gt]}]; &#xD;
      Do[b = AppendTo[n[a1], {a = f[a][[2]], f[a][[1]]}[[2]]], &#xD;
       z*(z + 1)*(z^2 + z + 2)/8 - 1]; &#xD;
      OptionValue[&#xD;
        &amp;#034;Mode&amp;#034;] /. {&amp;#034;Table&amp;#034; -&amp;gt; &#xD;
         If[z == 1, {{eleu, eleu, eleu, eleu}}, &#xD;
          b /. {&amp;#034;D&amp;#034; -&amp;gt; &amp;#034;Cl&amp;#034;, &amp;#034;B&amp;#034; -&amp;gt; &amp;#034;Br&amp;#034;}], &#xD;
        &amp;#034;Color&amp;#034; -&amp;gt; {TableForm[{{&amp;#034;H&amp;#034;, &#xD;
             Text[Style[&amp;#034;Cyan&amp;#034;, RGBColor[0, 1, 1], Medium]]}, {&amp;#034;F&amp;#034;, &#xD;
             Text[Style[&amp;#034;Pink&amp;#034;, RGBColor[1, 0.5, 0.5], Medium]]}, {&amp;#034;Cl&amp;#034;, &#xD;
             Text[Style[&amp;#034;Green&amp;#034;, RGBColor[0, 0.56, 0], Medium]]}, {&amp;#034;Br&amp;#034;, &#xD;
             Text[Style[&amp;#034;Brown&amp;#034;, RGBColor[0.6, 0.4, 0.2], Medium]]}, {&amp;#034;I&amp;#034;,&#xD;
              Text[Style[&amp;#034;Red&amp;#034;, RGBColor[1, 0, 0], Medium]]}}, &#xD;
           TableHeadings -&amp;gt; {None, {&amp;#034;Atom&amp;#034;, &amp;#034;Color&amp;#034;}}], &#xD;
          If[z == 1, {Flatten@Table[elem, 4]}, &#xD;
            b /. {&amp;#034;D&amp;#034; -&amp;gt; &amp;#034;Cl&amp;#034;, &amp;#034;B&amp;#034; -&amp;gt; &amp;#034;Br&amp;#034;}] /. cc}, &#xD;
        &amp;#034;Visual&amp;#034; -&amp;gt; &#xD;
         If[z == 1, &#xD;
          MoleculePlot[&#xD;
           Molecule[{&amp;#034;C&amp;#034;, eleu, eleu, eleu, eleu}, {Bond[{1, 2}], &#xD;
             Bond[{1, 3}], Bond[{1, 4}], Bond[{1, 5}]}], ColorRules -&amp;gt; cc,&#xD;
            ImageSize -&amp;gt; 100], &#xD;
          Table[MoleculePlot[&#xD;
            Molecule[&#xD;
             Join[{&amp;#034;C&amp;#034;}, (b /. {&amp;#034;D&amp;#034; -&amp;gt; &amp;#034;Cl&amp;#034;, &amp;#034;B&amp;#034; -&amp;gt; &amp;#034;Br&amp;#034;})[[&#xD;
               h]]], {Bond[{1, 2}], Bond[{1, 3}], Bond[{1, 4}], &#xD;
              Bond[{1, 5}]}], ColorRules -&amp;gt; cc, ImageSize -&amp;gt; 100], {h, 1, &#xD;
            Length@b}]], &#xD;
        &amp;#034;Visual3D&amp;#034; -&amp;gt; &#xD;
         If[z == 1, &#xD;
          MoleculePlot3D[&#xD;
           Molecule[{&amp;#034;C&amp;#034;, eleu, eleu, eleu, eleu}, {Bond[{1, 2}], &#xD;
             Bond[{1, 3}], Bond[{1, 4}], Bond[{1, 5}]}], ColorRules -&amp;gt; cc,&#xD;
            ImageSize -&amp;gt; 100], &#xD;
          Table[MoleculePlot3D[&#xD;
            Molecule[&#xD;
             Join[{&amp;#034;C&amp;#034;}, (b /. {&amp;#034;D&amp;#034; -&amp;gt; &amp;#034;Cl&amp;#034;, &amp;#034;B&amp;#034; -&amp;gt; &amp;#034;Br&amp;#034;})[[&#xD;
               h]]], {Bond[{1, 2}], Bond[{1, 3}], Bond[{1, 4}], &#xD;
              Bond[{1, 5}]}], ColorRules -&amp;gt; cc, ImageSize -&amp;gt; 80], {h, 1, &#xD;
            Length@b}]], &#xD;
        &amp;#034;Mass&amp;#034; -&amp;gt; &#xD;
         If[z == 1, &#xD;
          MoleculeValue[&#xD;
           Molecule[{&amp;#034;C&amp;#034;, eleu, eleu, eleu, eleu}, {Bond[{1, 2}], &#xD;
             Bond[{1, 3}], Bond[{1, 4}], Bond[{1, 5}]}], &amp;#034;MolecularMass&amp;#034;],&#xD;
           Table[MoleculeValue[&#xD;
            Molecule[&#xD;
             Join[{&amp;#034;C&amp;#034;}, (b /. {&amp;#034;D&amp;#034; -&amp;gt; &amp;#034;Cl&amp;#034;, &amp;#034;B&amp;#034; -&amp;gt; &amp;#034;Br&amp;#034;})[[&#xD;
               h]]], {Bond[{1, 2}], Bond[{1, 3}], Bond[{1, 4}], &#xD;
              Bond[{1, 5}]}], &amp;#034;MolecularMass&amp;#034;], {h, 1, Length@b}]]}]&#xD;
&#xD;
# Visualization:&#xD;
&#xD;
- **TERMS TABLE**:&#xD;
&#xD;
In the simplest form, with only one argument, a list of all halomethane molecules is generated.&#xD;
&#xD;
    rp = Halomethanes[{&amp;#034;H&amp;#034;, &amp;#034;F&amp;#034;, &amp;#034;Cl&amp;#034;, &amp;#034;Br&amp;#034;, &amp;#034;I&amp;#034;}]&#xD;
    &#xD;
    Length@rp&#xD;
&#xD;
![im1][1]&#xD;
&#xD;
- **COLOR TABLE**:&#xD;
&#xD;
Optionally, a list of molecules with their respective illustrative colors is generated with the &amp;#034;Mode&amp;#034; -&amp;gt; &amp;#034;Color&amp;#034; option.&#xD;
&#xD;
    Halomethanes[{&amp;#034;H&amp;#034;, &amp;#034;F&amp;#034;, &amp;#034;Cl&amp;#034;, &amp;#034;Br&amp;#034;, &amp;#034;I&amp;#034;}, &amp;#034;Mode&amp;#034; -&amp;gt; &amp;#034;Color&amp;#034;]&#xD;
&#xD;
![im2][2]&#xD;
&#xD;
- **2D VISUAL TABLE**:&#xD;
&#xD;
Optionally, a list of molecules with 2D structural representations is generated with the &amp;#034;Mode&amp;#034; -&amp;gt; &amp;#034;Visual&amp;#034; option (the 2D model can better represent stereoisomerism than the 3D model).&#xD;
&#xD;
    Halomethanes[{&amp;#034;H&amp;#034;, &amp;#034;F&amp;#034;, &amp;#034;Cl&amp;#034;, &amp;#034;Br&amp;#034;, &amp;#034;I&amp;#034;}, &amp;#034;Mode&amp;#034; -&amp;gt; &amp;#034;Visual&amp;#034;]&#xD;
&#xD;
![im3][3]&#xD;
&#xD;
- **3D VISUAL TABLE** (interactive):&#xD;
&#xD;
Optionally, a list of molecules with 3D structural representations is generated with the &amp;#034;Mode&amp;#034; -&amp;gt; &amp;#034;Visual3D&amp;#034; option. This list is interactive, and each molecule can be rotated for better viewing (stereoisomerism is not very well represented in these 3D models as the representations are tetrahedral, for example, the isomers {&amp;#034;H&amp;#034;,&amp;#034;F&amp;#034;,&amp;#034;H&amp;#034;,&amp;#034;F&amp;#034;} and {&amp;#034;F&amp;#034;,&amp;#034;F&amp;#034;,&amp;#034;H,H} are very similar in this view).&#xD;
&#xD;
    Halomethanes[{&amp;#034;H&amp;#034;, &amp;#034;F&amp;#034;, &amp;#034;Cl&amp;#034;, &amp;#034;Br&amp;#034;, &amp;#034;I&amp;#034;}, &amp;#034;Mode&amp;#034; -&amp;gt; &amp;#034;Visual3D&amp;#034;]&#xD;
&#xD;
![im4][4]&#xD;
&#xD;
- **MASS TABLE**:&#xD;
&#xD;
Finally, a list of the masses of all halomethanes can be generated with the argument &amp;#034;Mode&amp;#034; -&amp;gt; &amp;#034;Mass&amp;#034; (some of them, although unstable, are mentioned in the list).&#xD;
&#xD;
    resp2 = Halomethanes[{&amp;#034;H&amp;#034;, &amp;#034;F&amp;#034;, &amp;#034;Cl&amp;#034;, &amp;#034;Br&amp;#034;, &amp;#034;I&amp;#034;}, &amp;#034;Mode&amp;#034; -&amp;gt; &amp;#034;Mass&amp;#034;]&#xD;
&#xD;
![im5][5]&#xD;
&#xD;
Illustrative graph of the mass distributions of all possible halomethanes:&#xD;
&#xD;
    ListPlot[resp2, AxesLabel -&amp;gt; {&amp;#034;n&amp;#034;, &amp;#034;Mass(u)&amp;#034;}, &#xD;
     LabelStyle -&amp;gt; Directive[&amp;#034;Subsubsection&amp;#034;, RGBColor[0.07, 0.5, 0.5]], &#xD;
     PlotLabel -&amp;gt; &amp;#034;Halomethanes Mass&amp;#034;, PlotRange -&amp;gt; {{0, 130}, {0, 550}}, &#xD;
     PlotStyle -&amp;gt; Directive[RGBColor[0.91, 0.08, 0.5], PointSize[Large]], &#xD;
     ImageSize -&amp;gt; Large]&#xD;
&#xD;
![im6][6]&#xD;
&#xD;
**Link**: (Doubly triangular numbers, A002817OEIS, sequence):&#xD;
&#xD;
https://oeis.org/A002817&#xD;
&#xD;
Thanks.&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=table1.png&amp;amp;userId=1316061&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=tableColor.png&amp;amp;userId=1316061&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=graphtest.png&amp;amp;userId=1316061&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=visual3D.png&amp;amp;userId=1316061&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=tablemass.png&amp;amp;userId=1316061&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=graph.png&amp;amp;userId=1316061</description>
    <dc:creator>Claudio Chaib</dc:creator>
    <dc:date>2019-10-03T03:01:17Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2305648">
    <title>QTAIM: a package for quantum theory of atoms in molecules</title>
    <link>https://community.wolfram.com/groups/-/m/t/2305648</link>
    <description>![enter image description here][1]&#xD;
&#xD;
Hello All,&#xD;
&#xD;
(I have set Independence Day (Observed) as my pencils-down moment to publicize a Wolfram Language/Mathematica package for performing computations and visualizing results from Quantum Theory of Atoms In Molecules (QTAIM) calculations on electronic structure theory wave functions.&#xD;
&#xD;
QTAIM endeavors the answer the question, &amp;#034;Are there discernable atoms inside of molecules?&amp;#034;  The answer according to Bader and co-workers is yes, if you define an atom as the basin/union of all steepest ascent paths and a nucleus, which is the attractor. Since there is zero-flux between these regions, they are proper quantum subsystems, just like the molecule/crystal is.&#xD;
&#xD;
Here is the water molecule (H2O) in this representation:&#xD;
&#xD;
![Atomic Basins][2]&#xD;
&#xD;
What motivated me to get going on creating a package was the new SliceVectorPlot3D routines, which make plotting these quantities a dream:&#xD;
&#xD;
![Gradient Field on Planes of Symmetr][3]&#xD;
&#xD;
The code is hosted here:&#xD;
https://github.com/ecbrown/QTAIM.wl&#xD;
&#xD;
which has this code and more extensive discussion.&#xD;
&#xD;
Wolfram Language/Mathematica is great for this. Great algorithms like ABM differential equation solver, and excellent graphics for 2D/3D fields. I t features several ways to get data in, so it can be file-based or scripted from PySCF.&#xD;
&#xD;
Well, I should keep it brief, and I look forward to any comments you have.&#xD;
&#xD;
Best regards,&#xD;
Eric&#xD;
&#xD;
&#xD;
&#xD;
An overview of the methods and results can be found here:&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][4]&#xD;
&#xD;
&#xD;
  [DON&amp;#039;T DELETE: Original notebook]: https://www.wolframcloud.com/obj/c70b8f04-b2fd-45f1-9077-f9827fe82357&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=QTAIM_hero.jpg&amp;amp;userId=20103&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7578atoms-are-defined-as-the-union-of-gradient-paths-and-attractor.png&amp;amp;userId=62741&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=stream-plot-3d-of-electron-density-gradient-of-water.png&amp;amp;userId=62741&#xD;
  [4]: https://www.wolframcloud.com/obj/71988d27-d090-4df4-84b6-ec3fd7564308</description>
    <dc:creator>Eric Brown</dc:creator>
    <dc:date>2021-07-05T17:39:53Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3191339">
    <title>Write it with proteins: protein structures that mimic letters of English alphabet</title>
    <link>https://community.wolfram.com/groups/-/m/t/3191339</link>
    <description>![Write it with proteins: protein structures that mimic letters of English alphabet][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7376Hero2.png&amp;amp;userId=20103&#xD;
  [2]: https://www.wolframcloud.com/obj/b42d5bf9-0757-49b0-bea6-3c2267ede4a1</description>
    <dc:creator>Soutick Saha</dc:creator>
    <dc:date>2024-06-11T18:58:33Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/981261">
    <title>MathIOmica:  An Integrative Package for Dynamic Omics</title>
    <link>https://community.wolfram.com/groups/-/m/t/981261</link>
    <description>*SUPPLEMENTARY WOLFRAM MATERIALS for ARTICLE:*&#xD;
&amp;gt; Mias, G., Yusufaly, T., Roushangar, R. et al. &#xD;
&#xD;
&amp;gt; *MathIOmica: An Integrative Platform for Dynamic Omics*. Sci Rep 6, 37237 (2016). &#xD;
&#xD;
&amp;gt; NATURE Scientific Reports&#xD;
&#xD;
&amp;gt; https://doi.org/10.1038/srep37237&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
#Introduction: MathIOmica&#xD;
My [lab][2] has recently released a new package for *Mathematica*, focusing on bioinformatics: **MathIOmica** ([mathiomica.org][3], download at [GitHub][4]).  The package is released under an MIT License and is available to use for free (requires *Mathematica* 10.4+).&#xD;
##Background&#xD;
There has been ongoing effort on the analysis of multiple *omics* data from disparate biological sources. Multimodal data from various sources in now available, particularly with new enabling technologies under constant development (e.g. sequencing capabilities with next generation sequencing and the focus on [transcriptomics][5], i.e. the set of all transcripts (RNA) in a cell, or mass spectrometry use for [proteomics][6], i.e. the set of all proteins in a cell). The recently announced [Precision Medicine Initiative][7] will lead to more being produced in the next few years. This has led to the development of multiple bioinformatics tools and platforms, particularly for [R][8] and [Python][9], such as [Bioconductor][10] and [Biopython][11] aiming to integrate information from various omics, including in the context of personalized medicine [(Mias and Snyder, 2014)][12]. However, sophisticated mathematical methods to study the dynamics of omics data are still underdeveloped, particularly methods that address missing data and uneven sampling over time, as well as time-series classifications. &#xD;
##Implementation&#xD;
Coming from a physics background and transitioning to genetics, I decided I wanted to develop a bioinformatics package for *Mathematica* written in the *Wolfram Language*. The *MathIOmica* package particularly focuses on the integration of multiple omics information from dynamic profiling in a personalized medicine profiling approach. Additionally, it provides essential functions to facilitate general bioinformatics analysis in *Mathematica*. This includes data importing and preprocessing, including normalizations, and clustering and visualization of the classification of dynamic data. *MathIOmica* includes annotations from [Gene Ontology][13], as well as [KEGG][14] pathway analyses. *MathIOmica* was built using *Wolfram Workbench* and includes inbuilt documentation accessible within Mathematica after installation. This first release is a first step, in which we wanted to develop a base for bioinformatics tools in the *Wolfram Language* and we are now working on more advanced functionality. &#xD;
The main functionality is summarized below (Figure from [Mias et. al, 2016][15]).&#xD;
&#xD;
![Main MathIOmica Functionality][16]&#xD;
&#xD;
##Example Using Transcriptome Data&#xD;
*MathIOmica* is meant to be used for biological data. Typically such data contains measurements, but also metadata. Additionally, multiple samples may be available. To parse such data we decided to create an `OmicsObject`, essentially an association of associations (Figure From from [Mias et. al, 2016][17]):&#xD;
&#xD;
![OmicsObject][18]&#xD;
&#xD;
Multiple utilities exist within the package to create and handle OmicsObjects, and many examples. Here let us take a close look at an example using transcriptomics data from a pilot first integrative Personal Omics Profiling ([iPOP][19]) project as an implementation of using MathIOmica to look at dynamics of biological data. This study was meant as a prototype to observe the personal omics dynamics from a single person, including proteomics transcriptomics and metabolomics profiled from blood.  Different samples (from 7 to 21 included here) were obtained at different time points. The time points included here correspond to days ranging from 186th to the 400th day of the study, (this can be represented in the following sample to day association:&#xD;
&#xD;
`&amp;lt;|7-&amp;gt;186,8-&amp;gt;255,9-&amp;gt;289,10-&amp;gt;290,11-&amp;gt;292,12-&amp;gt;294,13-&amp;gt;297,14-&amp;gt;301,&#xD;
        15-&amp;gt;307,16-&amp;gt;311,17-&amp;gt;322,18-&amp;gt;329,19-&amp;gt;369,20-&amp;gt;380,21-&amp;gt;400|&amp;gt;`. &#xD;
&#xD;
On day 289 the subject of the study had a respiratory syncytial virus infection. Additionally, after day 301, the subject displayed high glucose levels and was eventually diagnosed with type 2 diabetes. All these data are included as part of *MathIOmica*&amp;#039;s examples.&#xD;
&#xD;
We first load the package (assuming it has been installed):&#xD;
&#xD;
    &amp;lt;&amp;lt;`MathIOmica`&#xD;
Then we can load the OmicsObject associated with the transcriptome data:&#xD;
&#xD;
    rnaExample = &#xD;
     Get[FileNameJoin[{ConstantMathIOmicaExamplesDirectory, &#xD;
        &amp;#034;rnaExample&amp;#034;}]]&#xD;
&#xD;
![rnaExample][20]&#xD;
&#xD;
&#xD;
The outer keys correspond to the sample enumeration for a given day. We can convert these to actual days of the study and use `KeyMap` to change the outer labels:&#xD;
&#xD;
    sampleToDays = &amp;lt;|&amp;#034;7&amp;#034; -&amp;gt; &amp;#034;186&amp;#034;, &amp;#034;8&amp;#034; -&amp;gt; &amp;#034;255&amp;#034;, &amp;#034;9&amp;#034; -&amp;gt; &amp;#034;289&amp;#034;, &#xD;
       &amp;#034;10&amp;#034; -&amp;gt; &amp;#034;290&amp;#034;, &amp;#034;11&amp;#034; -&amp;gt; &amp;#034;292&amp;#034;, &amp;#034;12&amp;#034; -&amp;gt; &amp;#034;294&amp;#034;, &amp;#034;13&amp;#034; -&amp;gt; &amp;#034;297&amp;#034;, &#xD;
       &amp;#034;14&amp;#034; -&amp;gt; &amp;#034;301&amp;#034;, &amp;#034;15&amp;#034; -&amp;gt; &amp;#034;307&amp;#034;, &amp;#034;16&amp;#034; -&amp;gt; &amp;#034;311&amp;#034;, &amp;#034;17&amp;#034; -&amp;gt; &amp;#034;322&amp;#034;, &#xD;
       &amp;#034;18&amp;#034; -&amp;gt; &amp;#034;329&amp;#034;, &amp;#034;19&amp;#034; -&amp;gt; &amp;#034;369&amp;#034;, &amp;#034;20&amp;#034; -&amp;gt; &amp;#034;380&amp;#034;, &amp;#034;21&amp;#034; -&amp;gt; &amp;#034;400&amp;#034;|&amp;gt;;&#xD;
    &#xD;
    rnaLongitudinal = KeyMap[sampleToDays, rnaExample]&#xD;
&#xD;
Next, we can normalize our dataset. The inner measurements to be normalized are actual FPKM values ( fragments per kilobase of transcript per million mapped reads). A typical normalization used for RNA-Sequencing (RNA-Seq) FPKMs from transcriptomes across multiple samples is [quantile normalization][21]. &#xD;
&#xD;
    rnaQuantileNormed = QuantileNormalization[rnaLongitudinal]&#xD;
&#xD;
We additionally do some basic quality control as an example. First we set all FPKMs that are 0 to Missing, i.e. 0 means nothing was detected so that gene fragment is actually Missing.&#xD;
&#xD;
    rnaZeroTagged = LowValueTag[rnaQuantileNormed, 0]&#xD;
&#xD;
We then want to account for noisy measurements. If we assume all values less than unity are essentially noise and indistinguishable, we set them all to unity:&#xD;
&#xD;
    rnaNoiseAdjusted = &#xD;
     LowValueTag[rnaZeroTagged, 1, ValueReplacement -&amp;gt; 1]&#xD;
We then filter out data  where the reference healthy point we want to compare against, which is  day &amp;#034;255&amp;#034;,  is missing, and retain data with at least 3/4 of the points available :&#xD;
&#xD;
    rnaFiltered = FilterMissing[rnaNoiseAdjusted, 3/4, Reference -&amp;gt; &amp;#034;255&amp;#034;]&#xD;
The following charts are generated that show the remaining points in the data, including the statistics for Missing tags:&#xD;
![MissingPerComponent][22]&#xD;
![MissingPieChart][23]&#xD;
&#xD;
We extract the times for the filtered RNA data using:&#xD;
&#xD;
    timesRNA = TimeExtractor[rnaFiltered]&#xD;
The result is &#xD;
`timesRNA={186, 255, 289, 290, 292, 294, 297, 301, 307, 311, 322, 329, 369, 380, 400}`, a list of the days on which samples were taken in the study.&#xD;
&#xD;
For each gene we can now extract a time series (list of values) corresponding to these times:&#xD;
&#xD;
    timeSeriesRNA = CreateTimeSeries[rnaFiltered]&#xD;
&#xD;
![TimeSeries][24]&#xD;
&#xD;
We would next like to identify temporal trends in the data. To do this we first want to create a resampled distribution for the transcriptome dataset prior to classification and clustering to be able to compare against random time series from the same type of data.  We repeat the steps in the processing as described above using a resampled set of measurements. For brevity all steps (9) are listed together:&#xD;
&#xD;
    (*Bootstrap of 100000 time series*)&#xD;
    rnaBootstrap = BootstrapGeneral[rnaLongitudinal, 100000];&#xD;
    (*1: quantile normalization*)rnaBootstrapQuantileNormed = &#xD;
      QuantileNormalization[rnaBootstrap];&#xD;
    (*2: tag zero values*)rnaBootstrapZeroTagged = &#xD;
      LowValueTag[rnaBootstrapQuantileNormed, 0];&#xD;
    (*3: tag noise*) rnaBootstrapNoiseAdjusted = &#xD;
      LowValueTag[rnaBootstrapZeroTagged, 1, ValueReplacement -&amp;gt; 1];&#xD;
    (*4: filter missing*) rnaBootstrapFiltered = &#xD;
      FilterMissing[rnaBootstrapNoiseAdjusted, 3/4, Reference -&amp;gt; &amp;#034;255&amp;#034;, &#xD;
       ShowPlots -&amp;gt; False];&#xD;
    (*5: create time series*) timeSeriesBootstrapRNA = &#xD;
      CreateTimeSeries[rnaBootstrapFiltered];&#xD;
    (*6: take log*) timeSeriesBootstrapRNALog = &#xD;
      SeriesApplier[Log, timeSeriesBootstrapRNA];&#xD;
    (*7: compare to reference healthy point*)rnaBootstrapCompared = &#xD;
      SeriesInternalCompare[timeSeriesBootstrapRNALog, &#xD;
       ComparisonIndex -&amp;gt; 2];&#xD;
    (*8: normalize series*)normedBootstrapRNACompared = &#xD;
      SeriesApplier[Normalize, rnaBootstrapCompared];&#xD;
    (*9: remove constant series*)rnaBootstrapFinalTimeSeries = &#xD;
      ConstantSeriesClean[normedBootstrapRNACompared];&#xD;
&#xD;
Now we have the random distribution we can proceed with classification. We want to classify the temporal behavior of genes to identify common trends. This is done by the provided `TimeSeriesClassification` function. The function uses a few methods to help classify time series with uneven time sampling, and in this example we will use an approach that computes internally a [Lomb-Scargle][25] periodogram. Classification is then based on periodograms, and the data is classified into classes of major (highest intensity)  frequencies and spikes (maxima or minima in real signal intensity), depending on cutoffs typically provided by simulation. &#xD;
&#xD;
Specifically, for a given signal $X_ j$, with length $N$,  we have $N$ time measurements, namely $X_j=\left\{X_j\left(t_1\right),X_j\left(t_2\right),\text{...},X_j\left(t_N\right)\right\}$and can calculate the signal&amp;#039;s periodogram (Lomb-Scargle method). The `TimeSeriesClassification` function uses the `n=Floor[N/2]` frequencies, $f_j=\left\{ f_{\text{j1}},f_{\text{j2}},\text{...},f_{\text{jk}},\text{...},f_{\text{jn}} \right\}$ and obtains corresponding `n` intensities, $I_j=\left\{I_{\text{j1}},I_{\text{j2}},\text{...},I_{\text{jn}}\right\}$. The default functionality is for $I_j$ to be calculated as a normalized vector. The maximum intensity of this vector, $I_{jk_{\text max}}=\text{Max}\left[I_j\right]$ corresponds to a dominant frequency $f_{jk_{\text max}}$, and occurs at some index $k_{\text max}$. For each signal $X_j$ we can then compare $I_{jk_{\text max}}$ to a cutoff intensity $I_{\text cutoff}$ to see if $I_{jk_{\text max}} &amp;gt;  I_{\text cutoff}$. If so, the signal is placed in class $f_{k_{\text max}}$. A maximum of `n` classes is thus possible, and possible classes are labeled as $\left\{f_1,f_2,\text{...},f_k,\text{...},f_n\right\}$. The exact frequency list will depend on `n`, and hence the length of the input set times `N`, and is determined automatically by the classification functions. &#xD;
&#xD;
Signals that do not show a maximum intensity in frequency space above the cutoff intensity,i.e. signals $j$ for which $I_{ j k} \le  I_{\text cutoff}$ for all $k$, are checked for sudden signal spikes at any time point,and if so classified as spike maxima or minima. For each signal not showing a maximum periodogram intensity, $\tilde{X_j}$, we can calculate the real signal maximum, $\text{max}_j=\text{Max}\left[\tilde{X_j}\right]$,and minimum $\text{min}_ j=\text{Min}\left[\tilde{X_j}\right]$, from signal intensities across all time points. We can compare these values against cutoffs $\left\{\text{Minimum Spike Cutoff}_n, \text{Maximum Spike Cutoff}_n\right\}$provided by the user: These cutoffs are dependent on the length of a time series, $n$, and typically would correspond to the 95th quantile of distributions of maxima and minima of randomly generated signals.These cutoff values are provided by the `SpikeCutoffs` option value for each length $n$ involved in the computation as part of an association for different lengths:&#xD;
$&amp;lt;|\ ..., n\rightarrow \{\text {Minimum Spike Cutoff}_n,\text{Maximum Spike Cutoff}_n\},\ ...,\\&#xD;
\text{length } i\rightarrow \{\text{Minimum Spike Cutoff}_i,\text{Maximum Spike Cutoff}_ i\},...|&amp;gt;$.&#xD;
&#xD;
If a signal of length $n$, $\tilde{X_j}$, has $\text{max}_j &amp;gt; \text{Maximum Spike Cutoff}_n$, it is classified in the &amp;#034;SpikeMax&amp;#034; class, or otherwise if a signal $\tilde{X_j}$ has $\text{min}_ j &amp;lt; \text{Minimum Spike Cutoff}_n$, it is classified in the &amp;#034;SpikeMin&amp;#034; class. Signals for which the maximum signal intensity is not above the cutoffs are not reported.&#xD;
&#xD;
The default output for this &amp;#034;Lomb-Scargle&amp;#034; method by the `TimeSeriesClassification` function is an `Association` with outer keys being the classification classes $C$,where $C\in \left\{f_1,f_2,\text{...},f_k,\text{...},f_n,\ \text{SpikeMax},\text{ SpikeMin}\right\} $, inner keys being the class members,Subscript[signalsX, j],and each class member value being a list of $\{\{\text{periodogram intensity list for signal }X_j\}, \{\text{input data list for }X_j\}\}$.&#xD;
&#xD;
Before we classify our transcriptome data, we estimate for the &amp;#034;LombScargle&amp;#034; Method a 0.95 quantile cutoff from the bootstrap transcriptome data:&#xD;
&#xD;
    q95RNA = &#xD;
     QuantileEstimator[rnaBootstrapFinalTimeSeries, timesRNA] (*~0.85766 - this will vary depending on the simulation realization*)&#xD;
&#xD;
Next, we estimate the &amp;#034;Spikes&amp;#034; 0.95 quantile cutoff from the bootstrap transcriptome data :&#xD;
&#xD;
    q95RNASpikes = &#xD;
     QuantileEstimator[rnaBootstrapFinalTimeSeries, timesRNA, &#xD;
      Method -&amp;gt; &amp;#034;Spikes&amp;#034;]&#xD;
    (*&amp;lt;|12 -&amp;gt; {0.817567, -0.441325}, 13 -&amp;gt; {0.803445, -0.423142}, &#xD;
     14 -&amp;gt; {0.782053, -0.409893}, 15 -&amp;gt; {0.762132, -0.374392}|&amp;gt; This will also vary depending on the simulation realization*)&#xD;
&#xD;
Now we can classify the transcriptome time series data based on these cutoffs:&#xD;
&#xD;
    rnaClassification = TimeSeriesClassification[rnaFinalTimeSeries,timesRNA,LombScargleCutoff -&amp;gt; q95RNA,SpikeCutoffs -&amp;gt; q95RNASpikes]&#xD;
&#xD;
![Classification][26]&#xD;
&#xD;
We can get the number of members in each category:&#xD;
&#xD;
    Query[All, Length]@rnaClassification&#xD;
    (*&amp;lt;|&amp;#034;SpikeMax&amp;#034; -&amp;gt; 598, &amp;#034;SpikeMin&amp;#034; -&amp;gt; 8672, &amp;#034;f1&amp;#034; -&amp;gt; 62, &amp;#034;f2&amp;#034; -&amp;gt; 3, &#xD;
     &amp;#034;f3&amp;#034; -&amp;gt; 14, &amp;#034;f4&amp;#034; -&amp;gt; 42, &amp;#034;f5&amp;#034; -&amp;gt; 14, &amp;#034;f6&amp;#034; -&amp;gt; 10, &amp;#034;f7&amp;#034; -&amp;gt; 57|&amp;gt;, This will depend on the precise cutoffs used.*)&#xD;
&#xD;
Also we can see what the frequencies are by simply running the LombScargle function over the desired times for one of the time series and set the FrequenciesOnly option:&#xD;
&#xD;
    LombScargle[rnaFinalTimeSeries[[1]], timesRNA, &#xD;
     FrequenciesOnly -&amp;gt; True]&#xD;
    (*&amp;lt;|&amp;#034;f1&amp;#034; -&amp;gt; 0.00500668, &amp;#034;f2&amp;#034; -&amp;gt; 0.0104306, &amp;#034;f3&amp;#034; -&amp;gt; 0.0158545, &#xD;
     &amp;#034;f4&amp;#034; -&amp;gt; 0.0212784, &amp;#034;f5&amp;#034; -&amp;gt; 0.0267023, &amp;#034;f6&amp;#034; -&amp;gt; 0.0321262, &#xD;
     &amp;#034;f7&amp;#034; -&amp;gt; 0.0375501|&amp;gt;*)&#xD;
&#xD;
We now cluster our RNA data.  A two-tier hierarchical clustering of the data is performed, using a set of two classification vectors, $\{\{\text{classification vector}_1\},\{\text{classification vector}_2\}\}$ for each time series to cluster the data pairwise. The vectors are typically the output from `TimeSeriesClassification`. Similarities at each clustering tier are then computed using in succession from each time series first $\{\text{classification  vector}_1\}$, and subsequently $\{\text{classification vector}_2\}$ (which corresponds to the $\{\text{input data time series}\}$.  The main idea is that signals can have similarity based on the periodogram - which will not be able to detect phase differences, and subsequent clustering based on real values which should detect phase differences. The result is grouping of the data based on similarity, denoted as G#S#, where G denotes the group based on the first clustering, and S denotes the corresponding subgroup for that group. For example G2S3 denotes the 3rd subgroup of group 2.&#xD;
&#xD;
    rnaClusters = TimeSeriesClusters[rnaClassification, PrintDendrograms -&amp;gt; True]&#xD;
![enter image description here][27]&#xD;
&#xD;
For each class we can generate a dendrogram/heatmap plot, with groupings represented on the left, and highlighted to represent the grouping level. The G, S, columns represent the groupings and subgroupings generated by the clustering.  The legend shows the corresponding groupings and subgrouping, and the number of elements in each group subgroup.&#xD;
&#xD;
    TimeSeriesDendrogramsHeatmaps[rnaClusters]&#xD;
&#xD;
![DendrogramsHeamaps][28]&#xD;
&#xD;
##Annotation Enumeration&#xD;
&#xD;
We can carry out Gene Ontology analysis using for all the classes and groups/subgroups. We only report terms for which there are at least 3 members  (N.B. this may be a bit time consuming because of the number of tests running ~ few minutes). The output has enrichments for each class and group&#xD;
&#xD;
    goAnalysisRNA = GOAnalysis[rnaClusters, OntologyLengthFilter -&amp;gt; 3, ReportFilter -&amp;gt; 3 ]&#xD;
    Query[All, Keys]@goAnalysisRNA&#xD;
    (*&amp;lt;|&amp;#034;SpikeMax&amp;#034; -&amp;gt; {&amp;#034;G1S1&amp;#034;, &amp;#034;G1S2&amp;#034;, &amp;#034;G1S3&amp;#034;, &amp;#034;G1S4&amp;#034;, &amp;#034;G1S5&amp;#034;, &amp;#034;G1S6&amp;#034;, &#xD;
       &amp;#034;G1S7&amp;#034;, &amp;#034;G1S8&amp;#034;, &amp;#034;G1S9&amp;#034;, &amp;#034;G1S10&amp;#034;, &amp;#034;G1S11&amp;#034;, &amp;#034;G1S12&amp;#034;, &amp;#034;G1S13&amp;#034;, &#xD;
       &amp;#034;G1S14&amp;#034;}, &amp;#034;SpikeMin&amp;#034; -&amp;gt; {&amp;#034;G1S1&amp;#034;, &amp;#034;G2S1&amp;#034;, &amp;#034;G2S2&amp;#034;}, &#xD;
     &amp;#034;f1&amp;#034; -&amp;gt; {&amp;#034;G1S1&amp;#034;, &amp;#034;G1S2&amp;#034;, &amp;#034;G2S1&amp;#034;, &amp;#034;G2S2&amp;#034;}, &amp;#034;f2&amp;#034; -&amp;gt; {&amp;#034;G1S1&amp;#034;, &amp;#034;G2S1&amp;#034;}, &#xD;
     &amp;#034;f3&amp;#034; -&amp;gt; {&amp;#034;G1S1&amp;#034;, &amp;#034;G1S2&amp;#034;, &amp;#034;G2S1&amp;#034;}, &amp;#034;f4&amp;#034; -&amp;gt; {&amp;#034;G1S1&amp;#034;, &amp;#034;G1S2&amp;#034;}, &#xD;
     &amp;#034;f5&amp;#034; -&amp;gt; {&amp;#034;G1S1&amp;#034;, &amp;#034;G1S2&amp;#034;, &amp;#034;G2S1&amp;#034;}, &amp;#034;f6&amp;#034; -&amp;gt; {&amp;#034;G1S1&amp;#034;, &amp;#034;G1S2&amp;#034;}, &#xD;
     &amp;#034;f7&amp;#034; -&amp;gt; {&amp;#034;G1S1&amp;#034;, &amp;#034;G1S2&amp;#034;}|&amp;gt;*)&#xD;
&#xD;
We can view results for any of the groups (and also check out the behavior using the heatmaps generated in the previous section&#xD;
&#xD;
    Query[&amp;#034;SpikeMax&amp;#034;, &amp;#034;G1S1&amp;#034;]@goAnalysisRNA&#xD;
   &#xD;
![GOAnalysis][29]&#xD;
&#xD;
We can export the reports to excel spreadsheets, e.g.,&#xD;
    &#xD;
    EnrichmentReportExport[goAnalysisRNA, OutputDirectory -&amp;gt; $UserDocumentsDirectory, AppendString -&amp;gt; &amp;#034;GOAnalysisRNA&amp;#034;];&#xD;
&#xD;
We can also carry out KEGG: Kyoto Encyclopedia of Genes and Genomes pathway analysis for all the classes and groups/subgroups. We only report terms for which there are at least 2 members.  Please note again that this is a time consuming computation for a large set (few minutes).&#xD;
&#xD;
    keggAnalysisRNA = KEGGAnalysis[rnaClusters, ReportFilter -&amp;gt; 2];&#xD;
&#xD;
We can then view results for any of the groups (and also check out the behavior using the heatmaps generated in the previous section), e.g.:&#xD;
    &#xD;
    Query[&amp;#034;SpikeMax&amp;#034;, &amp;#034;G1S2&amp;#034;]@keggAnalysisRNA&#xD;
&#xD;
![KEGGPathways][30]&#xD;
&#xD;
Let us look at the genes in our data belonging to one of these pathways:&#xD;
    &#xD;
    pathwaymembers = &#xD;
     Query[&amp;#034;SpikeMax&amp;#034;, &amp;#034;G1S2&amp;#034;, 2, 3, 2, All, 1]@keggAnalysisRNA&#xD;
    (*{{&amp;#034;CCL2&amp;#034;, &amp;#034;RNA&amp;#034;}, {&amp;#034;MMP14&amp;#034;, &amp;#034;RNA&amp;#034;}, {&amp;#034;CXCL10&amp;#034;, &amp;#034;RNA&amp;#034;}} *)&#xD;
We can obtain a link to the KEGG pathway of interest:&#xD;
&#xD;
    KEGGPathwayVisual[&amp;#034;path:hsa04668&amp;#034;]&#xD;
    (*&amp;lt;|&amp;#034;Pathway&amp;#034; -&amp;gt; &amp;#034;path:hsa04668&amp;#034;, &amp;#034;Results&amp;#034; -&amp;gt; {&amp;#034;http://www.kegg.jp/kegg-bin/show_pathway?map=hsa04668&amp;#034;}|&amp;gt;*)&#xD;
&#xD;
And we can highlight the genes in the results in the pathway if we want (open the link in a browser to visualize):&#xD;
&#xD;
    KEGGPathwayVisual[&amp;#034;path:hsa04668&amp;#034;, MemberSet -&amp;gt; pathwaymembers]&#xD;
    (*&amp;lt;|&amp;#034;Pathway&amp;#034; -&amp;gt; &amp;#034;path:hsa04668&amp;#034;,&amp;#034;Results&amp;#034; -&amp;gt; {&amp;#034;http://www.kegg.jp/kegg-bin/show_pathway?map=hsa04668&amp;amp;multi_query=hsa%3A6347+%2380b2ff%2C%23000000%0D%0Ahsa%3A4323+%2380b2ff%2C%23000000%0D%0Ahsa%3A3627+%2380b2ff%2C%23000000%0D%0A&amp;#034;}|&amp;gt;*)&#xD;
    &#xD;
The figure can also be downloaded directly (not shown here due to copyright - please check if this is appropriate based on nature of your institution -academic vs. not with KEGG directly or read license distributed with MathIOmica):&#xD;
    &#xD;
    KEGGPathwayVisual[&amp;#034;path:hsa04668&amp;#034;, ResultsFormat -&amp;gt; &amp;#034;Figure&amp;#034;, &#xD;
     MemberSet -&amp;gt; pathwaymembers]&#xD;
&#xD;
&#xD;
  [1]: http://www.nature.com/articles/srep37237&#xD;
  [2]: http://georgemias.org&#xD;
  [3]: https://mathiomica.org&#xD;
  [4]: https://github.com/gmiaslab/mathiomica&#xD;
  [5]: https://en.wikipedia.org/wiki/Transcriptome&#xD;
  [6]: https://en.wikipedia.org/wiki/Proteomics &amp;#034;Proteomics&amp;#034;&#xD;
  [7]: https://www.nih.gov/research-training/allofus-research-program&#xD;
  [8]: https://www.r-project.org&#xD;
  [9]: https://www.python.org&#xD;
  [10]: https://www.bioconductor.org&#xD;
  [11]: http://biopython.org/wiki/Biopython&#xD;
  [12]: http://dx.doi.org/10.1007/s40484-013-0005-3&#xD;
  [13]: http://www.geneontology.org&#xD;
  [14]: http://www.genome.jp/kegg/pathway.html&#xD;
  [15]: http://dx.doi.org/10.1038/srep37237&#xD;
  [16]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Figure_1.jpg&amp;amp;userId=73070&#xD;
  [17]: http://dx.doi.org/10.1038/srep37237&#xD;
  [18]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Figure_2.jpg&amp;amp;userId=73070&#xD;
  [19]: http://dx.doi.org/10.1016/j.cell.2012.02.009&#xD;
  [20]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ExampleMathIOmica_OmicsObject.bmp&amp;amp;userId=73070&#xD;
  [21]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-12-12at4.44.05PM.png&amp;amp;userId=73070&#xD;
  [22]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-12-12at4.44.19PM.png&amp;amp;userId=73070&#xD;
  [23]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-12-14at10.19.11AM.png&amp;amp;userId=73070&#xD;
  [24]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-12-14at10.19.11AM.png&amp;amp;userId=73070&#xD;
  [25]: https://en.wikipedia.org/wiki/Least-squares_spectral_analysis&#xD;
  [26]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2016-12-14at12.35.02PM.png&amp;amp;userId=73070&#xD;
  [27]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ExampleMathIOmica.bmp&amp;amp;userId=73070&#xD;
  [28]: http://community.wolfram.com//c/portal/getImageAttachment?filename=6583ExampleMathIOmica2.bmp&amp;amp;userId=73070&#xD;
  [29]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ExampleMathIOmica3.bmp&amp;amp;userId=73070&#xD;
  [30]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ExampleMathIOmica4.bmp&amp;amp;userId=73070</description>
    <dc:creator>George Mias</dc:creator>
    <dc:date>2016-12-15T04:57:24Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2115501">
    <title>Wolfram Mineral Database - Composition of Different Atomic Elements</title>
    <link>https://community.wolfram.com/groups/-/m/t/2115501</link>
    <description># Proposal:&#xD;
&#xD;
*Wolfram&amp;#039;s mineral database is an interesting resource. In this work I will explore and account for the different chemical elements that are part of each mineral to perform an analysis as a whole. Here, the quantities of each element in each mineral will not be addressed, but only the different atomic elements in each mineral. Also, here in this work I exclude minerals that are formed by only 1 chemical element, that is, I consider only compound minerals. The analysis is done in two parts, the first part is an analysis without taking into account the water that may or may not be in the mineral, that is, the mineral completely dehydrated (only its composition that is linked by covalent bonds etc), the second part I analyze the minerals together with the water. In addition to having obtained a ranking of chemical elements in relation to all available minerals, in the end I get a percentage of how many minerals have oxygen and how many minerals have associated water in their composition.*&#xD;
&#xD;
# Database:&#xD;
&#xD;
Of course, Wolfram&amp;#039;s minerals database does not have all the minerals that exist, but it has a very decent amount, where we can make a very representative analysis. First we take the list of minerals in the database and calculate the number of entities:&#xD;
&#xD;
    minerals = EntityList[Entity[&amp;#034;Mineral&amp;#034;]];&#xD;
    Length@minerals&#xD;
&#xD;
![im1][1]&#xD;
&#xD;
Now we will associate each mineral with its chemical formula and, also obtain all the atomic symbols. This operation can take 2 to 3 hours to complete the download from Wolfram&amp;#039;s servers:&#xD;
&#xD;
    formulas = Map[#[&amp;#034;Formula&amp;#034;] &amp;amp;, minerals];&#xD;
    symbols = &#xD;
      Map[#[&amp;#034;AtomicSymbol&amp;#034;] &amp;amp;, EntityList[EntityClass[&amp;#034;Element&amp;#034;, All]]];&#xD;
&#xD;
To quickly make this information available for later use, we can save the data as an .mx file with the help of DumpSave:&#xD;
&#xD;
    filepath = FileNameJoin[{NotebookDirectory[], &amp;#034;formulas.mx&amp;#034;}];&#xD;
    filepath2 = FileNameJoin[{NotebookDirectory[], &amp;#034;symbols.mx&amp;#034;}];&#xD;
    DumpSave[filepath, {formulas}];&#xD;
    DumpSave[filepath2, {symbols}];&#xD;
    Quit[]&#xD;
&#xD;
That way we can retrieve the data for fast use whenever we want, using Get:&#xD;
&#xD;
    SetDirectory[NotebookDirectory[]];&#xD;
    Get[&amp;#034;formulas.mx&amp;#034;]&#xD;
    Get[&amp;#034;symbols.mx&amp;#034;]&#xD;
&#xD;
The definition of “symbols” below:&#xD;
&#xD;
    symbols&#xD;
&#xD;
![im2][2]&#xD;
&#xD;
Below is a simple function to have each mineral associated with its chemical formula in an easy way to visualize:&#xD;
&#xD;
    threadFormula[m_, n_] := &#xD;
      Thread[minerals[[m ;; n]] -&amp;gt; formulas[[m ;; n]]] // &#xD;
       Grid[Partition[#, 1], Frame -&amp;gt; All, Alignment -&amp;gt; Left] &amp;amp;;&#xD;
    &#xD;
    threadFormula[1000, 1010]&#xD;
&#xD;
![im3][3]&#xD;
&#xD;
# Data Excluding Water:&#xD;
&#xD;
Unfortunately the mineral formulas in the database are in a very complicated format to manipulate, as part is in String, part in Superscript, etc ... so we need to modify and alter the data in an intelligent way to obtain the formulas in a more computable form, at the same time we exclude water associated with minerals that have it:&#xD;
&#xD;
    a1 = {StringDelete[StringDelete[ToString[#], &amp;#034;{&amp;#034;], &amp;#034;}&amp;#034;]} &amp;amp; /@ &#xD;
       Table[Flatten@Apply[List, i, All], {i, formulas}];&#xD;
    a2 = Table[&#xD;
       StringDelete[&#xD;
        a1[[x]], {&amp;#034;(, H, 2, O, )&amp;#034;, &amp;#034;H, 2, O&amp;#034;, &#xD;
         &amp;#034; ScriptBaselineShifts&amp;#034; ~~ __}], {x, 1, Length@a1}];&#xD;
    &#xD;
    a2[[;; 10]]&#xD;
&#xD;
![im4][4]&#xD;
&#xD;
Now extracting the different chemical elements for each mineral and excluding the minerals formed by just one chemical element. Note that the number of minerals went from 3878 to 3778:&#xD;
&#xD;
    a3 = Union[#] &amp;amp; /@ &#xD;
       Flatten[StringCases[#, ReverseSortBy[symbols, Length]] &amp;amp; /@ a2, 1];&#xD;
    a4 = Table[If[Length@a3[[z]] &amp;gt; 1, a3[[z]], Nothing], {z, 1, Length@a3}]&#xD;
    Length@a4&#xD;
&#xD;
![im5][5]&#xD;
&#xD;
Finally, we can count the composition of different atomic elements that are part of all the minerals in the database. We can see that there are 70 different elements in this list:&#xD;
&#xD;
    a5 = Association[Reverse@SortBy[Normal@Counts@Flatten@a4, Last]]&#xD;
    Length@a5&#xD;
&#xD;
![im6][6]&#xD;
&#xD;
We can set up a Dataset with the elements and their position (ranking) that are part of all minerals for better visualization:&#xD;
&#xD;
    Transpose[&#xD;
      Partition[&#xD;
       Keys@# -&amp;gt; &#xD;
          Quantity[Position[Normal@a5, #][[1, 1]], &#xD;
           IndependentUnit[&amp;#034;position&amp;#034;]] &amp;amp; /@ Normal@a5 , 10]] // Dataset&#xD;
&#xD;
![im7][7]&#xD;
&#xD;
For the next parts of this work we have to define the two rules below:&#xD;
&#xD;
    rule1 = Thread[Flatten[Position[symbols, #] &amp;amp; /@ symbols] -&amp;gt; symbols];&#xD;
    rule2 = Join[{0 -&amp;gt; &amp;#034;Water&amp;#034;}, rule1];&#xD;
&#xD;
With some manipulation of the data, we can for example reorganize the elements in the order they are in the periodic table, that is, in the order of the atomic number, as well as other useful lists to create some graphs and analyzes:&#xD;
&#xD;
    b1 = Table[{Sort[Thread[{Keys@a5, Values@a5}]][[x, &#xD;
         1]], {Sort[Thread[{Keys@a5, Values@a5}]][[x, 2]]}}, {x, 1, &#xD;
        Length@a5}];&#xD;
    b2 = Table[&#xD;
       Entity[&amp;#034;Element&amp;#034;, b1[[x, 1]]][&amp;#034;AtomicNumber&amp;#034;], {x, 1, Length@b1}];&#xD;
    b3 = SortBy[Table[{b2[[x]], b1[[x, 2, 1]]}, {x, 1, Length@b2}], First];&#xD;
    b4 = Association@&#xD;
       Table[(b3[[x, 1]] /. rule1) -&amp;gt; b3[[x, 2]], {x, 1, Length@b3}];&#xD;
    b5 = Table[{b3[[x, 1]] /. rule1, b3[[x, 2]]}, {x, 1, Length@b3}];&#xD;
    b4&#xD;
&#xD;
![im8][8]&#xD;
&#xD;
The first plot we have is the different chemical elements that form all the minerals in decreasing order of quantity in which they appear in the whole:&#xD;
&#xD;
    ListPlot[Tooltip /@ a5, ImageSize -&amp;gt; 1000, PlotRange -&amp;gt; All, &#xD;
     Axes -&amp;gt; {None, Automatic}, GridLines -&amp;gt; {None, Automatic}]&#xD;
&#xD;
![im9][9]&#xD;
&#xD;
The next plot is the different chemical elements that make up all the mineral samples, but in the order of atomic number. This visualization is interesting because it relates to the periodic table:&#xD;
&#xD;
    ListLinePlot[&#xD;
     Callout[#[[2]], Style[{#}, 10, Red, Bold], CalloutStyle -&amp;gt; Red] &amp;amp; /@ &#xD;
      b5, ImageSize -&amp;gt; 1000, PlotRange -&amp;gt; All, &#xD;
     PlotMarkers -&amp;gt; {Automatic, Scaled[0.01]}, &#xD;
     GridLines -&amp;gt; {Table[{x, Dashed}, {x, 1, 70}], None}, &#xD;
     PlotStyle -&amp;gt; Thin]&#xD;
&#xD;
![im10][10]&#xD;
&#xD;
We can view it also in the form of WordCloud:&#xD;
&#xD;
    WordCloud[b5, ImageSize -&amp;gt; Large]&#xD;
&#xD;
![im11][11]&#xD;
&#xD;
# Result of Oxygen:&#xD;
&#xD;
To conclude the initial analysis, we can see in how many percent of the minerals that there is oxygen attached to the molecular structure in relation to all minerals. We see that this value can reach up to 80%:&#xD;
&#xD;
    &amp;#034;OxygenInTotal&amp;#034; -&amp;gt; Quantity[N[100*b4[&amp;#034;O&amp;#034;]/Length@a4], &amp;#034;Percent&amp;#034;]&#xD;
&#xD;
![im12][12]&#xD;
&#xD;
# Data with Water:&#xD;
&#xD;
With some differences in relation to the first part of this work, instead of excluding water, we can define a new water entity to be included in the formula of the minerals that contain it:&#xD;
&#xD;
    a2W = Table[&#xD;
       StringReplace[&#xD;
        a1[[x]], {&amp;#034;(, H, 2, O, )&amp;#034; -&amp;gt; &amp;#034;Water&amp;#034;, &amp;#034;H, 2, O&amp;#034; -&amp;gt; &amp;#034;Water&amp;#034;, &#xD;
         &amp;#034; ScriptBaselineShifts&amp;#034; ~~ __ -&amp;gt; &amp;#034;&amp;#034;}], {x, 1, Length@a1}];&#xD;
    &#xD;
    a2W[[;; 10]]&#xD;
&#xD;
![im13][13]&#xD;
&#xD;
With a similar code, with only a few differences, we do the same extraction of atomic symbols plus water in each mineral. Again, we exclude minerals formed by only 1 chemical element:&#xD;
&#xD;
    a3W = Union[#] &amp;amp; /@ &#xD;
       Flatten[StringCases[#, &#xD;
           ReverseSortBy[Join[symbols, {&amp;#034;Water&amp;#034;}], Length]] &amp;amp; /@ a2W, 1];&#xD;
    a4W = Table[&#xD;
      If[Length@a3W[[z]] &amp;gt; 1, a3W[[z]], Nothing], {z, 1, Length@a3W}]&#xD;
    Length@a4W&#xD;
&#xD;
![im14][14]&#xD;
&#xD;
And, again with some manipulation of the data, we created lists and associations to have the result in quantities (including water). Some of these definitions will also be used below to have some plots:&#xD;
&#xD;
    a5W = Association[Reverse@SortBy[Normal@Counts@Flatten@a4W, Last]];&#xD;
    a5W&#xD;
    Length@a5W&#xD;
    b1W = Table[{Sort[Thread[{Keys@a5W, Values@a5W}]][[x, &#xD;
         1]], {Sort[Thread[{Keys@a5W, Values@a5W}]][[x, 2]]}}, {x, 1, &#xD;
        Length@a5W}];&#xD;
    b2W = Table[&#xD;
        Entity[&amp;#034;Element&amp;#034;, b1W[[x, 1]]][&amp;#034;AtomicNumber&amp;#034;], {x, 1, &#xD;
         Length@b1W}] /. {Missing[&#xD;
          &amp;#034;UnknownEntity&amp;#034;, {&amp;#034;Element&amp;#034;, &amp;#034;Water&amp;#034;}] -&amp;gt; 0};&#xD;
    b3W = SortBy[Table[{b2W[[x]], b1W[[x, 2, 1]]}, {x, 1, Length@b2W}], &#xD;
       First];&#xD;
    b4W = Association@&#xD;
       Table[(b3W[[x, 1]] /. rule2) -&amp;gt; b3W[[x, 2]], {x, 1, Length@b3W}];&#xD;
    b5W = Table[{b3W[[x, 1]] /. rule2, b3W[[x, 2]]}, {x, 1, Length@b3W}];&#xD;
&#xD;
![im15][15]&#xD;
&#xD;
The water being included together with the decreasing order of the amounts of different chemical elements that are part of all minerals:&#xD;
&#xD;
    ListPlot[Tooltip /@ a5W, ImageSize -&amp;gt; 1000, PlotRange -&amp;gt; All, &#xD;
     Axes -&amp;gt; {None, Automatic}, GridLines -&amp;gt; {None, Automatic}]&#xD;
&#xD;
![im16][16]&#xD;
&#xD;
A plot similar to that of the first part of the work, in ascending order of atomic number, but including water and it appears before hydrogen (water defined as position 0) just for viewing:&#xD;
&#xD;
    ListLinePlot[&#xD;
     Callout[#[[2]], Style[{#}, 10, Red, Bold], CalloutStyle -&amp;gt; Red] &amp;amp; /@ &#xD;
      b5W, ImageSize -&amp;gt; 1000, PlotRange -&amp;gt; All, &#xD;
     PlotMarkers -&amp;gt; {Automatic, Scaled[0.01]}, &#xD;
     GridLines -&amp;gt; {Table[{x, Dashed}, {x, 1, 71}], None}, &#xD;
     PlotStyle -&amp;gt; Thin]&#xD;
&#xD;
![im17][17]&#xD;
&#xD;
Visualization using WordCloud including water:&#xD;
&#xD;
    WordCloud[a5W, ImageSize -&amp;gt; Large]&#xD;
&#xD;
![im18][18]&#xD;
&#xD;
# Result of Water:&#xD;
&#xD;
In the way below we calculate how many percent of minerals have water associated with its composition in relation to all available minerals. We can see that an expressive part of them have water (hydrated minerals), more than 1/3 of them:&#xD;
&#xD;
    &amp;#034;WaterInTotal&amp;#034; -&amp;gt; Quantity[N[100*a5W[&amp;#034;Water&amp;#034;]/Length@a4W], &amp;#034;Percent&amp;#034;]&#xD;
&#xD;
![im19][19]&#xD;
&#xD;
# Conclusion and Notes:&#xD;
&#xD;
- A significant amount of minerals have some oxygen in the chemical composition: 80% of them.&#xD;
&#xD;
- A good part of minerals have water associated with its molecule: 35% of them.&#xD;
&#xD;
It is worth mentioning that there may be some flaws in the exclusion and inclusion of water in the calculations, as for example, some organic minerals and some others may be erroneously influenced by the rules stipulated in this work. But it is a minority of these minerals, so although there is some variation in these percentages the value is satisfactorily approximate.&#xD;
&#xD;
In the future it would be interesting to also analyze the amounts of each chemical element in minerals and not only an analysis as presented here that only counts the different chemical elements. It proved difficult to do this type of analysis because the mineral formulas are in a complex format for computability.&#xD;
&#xD;
My personal opinion is: it is very interesting that in most minerals we can extract oxygen and water (more from the first than the second) with some physical-chemical treatment, sometimes this can be done in a simple way, sometimes in a complex way, but it demonstrates how there is enough oxygen and water inside the earth&amp;#039;s crust, and not only coming from the oceans, from the very formation of our planet.&#xD;
&#xD;
Thanks.&#xD;
&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1513im1.png&amp;amp;userId=1316061&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=9107im2.png&amp;amp;userId=1316061&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7916im3.png&amp;amp;userId=1316061&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=4965im4.png&amp;amp;userId=1316061&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7193im5.png&amp;amp;userId=1316061&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=8332im6.png&amp;amp;userId=1316061&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1159im7.png&amp;amp;userId=1316061&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7568im8.png&amp;amp;userId=1316061&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2146im9.png&amp;amp;userId=1316061&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1588im10.png&amp;amp;userId=1316061&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2712im11.png&amp;amp;userId=1316061&#xD;
  [12]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2750im12.png&amp;amp;userId=1316061&#xD;
  [13]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7119im13.png&amp;amp;userId=1316061&#xD;
  [14]: https://community.wolfram.com//c/portal/getImageAttachment?filename=3232im14.png&amp;amp;userId=1316061&#xD;
  [15]: https://community.wolfram.com//c/portal/getImageAttachment?filename=4654im15.png&amp;amp;userId=1316061&#xD;
  [16]: https://community.wolfram.com//c/portal/getImageAttachment?filename=im16.png&amp;amp;userId=1316061&#xD;
  [17]: https://community.wolfram.com//c/portal/getImageAttachment?filename=im17.png&amp;amp;userId=1316061&#xD;
  [18]: https://community.wolfram.com//c/portal/getImageAttachment?filename=im18.png&amp;amp;userId=1316061&#xD;
  [19]: https://community.wolfram.com//c/portal/getImageAttachment?filename=im19.png&amp;amp;userId=1316061</description>
    <dc:creator>Claudio Chaib</dc:creator>
    <dc:date>2020-11-15T23:14:04Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2429832">
    <title>Percolation theory reveals biophysical properties of virus-like particles</title>
    <link>https://community.wolfram.com/groups/-/m/t/2429832</link>
    <description>*WOLFRAM MATERIALS for the ARTICLE:*&#xD;
&amp;gt; Brunk, N.E., Twarock, R.&#xD;
&#xD;
&amp;gt; Percolation Theory Reveals Biophysical Properties of Virus-like Particles.&#xD;
&#xD;
&amp;gt; ACS Nano 2021, 15, 8, 12988&amp;#x2013;12995&#xD;
&#xD;
&amp;gt; https://doi.org/10.1021/acsnano.1c01882&#xD;
&#xD;
&amp;gt; [Full article in PDF][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://pubs.acs.org/doi/pdf/10.1021/acsnano.1c01882&#xD;
  [2]: https://www.wolframcloud.com/obj/0abc0e85-7445-4b0b-a3df-1a4ec57f1da7</description>
    <dc:creator>Nicholas Brunk</dc:creator>
    <dc:date>2021-12-21T15:33:59Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/828033">
    <title>It&amp;#039;s raining crystal structures: Cloud-based VASP viewer</title>
    <link>https://community.wolfram.com/groups/-/m/t/828033</link>
    <description>You may remember that I&amp;#039;ve already posted [packages for crystal structure plots][1]. I just wanted to dump a piece of code here that&amp;#039;s based on these packages and will let you plot crystal structures from [VASP][2] input/output files on a webpage... in case anyone else is using VASP.&#xD;
&#xD;
For anyone who wants to try the app but doesn&amp;#039;t have a VASP file handy, here&amp;#039;s a sample you can copy and paste into a plain text file:&#xD;
&#xD;
    Rutile&#xD;
       1.00000000000000     &#xD;
         4.5937300000000000    0.0000000000000000    0.0000000000000000&#xD;
         0.0000000000000000    4.5937300000000000    0.0000000000000000&#xD;
         0.0000000000000000    0.0000000000000000    2.9581200000000000&#xD;
       Ti    O&#xD;
         2     4&#xD;
    Direct&#xD;
      0.0000000000000000  0.0000000000000000  0.0000000000000000&#xD;
      0.5000000000000000  0.5000000000000000  0.5000000000000000&#xD;
      0.3053000000000000  0.3053000000000000  0.0000000000000000&#xD;
      0.6947000000000000  0.6947000000000000  0.0000000000000000&#xD;
      0.8053000000000000  0.1947000000000000  0.5000000000000000&#xD;
      0.1947000000000000  0.8053000000000000  0.5000000000000000&#xD;
    &#xD;
The actual code is below the image. Have fun!&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
    CloudDeploy[FormFunction[{&#xD;
       {{&amp;#034;file&amp;#034;, &amp;#034;Upload a VASP POSCAR or CONTCAR file here:&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;UploadedFile&amp;#034;|&amp;gt;}, {&#xD;
        {&amp;#034;sysdim&amp;#034;, &amp;#034;Periodic repetitions&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &#xD;
           Restricted[&#xD;
            DelimitedSequence[&amp;#034;Integer&amp;#034;, &#xD;
             &amp;#034; &amp;#034; | &amp;#034;,&amp;#034; | &amp;#034;;&amp;#034; | &amp;#034;/&amp;#034; | &amp;#034;x&amp;#034; | &amp;#034;X&amp;#034;], 3], &amp;#034;Input&amp;#034; -&amp;gt; &amp;#034;1x1x1&amp;#034;|&amp;gt;,&#xD;
        {&amp;#034;retractq&amp;#034;, &amp;#034;Retract atoms to cell?&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;Boolean&amp;#034;, &amp;#034;Input&amp;#034; -&amp;gt; False|&amp;gt;,&#xD;
        {&amp;#034;addq&amp;#034;, &amp;#034;Add periodic duplicates of atoms?&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;Boolean&amp;#034;, &amp;#034;Input&amp;#034; -&amp;gt; False|&amp;gt;,&#xD;
        {&amp;#034;atomrad&amp;#034;, &amp;#034;Atom radius&amp;#034;} -&amp;gt; &amp;lt;|&amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;ComputedReal&amp;#034;, &#xD;
          &amp;#034;Input&amp;#034; -&amp;gt; 0.4|&amp;gt;,&#xD;
        {&amp;#034;bonddist&amp;#034;, &amp;#034;Maximum bond length&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;ComputedReal&amp;#034;, &amp;#034;Input&amp;#034; -&amp;gt; 2.1|&amp;gt;,&#xD;
        {&amp;#034;monobond&amp;#034;, &amp;#034;Want to pick your own bond color?&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;Boolean&amp;#034;, &amp;#034;Input&amp;#034; -&amp;gt; False|&amp;gt;,&#xD;
        {&amp;#034;bondcol&amp;#034;, &amp;#034;Bond color&amp;#034;} -&amp;gt; &amp;lt;|&amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;ComputedColor&amp;#034;, &#xD;
          &amp;#034;Input&amp;#034; -&amp;gt; GrayLevel[.8]|&amp;gt;,&#xD;
        {&amp;#034;bondrad&amp;#034;, &amp;#034;Bond radius&amp;#034;} -&amp;gt; &amp;lt;|&amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;ComputedReal&amp;#034;, &#xD;
          &amp;#034;Input&amp;#034; -&amp;gt; 0.1|&amp;gt;,&#xD;
        {&amp;#034;linecol&amp;#034;, &amp;#034;Cell outline color&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;ComputedColor&amp;#034;, &amp;#034;Input&amp;#034; -&amp;gt; Black|&amp;gt;,&#xD;
        {&amp;#034;linerad&amp;#034;, &amp;#034;Cell outline radius&amp;#034;} -&amp;gt; &amp;lt;|&#xD;
          &amp;#034;Interpreter&amp;#034; -&amp;gt; &amp;#034;ComputedReal&amp;#034;, &amp;#034;Input&amp;#034; -&amp;gt; 0.02|&amp;gt;&#xD;
        }},&#xD;
      &#xD;
      Module[{file, sysdim, retractq, addq, atomrad, bonddist, monobond, &#xD;
         bondcol, bondrad, linecol, linerad,&#xD;
         data, speciesQ, atomcol, chemoffset, chgoffset, lattscale, &#xD;
         lattvec, coord, conf, coordP, confP, new, tubearrow, lines, &#xD;
         atoms, tuples, bonds},&#xD;
        &#xD;
        file = #file;&#xD;
        sysdim = #sysdim;&#xD;
        retractq = #retractq;&#xD;
        addq = #addq;&#xD;
        atomrad = #atomrad;&#xD;
        bonddist = #bonddist;&#xD;
        monobond = #monobond;&#xD;
        bondcol = #bondcol;&#xD;
        bondrad = #bondrad;&#xD;
        linecol = #linecol;&#xD;
        linerad = #linerad;&#xD;
        &#xD;
        (*import: *)&#xD;
        data = Import[file, &amp;#034;Table&amp;#034;];&#xD;
        (*offset if chemical species are given: *)&#xD;
        speciesQ = MatchQ[data[[6]], {_String ..}];&#xD;
        atomcol[type_] := &#xD;
         If[speciesQ, ColorData[&amp;#034;Atoms&amp;#034;, data[[6, type]]], &#xD;
          ColorData[97, type]];&#xD;
        chemoffset = If[speciesQ, 1, 0];&#xD;
        (*offset for missing &amp;#034;Selective Dynamics&amp;#034; line as is common in \&#xD;
    CHG/CHGCAR: *)&#xD;
        chgoffset = &#xD;
         If[TrueQ[Length[data[[chemoffset + 8]]] &amp;gt; 0] &amp;amp;&amp;amp; &#xD;
           MatchQ[data[[chemoffset + 8, 1]], _?NumericQ], -1, 0];&#xD;
        &#xD;
        (*lattice vectors and atoms: *)&#xD;
        lattvec = data[[3 ;; 5]];&#xD;
        lattscale = data[[2]];&#xD;
        If[TrueQ[Length[lattscale] == 1], lattscale = lattscale[[1]]];&#xD;
        If[TrueQ[Sign[lattscale] == -1], &#xD;
         lattscale = (-lattscale/Det[lattvec])^(1/3)];&#xD;
        lattvec = &#xD;
         If[TrueQ[Length[lattscale] == 3], &#xD;
          N[lattscale[[#]]*lattvec[[#]]] &amp;amp; /@ Range[3], &#xD;
          N[lattscale*lattvec]];&#xD;
        conf = &#xD;
         Flatten[Join[&#xD;
           ConstantArray[#, data[[chemoffset + 6, #]]] &amp;amp; /@ &#xD;
            Range[Length[data[[chemoffset + 6]]]]]];&#xD;
        coord = &#xD;
         N[data[[chemoffset + chgoffset + &#xD;
              9 ;; (chemoffset + chgoffset + 8 + &#xD;
               Total[data[[chemoffset + 6]]]), 1 ;; 3]]];&#xD;
        &#xD;
        (*reprojection for cartesian coordinates: *)&#xD;
        If[TrueQ[Length[data[[chemoffset + chgoffset + 8]]] &amp;gt; 0] &amp;amp;&amp;amp; &#xD;
          StringMatchQ[ToString[data[[chemoffset + chgoffset + 8, 1]]], &#xD;
           &amp;#034;c*&amp;#034; | &amp;#034;k*&amp;#034;, IgnoreCase -&amp;gt; True],&#xD;
         If[TrueQ[Length[lattscale] == 3], coord = #*lattscale &amp;amp; /@ coord,&#xD;
           coord = coord*lattscale];&#xD;
         coord = coord.Inverse[lattvec]];&#xD;
        {coordP, confP} = {coord, conf};&#xD;
        &#xD;
        (*retraction, moving all atoms back into the cell: *)&#xD;
        If[retractq, With[{retracttol = 10^-4},&#xD;
          coordP = &#xD;
           Partition[&#xD;
            If[# &amp;gt; (1 - retracttol), # - 1, #] &amp;amp; /@ &#xD;
             Flatten[# - Floor[#] &amp;amp; /@ coordP], 3];&#xD;
          new = DeleteDuplicates[Transpose[{coordP, confP}],&#xD;
            (Norm[&#xD;
                 Round[#1[[1]], retracttol] - Round[#2[[1]], retracttol] -&#xD;
                   Floor[Round[#1[[1]], retracttol]] + &#xD;
                  Floor[Round[#2[[1]], retracttol]]] &amp;lt; &#xD;
                retracttol) &amp;amp;&amp;amp; (#1[[2]] == #2[[2]]) &amp;amp;];&#xD;
          {coordP, confP} = Transpose[new]]];&#xD;
        &#xD;
        (*periodic repetition: *)&#xD;
        coordP = &#xD;
         Flatten[Table[(# + {a, b, c}) &amp;amp; /@ coordP, {a, 0, &#xD;
            sysdim[[1]] - 1}, {b, 0, sysdim[[2]] - 1}, {c, 0, &#xD;
            sysdim[[3]] - 1}], 3];&#xD;
        confP = Flatten[ConstantArray[confP, Times @@ sysdim]];&#xD;
        &#xD;
        (*add peridic duplicates if desired: *)&#xD;
        If[TrueQ[addq],&#xD;
         new = Transpose[{coordP, confP}];&#xD;
         new = &#xD;
          Join[new, # + {{sysdim[[1]], 0, 0}, 0} &amp;amp; /@ &#xD;
            Select[new, &#xD;
             Abs[#[[1, 1]]] &amp;lt; 0.01 &amp;amp;], # + {{-sysdim[[1]], 0, 0}, 0} &amp;amp; /@ &#xD;
            Select[new, Abs[#[[1, 1]]] &amp;gt; 0.99*sysdim[[1]] &amp;amp;]];&#xD;
         new = &#xD;
          Join[new, # + {{0, sysdim[[2]], 0}, 0} &amp;amp; /@ &#xD;
            Select[new, &#xD;
             Abs[#[[1, 2]]] &amp;lt; 0.01 &amp;amp;], # + {{0, -sysdim[[2]], 0}, 0} &amp;amp; /@ &#xD;
            Select[new, Abs[#[[1, 2]]] &amp;gt; 0.99*sysdim[[2]] &amp;amp;]];&#xD;
         new = &#xD;
          Join[new, # + {{0, 0, sysdim[[3]]}, 0} &amp;amp; /@ &#xD;
            Select[new, &#xD;
             Abs[#[[1, 3]]] &amp;lt; 0.01 &amp;amp;], # + {{0, 0, -sysdim[[3]]}, 0} &amp;amp; /@ &#xD;
            Select[new, Abs[#[[1, 3]]] &amp;gt; 0.99*sysdim[[3]] &amp;amp;]];&#xD;
         {coordP, confP} = Transpose[new];&#xD;
         ];&#xD;
        &#xD;
        (*cell lines: *)&#xD;
        tubearrow[{tail_, head_}] := &#xD;
         With[{scale = .5*Sqrt[Mean[Norm /@ lattvec]*linerad]},&#xD;
          Tube[{tail, head - 4*scale*Normalize[head - tail], &#xD;
            head - 4*scale*Normalize[head - tail], head}, {linerad, &#xD;
            linerad, scale, 0}]];&#xD;
        lines = {linecol, Tube[#.lattvec, linerad] &amp;amp; /@ {&#xD;
            {{0, 0, #}, {1, 0, #}, {1, 1, #}, {0, 1, #}, {0, &#xD;
                0, #}} &amp;amp; /@ {0, 1},&#xD;
            {{0, 0, #} &amp;amp; /@ {0, 1}, {1, 0, #} &amp;amp; /@ {0, &#xD;
               1}, {1, 1, #} &amp;amp; /@ {0, 1}, {0, 1, #} &amp;amp; /@ {0, 1}}&#xD;
            }, tubearrow[{{0, 0, 0}, #}] &amp;amp; /@ lattvec};&#xD;
        &#xD;
        (*atoms: *)&#xD;
        atoms = &#xD;
         Tooltip[{atomcol[confP[[#]]], &#xD;
             Sphere[coordP[[#]].lattvec, atomrad]}, #] &amp;amp; /@ &#xD;
          Range[Length[confP]];&#xD;
        &#xD;
        (*bonds: *)&#xD;
        tuples = &#xD;
         Select[Subsets[Range[Length[confP]], {2}], &#xD;
          Norm[(coordP[[#]].lattvec)[[1]] - (coordP[[#]].lattvec)[[2]]] &amp;lt; &#xD;
            bonddist &amp;amp;];&#xD;
        bonds = If[TrueQ[tuples == {}], {},&#xD;
          If[monobond,&#xD;
             {bondcol, Tube[coordP[[#]].lattvec, bondrad]},&#xD;
             Table[{atomcol[confP[[#[[ii]]]]], &#xD;
               Tube[{coordP[[#[[ii]]]].lattvec, &#xD;
                 Total[coordP[[#]].lattvec]*.5}, bondrad]}, {ii, 1, 2}]&#xD;
             ] &amp;amp; /@ tuples];&#xD;
        &#xD;
        (*return the plot: *)&#xD;
        Graphics3D[{lines, bonds, atoms}, ImageSize -&amp;gt; Large, &#xD;
         BaseStyle -&amp;gt; {Specularity[Gray, 100]}, Boxed -&amp;gt; False, &#xD;
         SphericalRegion -&amp;gt; True, Lighting -&amp;gt; &amp;#034;Neutral&amp;#034;]&#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;Crystal Structure Viewer for VASP&amp;#034;|&amp;gt;], &#xD;
     Permissions -&amp;gt; &amp;#034;Public&amp;#034;]&#xD;
&#xD;
&#xD;
 [at0]: http://community.wolfram.com/web/chrishaydock137&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com/groups/-/m/t/787142&#xD;
  [2]: http://vasp.at/&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=sdf4562y4thrwbdfva.gif&amp;amp;userId=11733</description>
    <dc:creator>Bianca Eifert</dc:creator>
    <dc:date>2016-03-23T08:59:33Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3242770">
    <title>Wolfram U Webinar Series: New in Wolfram 14.1</title>
    <link>https://community.wolfram.com/groups/-/m/t/3242770</link>
    <description>![enter image description here][1]&#xD;
&#xD;
Starting tomorrow, August 7, Wolfram U will hosting a weekly webinar series showcasing much of the new and improved functionality present in Version 14.1 of Wolfram Language. The first webinar will provide a broad overview of this release and subsequent versions will delve into detailed subareas like new mathematics functionality, improvements to the compiler, new astronomical and chemical visualizations, AI and LLMs and more. These sessions will be headed by developers from their respective fields, providing you with a unique opportunity to get a look at all of these topics straight from the source.&#xD;
&#xD;
The schedule is as follows:&#xD;
&#xD;
**August 7, 2024:** *An Overview of What&amp;#039;s New and Improved in Version 14.1*&#xD;
&#xD;
This first session in the New in Wolfram 14.1 webinar series paints a big picture of the new release with special attention to Chat Notebooks, LLM functionality and the latest Wolfram tools for AI systems.&#xD;
&#xD;
**August 14, 2024:** *Mathematical Computation in Version 14.1*&#xD;
&#xD;
This session begins with an overview of the latest mathematical functionality in the new release and the new world of symbolic-dimensional arrays, stability analysis of dynamical systems and advances in PDE modeling.&#xD;
&#xD;
**August 21, 2024:** *Updates for the Wolfram Compiler, System Modeler and External Language Integration*&#xD;
&#xD;
This session covers performance updates for the Wolfram Compiler, what&amp;#039;s new in System Modeler and the latest in external language integration. &#xD;
&#xD;
**August 28, 2024:** Visualizing and Computing Astronomical and Chemical Data and Historical Geography&#xD;
&#xD;
This session brings you experts sharing incredible advancements for computation with astronomical data, symbolic representation of 3D biomolecules and historical geography.&#xD;
&#xD;
**September 4, 2024:** New and Powerful Components for AI and LLMs&#xD;
&#xD;
In this webinar, you&amp;#039;ll learn about Wolfram tools for AI, including connections and prompt engineering for large language models (LLMs), improvements in speech recognition and new video and audio processing functionality.&#xD;
&#xD;
These sessions are running for the next five Wednesdays at 11:00 AM Central US time. &#xD;
&#xD;
You can register for this five-part series [**HERE.**][2]&#xD;
&#xD;
We hope to see you there! (And if you can&amp;#039;t make the live sessions, registering means that you&amp;#039;ll receive a link to the recordings after each session right in your email!)&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=M14.1-WU.png&amp;amp;userId=1711324&#xD;
  [2]: https://www.bigmarker.com/series/new-in-wolfram-language-14-1/series_details?utm_bmcr_source=community</description>
    <dc:creator>Arben Kalziqi</dc:creator>
    <dc:date>2024-08-06T21:56:05Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2731070">
    <title>An Introduction to Isomer Generation with Wolfram Language</title>
    <link>https://community.wolfram.com/groups/-/m/t/2731070</link>
    <description>&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/cc77d065-e5fe-4f61-9b65-f65a5a4e5366</description>
    <dc:creator>Theodore Mollano</dc:creator>
    <dc:date>2022-12-15T19:23:25Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2068787">
    <title>Organic Chemistry 2: representing chemical reactions</title>
    <link>https://community.wolfram.com/groups/-/m/t/2068787</link>
    <description>This work is part of series of other posts avaialble here:&#xD;
&#xD;
- 1st post: [Organic Chemistry 1: Modeling Synthesis as Graphs][1]&#xD;
&#xD;
- 3rd post: [Organic Chemistry 3: Progress in Multi-Step Chemical Synthesis][2]&#xD;
&#xD;
----&#xD;
&#xD;
I post this in case anyone is interested in experimenting further along these lines, or in collaborating with me on an organic synthesis related project. This notebook shows my representation of various organic chemical reactions in Wolfram Language.&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][3]&#xD;
&#xD;
  [Original]: https://www.wolframcloud.com/obj/wolfram-community/Published/OrgSynProject.nb&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com/groups/-/m/t/2073460&#xD;
  [2]: https://community.wolfram.com/groups/-/m/t/2071550&#xD;
  [3]: https://www.wolframcloud.com/obj/d25cd622-0699-461b-8652-425dc974e99d</description>
    <dc:creator>Leonardo Cabana</dc:creator>
    <dc:date>2020-09-01T13:44:29Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1835986">
    <title>Vitamins: chemical data, visualization, foods and nutritional info</title>
    <link>https://community.wolfram.com/groups/-/m/t/1835986</link>
    <description># Summary&#xD;
&#xD;
In this post I will show how to create a function called **VitaminData[ ]** using information available in the Wolfram Knowledgebase. This custom function will provide chemical and physical data, molecule visualizations, lists of food sources rich on a specific vitamin and other nutritional data.&#xD;
&#xD;
&#xD;
&#xD;
# Function, data, uses:&#xD;
&#xD;
- **List**&#xD;
&#xD;
&#xD;
By way of comparison, the vitamins in the list of entities:&#xD;
&#xD;
    EntityList@EntityClass[&amp;#034;Chemical&amp;#034;, &amp;#034;Vitamins&amp;#034;]&#xD;
&#xD;
![i1][1]&#xD;
&#xD;
The function I created has an extended list of vitamins, of course some are questionable and/or old definitions, but I found it interesting to add to the function for didactic reasons and to make the study more complete.&#xD;
&#xD;
    VitaminData[&amp;#034;List&amp;#034;]&#xD;
&#xD;
![i2][2]&#xD;
&#xD;
- **Show**&#xD;
&#xD;
Using the function more simply we get the vitamin in the form of entity:&#xD;
&#xD;
    VitaminData[&amp;#034;A&amp;#034;]&#xD;
&#xD;
![i3][3]&#xD;
&#xD;
With the optional Show we have several options, one of them is the 2D model:&#xD;
&#xD;
    VitaminData[&amp;#034;B12&amp;#034;, &amp;#034;Show&amp;#034; -&amp;gt; &amp;#034;Model2D&amp;#034;]&#xD;
&#xD;
![i4][4]&#xD;
&#xD;
Using Show for the 3D model:&#xD;
&#xD;
    VitaminData[&amp;#034;B12&amp;#034;, &amp;#034;Show&amp;#034; -&amp;gt; &amp;#034;Model3D&amp;#034;]&#xD;
&#xD;
![i5][5]&#xD;
&#xD;
We can visualize each bond in the molecule with &amp;#034;Show&amp;#034; and &amp;#034;Bonds&amp;#034;:&#xD;
&#xD;
    VitaminData[&amp;#034;B5&amp;#034;, &amp;#034;Show&amp;#034; -&amp;gt; &amp;#034;Bonds&amp;#034;]&#xD;
&#xD;
![i6][6]&#xD;
&#xD;
We can count atoms and show their respective charges with &amp;#034;Show&amp;#034; and &amp;#034;Atoms&amp;#034;:&#xD;
&#xD;
    VitaminData[&amp;#034;B12&amp;#034;, &amp;#034;Show&amp;#034; -&amp;gt; &amp;#034;Atoms&amp;#034;]&#xD;
&#xD;
![i7][7]&#xD;
&#xD;
To have the complete list of properties available in the optional Show, use Properties:&#xD;
&#xD;
    VitaminData[&amp;#034;A&amp;#034;, &amp;#034;Show&amp;#034; -&amp;gt; &amp;#034;Properties&amp;#034;]&#xD;
&#xD;
![i8][8]&#xD;
&#xD;
For example, the molecular mass:&#xD;
&#xD;
    VitaminData[&amp;#034;H&amp;#034;, &amp;#034;Show&amp;#034; -&amp;gt; &amp;#034;MolecularMass&amp;#034;]&#xD;
&#xD;
![i9][9]&#xD;
&#xD;
Another example of one of the properties from the list above is NFPALabel:&#xD;
&#xD;
    VitaminData[&amp;#034;K1&amp;#034;, &amp;#034;Show&amp;#034; -&amp;gt; &amp;#034;NFPALabel&amp;#034;]&#xD;
&#xD;
![i10][10]&#xD;
&#xD;
With the optional Show and Data, **all** properties of the above list are shown at once, interactively:&#xD;
&#xD;
    VitaminData[&amp;#034;C&amp;#034;, &amp;#034;Show&amp;#034; -&amp;gt; &amp;#034;Data&amp;#034;]&#xD;
&#xD;
![i11][11]&#xD;
&#xD;
- **Food**&#xD;
&#xD;
Another function option is Food, where the relative amount of each vitamin in a specific food is determined:&#xD;
&#xD;
    VitaminData[&amp;#034;C&amp;#034;, &amp;#034;Food&amp;#034; -&amp;gt; &amp;#034;Banana&amp;#034;]&#xD;
&#xD;
![i12][12]&#xD;
&#xD;
If we use the function only with Food, without naming the vitamin, the full list of vitamins for a specific food is shown:&#xD;
&#xD;
    VitaminData[&amp;#034;Food&amp;#034; -&amp;gt; &amp;#034;Apple&amp;#034;]&#xD;
&#xD;
![i13][13]&#xD;
&#xD;
- **Nutritional Information**&#xD;
&#xD;
Another option for the function is Nutri, which is the nutritional information of foods in label form. Below is the example for four types of foods:&#xD;
&#xD;
    Table[VitaminData[&#xD;
      &amp;#034;Nutri&amp;#034; -&amp;gt; n], {n, {&amp;#034;Banana&amp;#034;, &amp;#034;Carrot&amp;#034;, &amp;#034;Shrimp&amp;#034;, &amp;#034;Salmon&amp;#034;}}]&#xD;
&#xD;
![i14][14]&#xD;
&#xD;
# Code&#xD;
&#xD;
- **Code of the function *VitaminData[]***:&#xD;
&#xD;
        VitaminData[&amp;#034;List&amp;#034;] := VitaminData[&amp;#034;A&amp;#034;, &amp;#034;Show&amp;#034; -&amp;gt; &amp;#034;List&amp;#034;];&#xD;
        VitaminData[vita_, OptionsPattern[]] := &#xD;
         Module[{Vitamin, vitamins, ss, cc, a0, a1, a2, a3, a4, a5, a6, a7, &#xD;
           ai}, Options[VitaminData] = {&amp;#034;Show&amp;#034; -&amp;gt; &amp;#034;Entity&amp;#034;}; &#xD;
          ss = {&amp;#034;A&amp;#034;, &amp;#034;B1&amp;#034;, &amp;#034;B2&amp;#034;, &amp;#034;B3&amp;#034;, &amp;#034;B4&amp;#034;, &amp;#034;B5&amp;#034;, &amp;#034;B6&amp;#034;, &amp;#034;B12&amp;#034;, &amp;#034;C&amp;#034;, &amp;#034;D2&amp;#034;, &#xD;
            &amp;#034;D3&amp;#034;, &amp;#034;H&amp;#034;, &amp;#034;H1&amp;#034;, &amp;#034;K1&amp;#034;, &amp;#034;K3&amp;#034;, &amp;#034;K5&amp;#034;, &amp;#034;M&amp;#034;, &amp;#034;P&amp;#034;, &amp;#034;AlphaTocopherol&amp;#034;, &#xD;
            &amp;#034;DAlphaTocopherol&amp;#034;, &amp;#034;Niacin&amp;#034;, &amp;#034;Choline&amp;#034;}; &#xD;
          Vitamin[vit_] := (vitamins = &#xD;
             Join[Table[&#xD;
               Entity[&amp;#034;Chemical&amp;#034;, &#xD;
                StringJoin[&amp;#034;Vitamin&amp;#034;, i]], {i, {&amp;#034;A&amp;#034;, &amp;#034;B1&amp;#034;, &amp;#034;B2&amp;#034;, &amp;#034;B3&amp;#034;, &amp;#034;B4&amp;#034;, &#xD;
                 &amp;#034;B5&amp;#034;, &amp;#034;B6&amp;#034;, &amp;#034;B12&amp;#034;, &amp;#034;C&amp;#034;, &amp;#034;D2&amp;#034;, &amp;#034;D3&amp;#034;, &amp;#034;H&amp;#034;, &amp;#034;H1&amp;#034;, &amp;#034;K1&amp;#034;, &amp;#034;K3&amp;#034;, &#xD;
                 &amp;#034;K5&amp;#034;, &amp;#034;M&amp;#034;, &amp;#034;P&amp;#034;}}], &#xD;
              Table[Entity[&amp;#034;Chemical&amp;#034;, &#xD;
                j], {j, {&amp;#034;AlphaTocopherol&amp;#034;, &amp;#034;DAlphaTocopherol&amp;#034;, &amp;#034;Niacin&amp;#034;, &#xD;
                 &amp;#034;Choline&amp;#034;}}]]; cc = vit /. AssociationThread[ss, Range@22]; &#xD;
            vitamins[[cc]]); a0 = Thread[{ss, Vitamin[All]}]; &#xD;
          a1 = Vitamin[vita]; &#xD;
          a2 = Dataset[&#xD;
            EntityValue[Vitamin[vita], &#xD;
             EntityValue[Vitamin[vita], &amp;#034;Properties&amp;#034;], &#xD;
             &amp;#034;PropertyAssociation&amp;#034;]]; &#xD;
          a3 = MoleculePlot[Vitamin[vita], ImageSize -&amp;gt; Large]; &#xD;
          a4 = MoleculePlot3D[Vitamin[vita], ImageSize -&amp;gt; Large];&#xD;
          a5 = BondList@Vitamin[vita]; a6 = Counts@AtomList@Vitamin[vita];&#xD;
          a7 = Thread[{Map[Text[Style[#, Small]] &amp;amp;, &#xD;
              DeleteCases[&#xD;
               StringReplace[&#xD;
                 StringDelete[&#xD;
                  EntityValue[Entity[&amp;#034;Chemical&amp;#034;, &amp;#034;VitaminA&amp;#034;], &amp;#034;Properties&amp;#034;] //&#xD;
                     InputForm // ToString, {&amp;#034;EntityProperty[&amp;#034;, &amp;#034;Chemical&amp;#034;, &#xD;
                   &amp;#034;]&amp;#034;}], {FromCharacterCode[32] -&amp;gt; &amp;#034;&amp;#034;}] // ToExpression, &#xD;
               &amp;#034;&amp;#034;]], EntityValue[Entity[&amp;#034;Chemical&amp;#034;, &amp;#034;VitaminA&amp;#034;], &#xD;
              &amp;#034;Properties&amp;#034;]}]; &#xD;
          ai = EntityValue[Vitamin[vita], OptionValue[&amp;#034;Show&amp;#034;]]; &#xD;
          If[MemberQ[{&amp;#034;List&amp;#034;, &amp;#034;Entity&amp;#034;, &amp;#034;Data&amp;#034;, &amp;#034;Model2D&amp;#034;, &amp;#034;Model3D&amp;#034;, &amp;#034;Bonds&amp;#034;,&#xD;
               &amp;#034;Atoms&amp;#034;, &amp;#034;Mass&amp;#034;, &amp;#034;Properties&amp;#034;}, OptionValue[&amp;#034;Show&amp;#034;]] == True, &#xD;
           OptionValue[&amp;#034;Show&amp;#034;] /. {&amp;#034;List&amp;#034; -&amp;gt; a0, &amp;#034;Entity&amp;#034; -&amp;gt; a1, &amp;#034;Data&amp;#034; -&amp;gt; a2,&#xD;
              &amp;#034;Model2D&amp;#034; -&amp;gt; a3, &amp;#034;Model3D&amp;#034; -&amp;gt; a4, &amp;#034;Bonds&amp;#034; -&amp;gt; a5, &amp;#034;Atoms&amp;#034; -&amp;gt; a6, &#xD;
             &amp;#034;Properties&amp;#034; -&amp;gt; a7}, ai]]&#xD;
        VitaminData[&amp;#034;Nutri&amp;#034; -&amp;gt; al_] := {Entity[&amp;#034;FoodType&amp;#034;, al], &#xD;
           Entity[&#xD;
             &amp;#034;Food&amp;#034;, {EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;FoodType&amp;#034;] -&amp;gt; &#xD;
               ContainsExactly[{Entity[&amp;#034;FoodType&amp;#034;, al]}], &#xD;
              EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;AddedFoodTypes&amp;#034;] -&amp;gt; &#xD;
               ContainsExactly[{}]}][&#xD;
            EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;NutritionLabel&amp;#034;]]};&#xD;
        VitaminData[x_, &amp;#034;Food&amp;#034; -&amp;gt; y_] := &#xD;
         Module[{bb}, &#xD;
          bb = Entity[&#xD;
             &amp;#034;Food&amp;#034;, {EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;FoodType&amp;#034;] -&amp;gt; &#xD;
               ContainsExactly[{Entity[&amp;#034;FoodType&amp;#034;, y]}], &#xD;
              EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;AddedFoodTypes&amp;#034;] -&amp;gt; &#xD;
               ContainsExactly[{}]}][&#xD;
            EntityProperty[&amp;#034;Food&amp;#034;, &#xD;
             x /. AssociationThread[{&amp;#034;A&amp;#034;, &amp;#034;B1&amp;#034;, &amp;#034;B2&amp;#034;, &amp;#034;B3&amp;#034;, &amp;#034;B4&amp;#034;, &amp;#034;B5&amp;#034;, &amp;#034;B6&amp;#034;, &#xD;
                &amp;#034;B12&amp;#034;, &amp;#034;C&amp;#034;, &amp;#034;D2&amp;#034;, &amp;#034;D3&amp;#034;, &amp;#034;H&amp;#034;, &amp;#034;H1&amp;#034;, &amp;#034;K1&amp;#034;, &amp;#034;K3&amp;#034;, &amp;#034;K5&amp;#034;, &amp;#034;M&amp;#034;, &amp;#034;P&amp;#034;,&#xD;
                 &amp;#034;AlphaTocopherol&amp;#034;, &amp;#034;DAlphaTocopherol&amp;#034;, &amp;#034;Niacin&amp;#034;, &#xD;
                &amp;#034;Choline&amp;#034;}, {&amp;#034;RelativeVitaminAContent&amp;#034;, &#xD;
                &amp;#034;RelativeThiaminContent&amp;#034;, &amp;#034;RelativeRiboflavinContent&amp;#034;, &#xD;
                &amp;#034;NoData&amp;#034;, &amp;#034;NoData&amp;#034;, &amp;#034;RelativePantothenicAcidContent&amp;#034;, &#xD;
                &amp;#034;RelativeVitaminB6Content&amp;#034;, &amp;#034;RelativeVitaminB12Content&amp;#034;, &#xD;
                &amp;#034;RelativeVitaminCContent&amp;#034;, &amp;#034;RelativeVitaminD2Content&amp;#034;, &#xD;
                &amp;#034;RelativeVitaminD3Content&amp;#034;, &amp;#034;RelativeBiotinContent&amp;#034;, &amp;#034;NoData&amp;#034;,&#xD;
                 &amp;#034;RelativeVitaminKContent&amp;#034;, &amp;#034;RelativeVitaminKContent&amp;#034;, &#xD;
                &amp;#034;RelativeVitaminKContent&amp;#034;, &amp;#034;RelativeFolicAcidContent&amp;#034;, &#xD;
                &amp;#034;NoData&amp;#034;, &amp;#034;RelativeVitaminEContent&amp;#034;, &#xD;
                &amp;#034;RelativeVitaminEContent&amp;#034;, &amp;#034;RelativeNiacinContent&amp;#034;, &#xD;
                &amp;#034;RelativeCholineContent&amp;#034;}]]]; &#xD;
          If[QuantityQ[bb] == True, {x, bb}, {x, &amp;#034;NoData&amp;#034;}]]; &#xD;
        VitaminData[&amp;#034;Food&amp;#034; -&amp;gt; an_] := &#xD;
         Map[VitaminData[#, &amp;#034;Food&amp;#034; -&amp;gt; an] &amp;amp;, {&amp;#034;A&amp;#034;, &amp;#034;B1&amp;#034;, &amp;#034;B2&amp;#034;, &amp;#034;B3&amp;#034;, &amp;#034;B4&amp;#034;, &#xD;
           &amp;#034;B5&amp;#034;, &amp;#034;B6&amp;#034;, &amp;#034;B12&amp;#034;, &amp;#034;C&amp;#034;, &amp;#034;D2&amp;#034;, &amp;#034;D3&amp;#034;, &amp;#034;H&amp;#034;, &amp;#034;H1&amp;#034;, &amp;#034;K1&amp;#034;, &amp;#034;K3&amp;#034;, &amp;#034;K5&amp;#034;, &#xD;
           &amp;#034;M&amp;#034;, &amp;#034;P&amp;#034;, &amp;#034;AlphaTocopherol&amp;#034;, &amp;#034;DAlphaTocopherol&amp;#034;, &amp;#034;Niacin&amp;#034;, &#xD;
           &amp;#034;Choline&amp;#034;}]&#xD;
&#xD;
# Food Ranking&#xD;
&#xD;
Below we can see that there are 1816 foods in the *Mathematica* database as FoodType entities. I decided to leave this option out of the VitaminData[] function because each evaluation takes a long time to perform.&#xD;
&#xD;
    SparseArray@EntityList@Entity[&amp;#034;FoodType&amp;#034;]&#xD;
&#xD;
![i15][15]&#xD;
&#xD;
Below are some examples of vitamin ranking lists (top 10 foods) for all foods in the database. In this case I could specify some very specific types as well, such as Beta-Tocopherol (instead of Alpha-Tocopherol, for example) and vitamin D3:&#xD;
&#xD;
- **Vitamin C**&#xD;
&#xD;
        MaximalBy[&#xD;
         Thread[{EntityList@Entity[&amp;#034;FoodType&amp;#034;], &#xD;
           Map[Entity[&#xD;
               &amp;#034;Food&amp;#034;, {EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;FoodType&amp;#034;] -&amp;gt; &#xD;
                 ContainsExactly[{#}], &#xD;
                EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;AddedFoodTypes&amp;#034;] -&amp;gt; &#xD;
                 ContainsExactly[{}]}][&#xD;
              EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;RelativeVitaminCContent&amp;#034;]] &amp;amp;, &#xD;
            EntityList@Entity[&amp;#034;FoodType&amp;#034;]]}], Last, UpTo[10]]&#xD;
&#xD;
![i16][16]&#xD;
&#xD;
- **Vitamin A**&#xD;
&#xD;
        MaximalBy[&#xD;
         Thread[{EntityList@Entity[&amp;#034;FoodType&amp;#034;], &#xD;
           Map[Entity[&#xD;
               &amp;#034;Food&amp;#034;, {EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;FoodType&amp;#034;] -&amp;gt; &#xD;
                 ContainsExactly[{#}], &#xD;
                EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;AddedFoodTypes&amp;#034;] -&amp;gt; &#xD;
                 ContainsExactly[{}]}][&#xD;
              EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;RelativeVitaminAContent&amp;#034;]] &amp;amp;, &#xD;
            EntityList@Entity[&amp;#034;FoodType&amp;#034;]]}], Last, UpTo[10]]&#xD;
&#xD;
![i17][17]&#xD;
&#xD;
- **Vitamin B6**&#xD;
&#xD;
        MaximalBy[&#xD;
         Thread[{EntityList@Entity[&amp;#034;FoodType&amp;#034;], &#xD;
           Map[Entity[&#xD;
               &amp;#034;Food&amp;#034;, {EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;FoodType&amp;#034;] -&amp;gt; &#xD;
                 ContainsExactly[{#}], &#xD;
                EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;AddedFoodTypes&amp;#034;] -&amp;gt; &#xD;
                 ContainsExactly[{}]}][&#xD;
              EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;RelativeVitaminB6Content&amp;#034;]] &amp;amp;, &#xD;
            EntityList@Entity[&amp;#034;FoodType&amp;#034;]]}], Last, UpTo[10]]&#xD;
&#xD;
![i18][18]&#xD;
&#xD;
- **Beta-Tocopherol**&#xD;
&#xD;
        MaximalBy[&#xD;
         Thread[{EntityList@Entity[&amp;#034;FoodType&amp;#034;], &#xD;
           Map[Entity[&#xD;
               &amp;#034;Food&amp;#034;, {EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;FoodType&amp;#034;] -&amp;gt; &#xD;
                 ContainsExactly[{#}], &#xD;
                EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;AddedFoodTypes&amp;#034;] -&amp;gt; &#xD;
                 ContainsExactly[{}]}][&#xD;
              EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;RelativeBetaTocopherolContent&amp;#034;]] &amp;amp;, &#xD;
            EntityList@Entity[&amp;#034;FoodType&amp;#034;]]}], Last, UpTo[10]]&#xD;
&#xD;
![i19][19]&#xD;
&#xD;
- **Vitamin D3**&#xD;
&#xD;
        MaximalBy[&#xD;
         Thread[{EntityList@Entity[&amp;#034;FoodType&amp;#034;], &#xD;
           Map[Entity[&#xD;
               &amp;#034;Food&amp;#034;, {EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;FoodType&amp;#034;] -&amp;gt; &#xD;
                 ContainsExactly[{#}], &#xD;
                EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;AddedFoodTypes&amp;#034;] -&amp;gt; &#xD;
                 ContainsExactly[{}]}][&#xD;
              EntityProperty[&amp;#034;Food&amp;#034;, &amp;#034;RelativeVitaminD3Content&amp;#034;]] &amp;amp;, &#xD;
            EntityList@Entity[&amp;#034;FoodType&amp;#034;]]}], Last, UpTo[10]]&#xD;
&#xD;
![i20][20]&#xD;
&#xD;
These lists above were just a few examples of vitamin ranking using all foods in the database and could be extended to various other substances.&#xD;
&#xD;
Thanks.&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
  &#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7638i1.png&amp;amp;userId=1316061&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=10099i2.png&amp;amp;userId=1316061&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=6977i3.png&amp;amp;userId=1316061&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=8926i4.png&amp;amp;userId=1316061&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=6808i5.png&amp;amp;userId=1316061&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2171i6.png&amp;amp;userId=1316061&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=9269i7.png&amp;amp;userId=1316061&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1613i8.png&amp;amp;userId=1316061&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=3239i9.png&amp;amp;userId=1316061&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=8715i10.png&amp;amp;userId=1316061&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=6084i11.png&amp;amp;userId=1316061&#xD;
  [12]: https://community.wolfram.com//c/portal/getImageAttachment?filename=4882i12.png&amp;amp;userId=1316061&#xD;
  [13]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7520i13.png&amp;amp;userId=1316061&#xD;
  [14]: https://community.wolfram.com//c/portal/getImageAttachment?filename=4489i14.png&amp;amp;userId=1316061&#xD;
  [15]: https://community.wolfram.com//c/portal/getImageAttachment?filename=4028i15.png&amp;amp;userId=1316061&#xD;
  [16]: https://community.wolfram.com//c/portal/getImageAttachment?filename=6591i16.png&amp;amp;userId=1316061&#xD;
  [17]: https://community.wolfram.com//c/portal/getImageAttachment?filename=i17.png&amp;amp;userId=1316061&#xD;
  [18]: https://community.wolfram.com//c/portal/getImageAttachment?filename=i18.png&amp;amp;userId=1316061&#xD;
  [19]: https://community.wolfram.com//c/portal/getImageAttachment?filename=i19.png&amp;amp;userId=1316061&#xD;
  [20]: https://community.wolfram.com//c/portal/getImageAttachment?filename=i20.png&amp;amp;userId=1316061</description>
    <dc:creator>Claudio Chaib</dc:creator>
    <dc:date>2019-12-05T00:52:48Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1052348">
    <title>Calculating NMR-spectra with Wolfram Language</title>
    <link>https://community.wolfram.com/groups/-/m/t/1052348</link>
    <description>#Introduction&#xD;
&#xD;
Perhaps there are already Mma-Procedures to calculate NMR-spectra, but I did not do a literature research.&#xD;
&#xD;
I post a notebook to calculate NMR-Spectra of simple spin I = 1/2 systems.&#xD;
&#xD;
The notebook comes in two parts. &#xD;
&#xD;
Part one uses a spin-product function approach, where the spin-product function a, a ,...b is used as e.g. phi [ 1, 1, ,...., -1 ]. &#xD;
The Hamiltonian is constructed according to different mT-values and the spectrum is calculated.&#xD;
&#xD;
Part two uses the &amp;#034;brute force&amp;#034; approach where all operators are mapped unto matrices (Kronecker-Products of individual matrix-operators) in the total spin-space. So here products of operators are matrix-products (in part 1 they are functions of functions) .Having the Hamiltonian and its Eigensystem the spectrum is calculated.&#xD;
&#xD;
Note that the number of lines of even small systems are growing rapidly. So it may well be that there is not enough memory to cope with a system you would like to consider.&#xD;
&#xD;
If you omit giving numbers to frequencies and coupling-constants you may get pure theoretical results. That works fine for two spins, but already for three spins - although here you will still get the Hamiltonian - very large outputs are generated, especially in the Eigensystems, So you should avoid that.&#xD;
&#xD;
It seems to be not too complicated to modify the approach in part two to include spins with I &amp;gt; 1/2.&#xD;
&#xD;
And certainly it is well possible to modify the code as to get an iterative procedure to fit data to spectra.&#xD;
&#xD;
I am aware that there are &amp;#034;professional&amp;#034; systems to do all this, but I just wanted to see how it could be done in Mathematica.&#xD;
#Part 1#&#xD;
Number of Spins&#xD;
&#xD;
    nsp = 3;&#xD;
Input of Parameters&#xD;
&#xD;
    freqs = {372.2, 364.4, 342, 6.083, 5.8};&#xD;
    JJ = ( {&#xD;
        {0, .91, 17.9, 1, 1, 1},&#xD;
        {0, 0, 11.75, 1, 1, 1},&#xD;
        {0, 0, 0, 1, 1, 1},&#xD;
        {0, 0, 0, 0, 1, 1},&#xD;
        {0, 0, 0, 0, 0, 1},&#xD;
        {0, 0, 0, 0, 0, 0}&#xD;
       } );&#xD;
    Do[\[Nu][i] = freqs[[i]], {i, 1, nsp}];&#xD;
    Do[J[i, k] = JJ[[i, k]], {i, 1, nsp - 1}, {k, i + 1, nsp}];&#xD;
&#xD;
Basevectors&#xD;
&#xD;
    base = Apply[\[CurlyPhi], &#xD;
      IntegerDigits[#, 2, nsp] + 1 &amp;amp; /@ Table[j, {j, 0, 2^nsp - 1}] /. &#xD;
       2 -&amp;gt; -1, {1}]&#xD;
![enter image description here][1]&#xD;
&#xD;
mT - Values&#xD;
&#xD;
    mT = Table[-nsp/2 + j, {j, 0, nsp}]&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
Number of lines in the spectrum  (  =  Sum[Binomial[nsp, k] Binomial[nsp, k + 1], {k, 0, nsp - 1}],  because only transitions between states of different mT&amp;#039;s give lines on non-zero intensity )&#xD;
&#xD;
    numberoflines = Binomial[2 nsp, nsp - 1]&#xD;
&#xD;
&amp;gt; 15&#xD;
&#xD;
Rule for scalar products&#xD;
&#xD;
    rscp = {\[CurlyPhi][x__]^2 -&amp;gt; 1, \[CurlyPhi][x__] \[CurlyPhi][y__] -&amp;gt;  0}&#xD;
![enter image description here][3]&#xD;
&#xD;
SpinOperators&#xD;
&#xD;
    cs[a_, j_] := Module[{t}, t = a; b = t[[j]]; t[[j]] = -b; t]&#xD;
    Ix[v_, j_] := v/2 /. \[CurlyPhi][x___] :&amp;gt; \[CurlyPhi] @@ cs[{x}, j]&#xD;
    Iy[v_, j_] := &#xD;
     I v/2 /. \[CurlyPhi][x___] :&amp;gt; {x}[[j]] \[CurlyPhi] @@ cs[{x}, j]&#xD;
    Iz[v_, j_] := v/2 /. \[CurlyPhi][x___] :&amp;gt; {x}[[j]] \[CurlyPhi][x]&#xD;
&#xD;
Example&#xD;
&#xD;
    {Ix[\[CurlyPhi][4], 1], Ix[\[CurlyPhi][-1], 1], Iy[\[CurlyPhi][5], 1],&#xD;
      Iy[\[CurlyPhi][-1], 1], Iz[\[CurlyPhi][6], 1], &#xD;
     Iz[\[CurlyPhi][-1], 1]}&#xD;
![enter image description here][7]&#xD;
&#xD;
Hamiltonian  - Matrixelements  Subscript[H, i,j]  for (sub-)base b&#xD;
&#xD;
    HH[b_, i_,  j_] := (Sum[\[Nu][m] b[[j]] Iz[b[[i]], m], {m, 1, nsp}] + &#xD;
         Sum[J[m, k] b[[&#xD;
            j]] (Ix[Ix[b[[i]], k], m] + Iy[Iy[b[[i]], k], m] + &#xD;
             Iz[Iz[b[[i]], k], m]), {m, 1, nsp - 1}, {k, m + 1, nsp}] // &#xD;
        Expand) /. rscp&#xD;
Example&#xD;
&#xD;
    HH[base, 1, 1]&#xD;
&#xD;
&amp;gt; 546.94&#xD;
&#xD;
    HH[base, 1, 2]&#xD;
&#xD;
&amp;gt; 0&#xD;
&#xD;
    HH[base, 3, 5]&#xD;
&#xD;
&amp;gt; 0.455&#xD;
&#xD;
Spinfunctions according to mT - value &#xD;
&#xD;
    wf = Function[x, Select[base, Total[List @@ #] == 2 x &amp;amp;]] /@ mT&#xD;
![enter image description here][8]&#xD;
&#xD;
Hamilton - Submatrices&#xD;
&#xD;
    HSM[j_] := (nn = Length[wf[[j]]]; &#xD;
      Table[HH[wf[[j]], m, n], {m, 1, nn}, {n, 1, nn}])&#xD;
    HSM[2];&#xD;
    % // MatrixForm&#xD;
![enter image description here][9]&#xD;
&#xD;
    HSM[2] /. {\[Nu][10] -&amp;gt; -\[Nu], \[Nu][11] -&amp;gt; 0, \[Nu][12] -&amp;gt; \[Nu], &#xD;
       J[1, 2] -&amp;gt; J, J[1, 3] -&amp;gt; J, J[2, 3] -&amp;gt; J};&#xD;
      % // MatrixForm&#xD;
![enter image description here][13]&#xD;
&#xD;
Get Eigenstates  \[Congruent] all sets { freq,  eigenvector  } for different spin-states (mT values)&#xD;
&#xD;
    frevec[n_] := Module[{es},&#xD;
      es = Eigensystem[HSM[n]];&#xD;
      {#[[1]], #[[2]].wf[[n]]} &amp;amp; /@ Transpose[es]&#xD;
      ]&#xD;
    eigenstates = frevec /@ Range[nsp + 1]&#xD;
&#xD;
![enter image description here][14]&#xD;
&#xD;
Operator for calculating relative intensities&#xD;
&#xD;
    IOP[x_] := Sum[Ix[x, n], {n, 1, nsp}]&#xD;
Calculating a spectral line  = difference of eigenvalues and intensity&#xD;
&#xD;
    line[a_, b_] := Module[{},&#xD;
      freq = Abs[a[[1]] - b[[1]]];&#xD;
      m2 = (Expand[a[[2]] IOP[b[[2]]]] /. rscp)^2;&#xD;
      {freq, Sqrt[m2]}]&#xD;
Lorentzfunction&#xD;
&#xD;
    LF[x_, x0_, a_, h_] := Module[{},&#xD;
      If[h == 0, h = 1];&#xD;
      1/Sqrt[Pi] (a h/2)/(h^2/4 + Pi (x - x0)^2)]&#xD;
Calculating the spectrum&#xD;
&#xD;
    spec = Table[0, {numberoflines}];&#xD;
    nL = 0;&#xD;
    Do[&#xD;
      lk = Length[eigenstates[[i]]];&#xD;
      lk1 = Length[eigenstates[[i + 1]]];&#xD;
      Do[&#xD;
       Do[&#xD;
        nL = nL + 1;&#xD;
        spec[[nL]] = line[eigenstates[[i, m]], eigenstates[[i + 1, n ]]],&#xD;
        {n, 1, lk1}&#xD;
        ],&#xD;
       {m, 1, lk}&#xD;
       ],&#xD;
      {i, 1, Length[eigenstates] - 1}];&#xD;
    normalizer = Max[Transpose[spec][[2]]];&#xD;
    bb = {.95 Min[Transpose[spec][[1]]], 1.05 Max[Transpose[spec][[1]]]};&#xD;
    spec = {#[[1]], #[[2]]/normalizer} &amp;amp; /@ spec;&#xD;
    spec&#xD;
    pl1 = ListPlot[spec, Filling -&amp;gt; Axis]&#xD;
![enter image description here][15]&#xD;
&#xD;
Show the spectrum with lines&#xD;
&#xD;
    pl2 = Plot[&#xD;
      Plus @@ (LF[x, #[[1]], #[[2]], 1.5] &amp;amp; /@ spec), {x, bb[[1]], &#xD;
       bb[[2]]}, PlotRange -&amp;gt; All, AxesOrigin -&amp;gt; {320, 0}]&#xD;
![enter image description here][16]&#xD;
&#xD;
For some physical reason spectra are recorded so that frequencies grow from right to left. So the plot is reversed and compared to the experimental spectrum ( see http://www.users.csbsju.edu/~frioux/nmr/Speclab4.htm ) which is given below the plot.&#xD;
&#xD;
    pl3 = Plot[&#xD;
      Plus @@ (LF[-x, #[[1]], #[[2]], 1.5] &amp;amp; /@ spec), {x, -bb[[2]], -bb[[&#xD;
         1]]}, PlotRange -&amp;gt; All]&#xD;
![enter image description here][17]&#xD;
#Part 2#&#xD;
&#xD;
    nsp = 3;&#xD;
Input of Parameters&#xD;
&#xD;
    freqs = {372.2, 364.4, 342, 6.083, 5.8};&#xD;
    JJ = ( {&#xD;
        {0, .91, 17.9, 1, 1, 1},&#xD;
        {0, 0, 11.75, 1, 1, 1},&#xD;
        {0, 0, 0, 1, 1, 1},&#xD;
        {0, 0, 0, 0, 1, 1},&#xD;
        {0, 0, 0, 0, 0, 1},&#xD;
        {0, 0, 0, 0, 0, 0}&#xD;
       } );&#xD;
    Do[\[Nu][i] = freqs[[i]], {i, 1, nsp}];&#xD;
    Do[J[i, k] = JJ[[i, k]], {i, 1, nsp - 1}, {k, i + 1, nsp}];&#xD;
number of lines to be expected and dimension ot (total) spin - space (at least for spin 1/2 )&#xD;
&#xD;
    numberoflines = Binomial[2 nsp, nsp - 1]&#xD;
    dimspsp = 2^nsp&#xD;
&#xD;
&amp;gt; 15&#xD;
&#xD;
&amp;gt; 8&#xD;
&#xD;
spin operators for spin I = 1/2&#xD;
&#xD;
    ix = ( { {0, 1}, {1, 0} } )/2;&#xD;
    iy = ( { {0, -I}, {I, 0} } )/2;&#xD;
    iz = ( {{1, 0}, {0, -1} } )/2;&#xD;
&#xD;
this function constructs the spin operator of particle j as matrix in the spin space of n particles &#xD;
&#xD;
    Op[op_, n_, j_] := Module[{x, m},&#xD;
      x = Join[Table[{{1, 0}, {0, 1}}, {j - 1}], {op}, &#xD;
        Table[{{1, 0}, {0, 1}}, {n - j}]];&#xD;
      m = SparseArray[KroneckerProduct[Sequence @@ x]]&#xD;
      ]&#xD;
    oIx[j_] := Op[ix, nsp, j]&#xD;
    oIy[j_] := Op[iy, nsp, j]&#xD;
    oIz[j_] := Op[iz, nsp, j]&#xD;
&#xD;
Hamiltonian&#xD;
&#xD;
    HH = \!\(&#xD;
    \*UnderoverscriptBox[\(\[Sum]\), \(i = 1\), \(nsp\)]\(\[Nu][i] oIz[&#xD;
         i]\)\) + \!\(&#xD;
    \*UnderoverscriptBox[\(\[Sum]\), \(i = 1\), \(nsp - 1\)]\(&#xD;
    \*UnderoverscriptBox[\(\[Sum]\), \(j = i + 1\), \(nsp\)]J[i, &#xD;
          j] \((oIx[i] . oIx[j] + oIy[i] . oIy[j] + oIz[i] . oIz[j])\)\)\)&#xD;
&#xD;
&amp;gt; SparseArray[SequenceForm[&amp;#034;&amp;lt;&amp;#034;, 32, &amp;#034;&amp;gt;&amp;#034;], {8, 8}]&#xD;
&#xD;
Eigensystem for the Hamilton - Operator&#xD;
&#xD;
    est = Transpose[Eigensystem[HH]]&#xD;
![enter image description here][18]&#xD;
&#xD;
Intensity operator&#xD;
&#xD;
    IOP1 = \!\(&#xD;
    \*UnderoverscriptBox[\(\[Sum]\), \(j = 1\), \(nsp\)]\(oIx[j]\)\)&#xD;
&#xD;
&amp;gt; SparseArray[SequenceForm[&amp;#034;&amp;lt;&amp;#034;, 24, &amp;#034;&amp;gt;&amp;#034;], {8, 8}]&#xD;
&#xD;
    line1[a_, b_] := Module[{},&#xD;
      freq = Abs[a[[1]] - b[[1]]];&#xD;
      m2 = (a[[2]].IOP1.b[[2]])^2;&#xD;
      {freq, Sqrt[m2]}]&#xD;
&#xD;
Calculate spectrum, show it and display result from part 1&#xD;
&#xD;
    spec1 = Table[0, {Binomial[dimspsp, 2]}];&#xD;
    nL = 0;&#xD;
    Do[&#xD;
     Do[&#xD;
      nL = nL + 1;&#xD;
      spec1[[nL]] = line1[est[[u]], est[[v]]],&#xD;
      {u, v + 1, dimspsp}&#xD;
      ],&#xD;
     {v, 1, dimspsp - 1}&#xD;
     ]&#xD;
    spec1 = Select[spec1, #[[2]] &amp;gt; 0. &amp;amp;];&#xD;
    normalizer = Max[Transpose[spec1][[2]]];&#xD;
    bb = {.95 Min[Transpose[spec][[1]]], 1.05 Max[Transpose[spec][[1]]]};&#xD;
    spec1 = {#[[1]], #[[2]]/normalizer} &amp;amp; /@ spec1;&#xD;
    spec1&#xD;
    ListPlot[spec1, Filling -&amp;gt; Axis, FillingStyle -&amp;gt; Directive[Red, Thick]]&#xD;
    Show[pl1]&#xD;
![enter image description here][19]&#xD;
&#xD;
Plot the spectrum and compare with the result of the 1 st part&#xD;
&#xD;
    pl4 = Plot[&#xD;
      Plus @@ (LF[x, #[[1]], #[[2]], 1.5] &amp;amp; /@ spec1), {x, bb[[1]], &#xD;
       bb[[2]]}, PlotRange -&amp;gt; All, PlotStyle -&amp;gt; Red]&#xD;
    Show[pl2]&#xD;
![enter image description here][20]&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.21.45.png&amp;amp;userId=95400&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.23.20.png&amp;amp;userId=95400&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.25.36.png&amp;amp;userId=95400&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.21.45.png&amp;amp;userId=95400&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.21.45.png&amp;amp;userId=95400&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.21.45.png&amp;amp;userId=95400&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.28.10.png&amp;amp;userId=95400&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.32.12.png&amp;amp;userId=95400&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.33.44.png&amp;amp;userId=95400&#xD;
  [10]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.21.45.png&amp;amp;userId=95400&#xD;
  [11]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.23.20.png&amp;amp;userId=95400&#xD;
  [12]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.25.36.png&amp;amp;userId=95400&#xD;
  [13]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.34.56.png&amp;amp;userId=95400&#xD;
  [14]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.37.59.png&amp;amp;userId=95400&#xD;
  [15]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.41.13.png&amp;amp;userId=95400&#xD;
  [16]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.42.24.png&amp;amp;userId=95400&#xD;
  [17]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.43.26.png&amp;amp;userId=95400&#xD;
  [18]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.50.48.png&amp;amp;userId=95400&#xD;
  [19]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.53.45.png&amp;amp;userId=95400&#xD;
  [20]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-04-25at16.55.25.png&amp;amp;userId=95400</description>
    <dc:creator>Hans Dolhaine</dc:creator>
    <dc:date>2017-04-04T08:36:27Z</dc:date>
  </item>
</rdf:RDF>

