Community RSS Feed https://community.wolfram.com RSS Feed for Wolfram Community showing any discussions in tag Wolfram Scienceshowthread.php?threadid=956 sorted by active Try to beat these MRB constant records! https://community.wolfram.com/groups/-/m/t/366628 Map: - First we have these record number of digits of the MRB constant computations. - Then we have some hints for anyone serious about breaking my record. - Next, we have speed records. - Then we have a program Richard Crandall wrote to check his code for computing record number of digits. - Then there is a conversation about whether Mathematica uses the same algorithm for computing MRB by a couple of different methods. - Then, for a few replies, we compute the MRB constant from Crandall&#039;s eta derivative formulas and see records there. - Then there are three replies about &#034;NEW RECORD ATTEMPTS OF 4,000,000 DIGITS!&#034; and the computation is now complete!!!!!. - Finally, we see where I am on a 5,000,000 digits calculation. POSTED BY: Marvin Ray Burns. **MKB constant calculations,** ![enter image description here] , **have been moved to their own discussion at** [Calculating the digits of the MKB constant]. I think the following important point got buried near the end. When it comes to mine and a few other people&#039;s passion to calculate many digits of constants and the dislike possessed by a few more people, it is all a matter telling us that minds work differently! The MRB constant is defined below. See http://mathworld.wolfram.com/MRBConstant.html. $$\text{MRB}=\sum _{n=1}^{\infty } (-1)^n \left(n^{1/n}-1\right).$$ Here are some record computations. If you know of any others let me know. 1. On or about Dec 31, 1998 I computed 1 digit of the (additive inverse of the) MRB constant with my TI-92&#039;s, by adding 1-sqrt(2)+3^(1/3)-4^(1/4) as far as I could and then by using the sum feature to compute $\sum _{n=1}^{1000 } (-1)^n \left(n^{1/n}\right).$ That first digit, by the way, is just 0. 2. On Jan 11, 1999 I computed 3 digits of the MRB constant with the Inverse Symbolic Calculator. 3. In Jan of 1999 I computed 4 correct digits of the MRB constant using Mathcad 3.1 on a 50 MHz 80486 IBM 486 personal computer operating on Windows 95. 4. Shortly afterwards I computed 9 correct digits of the MRB constant using Mathcad 7 professional on the Pentium II mentioned below. 5. On Jan 23, 1999 I computed 500 digits of the MRB constant with the online tool called Sigma. 6. In September of 1999, I computed the first 5,000 digits of the MRB Constant on a 350 MHz Pentium II with 64 Mb of ram using the simple PARI commands \p 5000;sumalt(n=1,((-1)^n*(n^(1/n)-1))), after allocating enough memory. 7. On June 10-11, 2003 over a period, of 10 hours, on a 450mh P3 with an available 512mb RAM, I computed 6,995 accurate digits of the MRB constant. 8. Using a Sony Vaio P4 2.66 GHz laptop computer with 960 MB of available RAM, on 2:04 PM 3/25/2004, I finished computing 8000 digits of the MRB constant. 9. On March 01, 2006 with a 3GH PD with 2GBRAM available, I computed the first 11,000 digits of the MRB Constant. 10. On Nov 24, 2006 I computed 40, 000 digits of the MRB Constant in 33hours and 26min via my own program in written in Mathematica 5.2. The computation was run on a 32-bit Windows 3GH PD desktop computer using 3.25 GB of Ram. 11. Finishing on July 29, 2007 at 11:57 PM EST, I computed 60,000 digits of MRB Constant. Computed in 50.51 hours on a 2.6 GH AMD Athlon with 64 bit Windows XP. Max memory used was 4.0 GB of RAM. 12. Finishing on Aug 3 , 2007 at 12:40 AM EST, I computed 65,000 digits of MRB Constant. Computed in only 50.50 hours on a 2.66GH Core2Duo using 64 bit Windows XP. Max memory used was 5.0 GB of RAM. 13. Finishing on Aug 12, 2007 at 8:00 PM EST, I computed 100,000 digits of MRB Constant. They were computed in 170 hours on a 2.66GH Core2Duo using 64 bit Windows XP. Max memory used was 11.3 GB of RAM. Median (typical) daily record of memory used was 8.5 GB of RAM. 14. Finishing on Sep 23, 2007 at 11:00 AM EST, I computed 150,000 digits of MRB Constant. They were computed in 330 hours on a 2.66GH Core2Duo using 64 bit Windows XP. Max memory used was 22 GB of RAM. Median (typical) daily record of memory used was 17 GB of RAM. 15. Finishing on March 16, 2008 at 3:00 PM EST, I computed 200,000 digits of MRB Constant using Mathematica 5.2. They were computed in 845 hours on a 2.66GH Core2Duo using 64 bit Windows XP. Max memory used was 47 GB of RAM. Median (typical) daily record of memory used was 28 GB of RAM. 16. Washed away by Hurricane Ike -- on September 13, 2008 sometime between 2:00PM - 8:00PM EST an almost complete computation of 300,000 digits of the MRB Constant was destroyed. Computed for a long 4015. Hours (23.899 weeks or 1.4454*10^7 seconds) on a 2.66GH Core2Duo using 64 bit Windows XP. Max memory used was 91 GB of RAM. The Mathematica 6.0 code used follows: Block[{$MaxExtraPrecision = 300000 + 8, a, b = -1, c = -1 - d, d = (3 + Sqrt)^n, n = 131 Ceiling[300000/100], s = 0}, a = 1; d = (d + 1/d)/2; For[m = 1, m &lt; n, a[m] = (1 + m)^(1/(1 + m)); m++]; For[k = 0, k &lt; n, c = b - c; b = b (k + n) (k - n)/((k + 1/2) (k + 1)); s = s + c*a[k]; k++]; N[1/2 - s/d, 300000]] 17. On September 18, 2008 a computation of 225,000 digits of MRB Constant was started with a 2.66GH Core2Duo using 64 bit Windows XP. It was completed in 1072 hours. Memory usage is recorded in the attachment pt 225000.xls, near the bottom of this post. 18. 250,000 digits was attempted but failed to be completed to a serious internal error which restarted the machine. The error occurred sometime on December 24, 2008 between 9:00 AM and 9:00 PM. The computation began on November 16, 2008 at 10:03 PM EST. Like the 300,000 digit computation this one was almost complete when it failed. The Max memory used was 60.5 GB. 19. On Jan 29, 2009, 1:26:19 pm (UTC-0500) EST, I finished computing 250,000 digits of the MRB constant. with a multiple step Mathematica command running on a dedicated 64bit XP using 4Gb DDR2 Ram on board and 36 GB virtual. The computation took only 333.102 hours. The digits are at http://marvinrayburns.com/250KMRB.txt . The computation is completely documented in the attached 250000.pd at bottom of this post. 20. On Sun 28 Mar 2010 21:44:50 (UTC-0500) EST, I started a computation of 300000 digits of the MRB constant using an i7 with 8.0 GB of DDR3 Ram on board, but it failed due to hardware problems. 21. I computed 299,998 Digits of the MRB constant. The computation began Fri 13 Aug 2010 10:16:20 pm EDT and ended 2.23199*10^6 seconds later | Wednesday, September 8, 2010. I used Mathematica 6.0 for Microsoft Windows (64-bit) (June 19, 2007) That is an average of 7.44 seconds per digit.. I used my Dell Studio XPS 8100 i7 860 @ 2.80 GH 2.80 GH with 8GB physical DDR3 RAM. Windows 7 reserved an additional 48.929 GB virtual Ram. 22. I computed exactly 300,000 digits to the right of the decimal point of the MRB constant from Sat 8 Oct 2011 23:50:40 to Sat 5 Nov 2011 19:53:42 (2.405*10^6 seconds later). This run was 0.5766 seconds per digit slower than the 299,998 digit computation even though it used 16GB physical DDR3 RAM on the same machine. The working precision and accuracy goal combination were maximized for exactly 300,000 digits, and the result was automatically saved as a file instead of just being displayed on the front end. Windows reserved a total of 63 GB of working memory of which at 52 GB were recorded being used. The 300,000 digits came from the Mathematica 7.0 command Quit; DateString[] digits = 300000; str = OpenWrite[]; SetOptions[str, PageWidth -&gt; 1000]; time = SessionTime[]; Write[str, NSum[(-1)^n*(n^(1/n) - 1), {n, \[Infinity]}, WorkingPrecision -&gt; digits + 3, AccuracyGoal -&gt; digits, Method -&gt; &#034;AlternatingSigns&#034;]]; timeused = SessionTime[] - time; here = Close[str] DateString[] 23. 314159 digits of the constant took 3 tries do to hardware failure. Finishing on September 18, 2012 I computed 314159 digits, taking 59 GB of RAM. The digits are came from the Mathematica 8.0.4 code DateString[] NSum[(-1)^n*(n^(1/n) - 1), {n, \[Infinity]}, WorkingPrecision -&gt; 314169, Method -&gt; &#034;AlternatingSigns&#034;] // Timing DateString[] 24. Sam Noble of Apple computed 1,000,000 digits of the MRB constant in 18 days 9 hours 11 minutes 34.253417 seconds. 25. Finishing on Dec 11, 2012 Ricard Crandall, an Apple scientist, computed 1,048,576 digits in a lighting fast 76.4 hours (probably processor time). That&#039;s on a 2.93 Ghz 8-core Nehalem. **It took until the use of DDR4 to compute nearly that many digits in an absolute time that quick!!: In Aug of 2018 I computed 1,004,993 digits of the MRB constant in 53.5 hours with 10 processor cores! Search this post for &#034;53.5&#034; for documentation. Sept 21, 2018, I just now computed 1,004,993 digits of the MRB constant in 50.37 hours of absolute time (35.4 hours processor time) with 18 processor cores!** Search this post for &#034;50.37 hours&#034; for documentation.** 26. Previously, I computed a little over 1,200,000 digits of the MRB constant in 11 days, 21 hours, 17 minutes, and 41 seconds,( finishing on on March 31 2013). I used a six core Intel(R) Core(TM) i7-3930K CPU @ 3.20 GHz 3.20 GHz. 27. On May 17, 2013 I finished a 2,000,000 or more digit computation of the MRB constant, using only around 10GB of RAM. It took 37 days 5 hours 6 minutes 47.1870579 seconds. I used my six core Intel(R) Core(TM) i7-3930K CPU @ 3.20 GHz 3.20 GHz. 28. A previous world record computation of the MRB constant was finished on Sun 21 Sep 2014 18:35:06. It took 1 month 27 days 2 hours 45 minutes 15 seconds.The processor time from the 3,000,000+ digit computation was 22 days. I computed the 3,014,991 digits of the MRB constant with Mathematica 10.0. I Used my new version of Richard Crandall&#039;s code in the attached 3M.nb, optimized for my platform and large computations. I also used a six core Intel(R) Core(TM) i7-3930K CPU @ 3.20 GHz 3.20 GHz with 64 GB of RAM of which only 16 GB was used. Can you beat it (in more number of digits, less memory used, or less time taken)? This confirms that my previous &#034;2,000,000 or more digit computation&#034; was actually accurate to 2,009,993 digits. they were used to check the first several digits of this computation. See attached 3M.nb for the full code and digits. 29. Finished on Wed 16 Jan 2019 19:55:20, I computed over 4 million digits of the MRB constant. It took 4 years of continuous tries. This successful run took 65.13 days computation time, with a processor time of 25.17 days, on a 3.7 GH overclocked up to 4.7 GH on all cores Intel 6 core computer with 3000 MHz RAM. According to this computation, the previous record, 3,000,000+ digit computation, was accurate to 3,014,871 decimals, as this computation used my own algorithm for computing n^(1/n) as found at chapter 3 in the paper at https://www.sciencedirect.com/science/article/pii/0898122189900242 and the 3 million+ computation used Crandall&#039;s algorithm. Both algorithms outperform Newton&#039;s method per calculation and iteration. See attached [notebook]. M R Burns&#039; algorithm: x = SetPrecision[x, pr]; y = x^n; z = (n - y)/y; t = 2 n - 1; t2 = t^2; x = x*(1 + SetPrecision[4.5, pr] (n - 1)/t2 + (n + 1) z/(2 n t) - SetPrecision[13.5, pr] n (n - 1) 1/(3 n t2 + t^3 z)); (*N[Exp[Log[n]/n],pr]*) Example: ClearSystemCache[]; n = 123456789; (*n is the n in n^(1/n)*) x = N[n^(1/n),100]; (*x starts out as a relatively small precision approximation to n^(1/n)*) pc = Precision[x]; pr = 10000000; (*pr is the desired presicion of your n^(1/n)*) Print[t0 = Timing[While[pc &lt; pr, pc = Min[4 pc, pr]; x = SetPrecision[x, pc]; y = x^n; z = (n - y)/y; t = 2 n - 1; t2 = t^2; x = x*(1 + SetPrecision[4.5, pc] (n - 1)/t2 + (n + 1) z/(2 n t) - SetPrecision[13.5, pc] n (n - 1)/(3 n t2 + t^3 z))]; (*You get a much faster version of N[n^(1/n),pr]*) N[n - x^n, 10]](*The error*)]; ClearSystemCache[]; n = 123456789; Print[t1 = Timing[N[n - N[n^(1/n), pr]^n, 10]]] Gives {25.5469,0.*10^-9999984} {101.359,0.*10^-9999984} R Crandall&#039;s algorithm: While[pc &lt; pr, pc = Min[3 pc, pr]; x = SetPrecision[x, pc]; y = x^n - n; x = x (1 - 2 y/((n + 1) y + 2 n n));]; (*N[Exp[Log[n]/ n],pr]*) Example: ClearSystemCache[]; n = 123456789; (*n is the n in n^(1/n)*) x = N[n^(1/n)]; (*x starts out as a machine precision approximation to n^(1/n)*) pc = Precision[x]; pr = 10000000; (*pr is the desired presicion of your n^(1/n)*) Print[t0 = Timing[While[pc &lt; pr, pc = Min[3 pc, pr]; x = SetPrecision[x, pc]; y = x^n - n; x = x (1 - 2 y/((n + 1) y + 2 n n));]; (*N[Exp[Log[n]/n],pr]*) N[n - x^n, 10]](* The error*)]; Print[ t1 = Timing[N[n - N[n^(1/n), pr]^n, 10]]] Gives {32.1406,0.*10^-9999984} {104.516,0.*10^-9999984} More information available upon request. Here is my mini cluster of the fastest 3 computers mentioned below: The one to the left is my custom built extreme edition 6 core and later with a 8 core Xeon processor. The one in the center is my fast little 4 core Asus with 2400 MHz RAM. Then the one on the right is my fastest -- a Digital Storm 6 core overclocked to 4.7 GHz on all cores and with 3000 MHz RAM. ![enter image description here] : http://community.wolfram.com//c/portal/getImageAttachment?filename=5860Capturemkb.JPG&amp;userId=366611 : http://community.wolfram.com/groups/-/m/t/1323951?p_p_auth=W3TxvEwH : https://community.wolfram.com/groups?p_auth=zWk1Qjoj&amp;p_p_auth=r1gPncLu&amp;p_p_id=19&amp;p_p_lifecycle=1&amp;p_p_state=exclusive&amp;p_p_mode=view&amp;p_p_col_id=column-1&amp;p_p_col_count=6&amp;_19_struts_action=/message_boards/get_message_attachment&amp;_19_messageId=1593151&amp;_19_attachment=4%20million%2011%202018.nb : http://community.wolfram.com//c/portal/getImageAttachment?filename=ezgif.com-video-to-gif.gif&amp;userId=366611 Marvin Ray Burns 2014-10-09T18:08:49Z The Chaos Game - part II https://community.wolfram.com/groups/-/m/t/1039030 ![enter image description here] A couple of weeks ago I posted my first [The Chaos Game post]. This will be a continuation on that, exploring some new ideas. Please make sure to read [the previous one first]. And once you&#039;re finished with this post, read the continuation [part III]. ## Colors ## The first thing I wanted to try after my previous post was coloring. Let&#039;s color each of the points based on the point it jumps towards to: ClearAll[sequence] sequence[n_,m_]:=RandomChoice[Range[n],m] Table[ circlepoints=N@CirclePoints[n]; seq=sequence[n,50000]; pts=Rest[FoldList[(#1+circlepoints[[#2]])/2&amp;,RandomChoice[circlepoints],seq]]; plotdata=Transpose[{pts,seq}]; plotdata=SortBy[GatherBy[plotdata,Last],#[[1,2]]&amp;]; plotdata=plotdata[[All,All,1]]; colors=ColorData/@Range[n]; Rasterize[Graphics[{PointSize[0.001],Riffle[colors,Point/@plotdata],FaceForm[],EdgeForm[Black],RegularPolygon[n],PointSize[0.01],Riffle[colors,Point/@circlepoints]},ImageSize-&gt;{400,400},PlotRange-&gt;1.1],&#034;Image&#034;,ImageSize-&gt;{400,400},RasterSize-&gt;{400,400}] , {n,3,8} ] // Partition[#,3]&amp; // ImageAssemble ![enter image description here] This explains why the regular triangle and the square have such an unique behavior; it does not &#039;blend&#039;. To be more precise: the triangle only excludes spaces, and the square exactly covers the plane again. For higher order regular polygons you see that there is overlap and that creates high and low density regions creating a bunch of patterns. For the case of restricted jumping, like we did last time, we can also do the coloring, here the modified code: ClearAll[CreateSequence,CreateSequenceImage] CreateSequence[n_,steps_,choices_]:=Mod[Accumulate[RandomChoice[choices,steps-1]~Prepend~1],n,1] CreateSequenceImage[n_,m_,choices_]:=Module[{seq,circlepoints,pts,plotdata,colors}, seq=CreateSequence[n,m,choices]; circlepoints=N@CirclePoints[n]; pts=Rest@FoldList[(#1+circlepoints[[#2]])/2&amp;,First[circlepoints],seq]; plotdata=Transpose[{pts,seq}]; plotdata=SortBy[GatherBy[plotdata,Last],#[[1,2]]&amp;]; plotdata=plotdata[[All,All,1]]; colors=ColorData/@Range[n]; Rasterize[Graphics[{FaceForm[],EdgeForm[Black],RegularPolygon[n],PointSize[0.001],Riffle[colors,Point/@plotdata],PointSize[0.03],Riffle[colors,Point/@circlepoints]},ImageSize-&gt;300,PlotRange-&gt;1.1],&#034;Image&#034;,RasterSize-&gt;{300,300}] ] Let&#039;s have a look at all the possible jumping-subsets for hexagons: Grid[Join @@@ Partition[{#, CreateSequenceImage[6, 10^4, #]} &amp; /@ Subsets[Range, {1, \[Infinity]}], UpTo], Frame -&gt; All] ![enter image description here] Some really nice patterns are now created! ## Fractional jumping ## Up to now we have always jumped half-way, let&#039;s change that, and see what happens. I will introduce alpha the factor that we jump. Historically we always have set that to 0.5 (half-way). In my definition 0 means not moving, and 1 going all the way to the next point. The code can be easily modified: ClearAll[sequence] sequence[n_,m_]:=RandomChoice[Range[n],m] FactorJump[n_,m_,\[Alpha]_]:=Module[{circlepoints,seq,pts,counts,img,bg}, circlepoints=N@CirclePoints[n]; seq=sequence[n,m]; pts=FoldList[(1-\[Alpha])#1+\[Alpha] circlepoints[[#2]]&amp;,First[circlepoints],seq]; counts=Transpose@BinCounts[pts,{-1.1,1.1,0.005},{-1.1,1.1,0.005}]; counts=Reverse[counts]; img=Image[1-counts/Max[counts]]; bg=Graphics[Graphics[{FaceForm[],EdgeForm[Black],RegularPolygon[n],Text[NumberForm[\[Alpha],{\[Infinity],2}],{0,1.05}]},ImageSize-&gt;500,PlotRange-&gt;1.1]]; bg=Rasterize[bg,&#034;Image&#034;,RasterSize-&gt;ImageDimensions[img],ImageSize-&gt;ImageDimensions[img]]; ImageMultiply[img,bg] ] Note that I also included the plotting of the density of the points using **BinCounts**, which gives smooth images. Let&#039;s try it out with some new alpha: FactorJump[3, 10^7, 0.3] ![enter image description here] pretty nifty! Let&#039;s make a movie changing alpha gradually from 0 to 1: n = 3; imgs = Table[FactorJump[n, 3 10^5, \[Alpha]], {\[Alpha], 0, 1, 0.01}]; Export[ToString[n] &lt;&gt; &#034;factor.gif&#034;, imgs, &#034;DisplayDurations&#034; -&gt; 1/25.0] ![enter image description here] Now for squares: ![enter image description here] pentagons: ![enter image description here] Of course we are not limited by our range 0 to 1, we can go beyond. (negative alpha means you run away, quickly going outside the screen, so that is not a good idea). Here for pentagons, and for alpha up to 1.8: ![enter image description here] ## Distance jumping ## Rather than jumping a certain fraction, let&#039;s jump a specific distance in the direction of our point. Again we modify the code quite easily: ClearAll[sequence,DistanceJump] sequence[n_,m_]:=RandomChoice[Range[n],m] DistanceJump[n_,m_,d_]:=Module[{circlepoints,seq,pts,counts,img,bg,reg,size}, circlepoints=N@CirclePoints[n]; seq=sequence[n,m]; pts=FoldList[#1+d Normalize[circlepoints[[#2]]-#1]&amp;,First[circlepoints],seq]; size=3; counts=Transpose@BinCounts[pts,{-size,size,size/250.0},{-size,size,size/250.0}]; counts=Reverse[counts]; reg=Quantile[Join@@counts,0.999]; img=Image[1- counts/reg]; bg=Graphics[Graphics[{FaceForm[],EdgeForm[Black],RegularPolygon[n],Text[NumberForm[d,{\[Infinity],2}],{0,-1.05}]},ImageSize-&gt;500,PlotRange-&gt;size]]; bg=Rasterize[bg,&#034;Image&#034;,RasterSize-&gt;ImageDimensions[img],ImageSize-&gt;ImageDimensions[img]]; ImageMultiply[img,bg] ] Let&#039;s try it out: DistanceJump[5, 10^6, 0.5] ![enter image description here] again we see patterns emerge; let&#039;s again make a movie varying the distance d: j=0; Dynamic[j] n=3; CloseKernels[]; LaunchKernels; DistributeDefinitions[DistanceJump,n] SetSharedVariable[j]; imgs=ParallelTable[j++;DistanceJump[n,10^6,d],{d,0.1,3,0.01}]; Export[ToString[n]&lt;&gt;&#034;distance.gif&#034;,imgs,&#034;DisplayDurations&#034;-&gt;1/25.0] ![enter image description here] and for a pentagon: ![enter image description here] Really nice visualization with very complicated patterns emerging from the very simple equations! Hope you enjoyed this little exploration. : http://community.wolfram.com//c/portal/getImageAttachment?filename=26415distance.gif&amp;userId=73716 : http://community.wolfram.com/groups/-/m/t/1025180 : http://community.wolfram.com/groups/-/m/t/1025180 : http://community.wolfram.com/groups/-/m/t/1047603 : http://community.wolfram.com//c/portal/getImageAttachment?filename=colored.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=6subsetcolored.png.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=factorjumptest1.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=13373factor.gif&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=93424factor.gif&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=102355factor.gif&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=107365Largefactor.gif&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=distancejumptest1.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=68463distance.gif&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=26415distance.gif&amp;userId=73716 Sander Huisman 2017-03-24T23:06:24Z CreateWindows and FullScreen https://community.wolfram.com/groups/-/m/t/1639802 I am trying to output a graphic from a function. The display on a second remote monitor at full screen. That means that I do not want to see the scroll, or the control menus in top. The function states that it does equivalent to F12. But it does not output anything. CreateWindow[ SphericalPlot3D[ 1 + 2 Cos[2 \[Theta]], {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi}], Background -&gt; RGBColor[1, .9, .7], Window -&gt; FullScreenArea] Jose Calderon 2019-03-25T04:15:07Z Representation of symmetric group https://community.wolfram.com/groups/-/m/t/1637345 I can&#039;t seem to find any information/algorithms on generating matrix representations of the symmetric group. Can someone point me in the right direction? John Garrison 2019-03-22T05:31:30Z Permute command on symmetric vs alternating groups https://community.wolfram.com/groups/-/m/t/1637855 Why does this happen? Permute[{0,0,0}, SymmetricGroup] {{0,0,0}} Permute[{0,0,0}, AlternatingGroup] {{0,0,0}, {0,0,0}, {0,0,0}} Michael Jennings 2019-03-22T20:09:50Z Get symbolic expressions for summing sequences? https://community.wolfram.com/groups/-/m/t/1636014 Hello! Let&#039;s say that I am having this sequence: a(n) = 2*a(n-1) - a(n-2) + 2*a(n-3) + a(n-4) + a(n-5) - a(n-7) - a(n-8) with a == 1, a == 1, a == 1, a == 2, a == 6, a == 14, a == 28, a == 56 as the base cases. Now, I want to find the sum of a(1)^3 + a(2)^3 + .... + a(n)^3 SYMBOLICALLY, with respect to the first 8 base cases. There will be of course some cross terms ie. a(1)*a(2), etc, but it should be in terms of only the first 8 base cases. I can use the RecurrenceTable and Total for finding numbers, but how can I do it symbolically and also simplify it to only the first 8 base cases? Thank you very much in advance. Thanos Papas 2019-03-19T15:37:21Z How can I get full-range plotting with ParametricPlot? https://community.wolfram.com/groups/-/m/t/1639076 A puzzle with ParametricPlot. The first plot masks part of the range, but nevertheless plots test points in the masked area. Can I get rid of the mask? The second plot shows no mask(s), but I don&#039;t know why it works. Can I get an informed comment? Thanks for your time, Whiffee Bollenbach d2 = ImplicitRegion[ 0 &lt;= x &lt; \[Infinity] \[And] -\[Infinity] &lt; y &lt; \[Infinity], {x, y}]; p2 = ParametricPlot[ Through[{Re, Im}[(x + I y)^0.5]], {x, y} \[Element] d2, PlotRange -&gt; {{-1, 3.5}, {-3, 3}}, Frame -&gt; True, ImageSize -&gt; 200, AspectRatio -&gt; Automatic, Epilog -&gt; {{Blue, PointSize[0.025], Point[{Re[(x + I y)^0.5] /. {x -&gt; 0, y -&gt; -10}, Im[(x + I y)^0.5] /. {x -&gt; 0, y -&gt; -10}}]}, {Red, PointSize[0.025], Point[{Re[(x + I y)^0.5] /. {x -&gt; 0, y -&gt; -1}, Im[(x + I y)^0.5] /. {x -&gt; 0, y -&gt; -1}}]}, {Black, PointSize[0.025], Point[{Re[(x + I y)^0.5] /. {x -&gt; 0, y -&gt; 1}, Im[(x + I y)^0.5] /. {x -&gt; 0, y -&gt; 1}}]}}]; p3 = ParametricPlot[ Through[{Re, Im}[x + (I y)^3.5]], {x, y} \[Element] d2, PlotRange -&gt; {{-1, 3.5}, {-3, 3}}, Frame -&gt; True, ImageSize -&gt; 200, AspectRatio -&gt; Automatic, Epilog -&gt; {{Blue, PointSize[0.025], Point[{Re[(x + I y)^0.5] /. {x -&gt; 0, y -&gt; -10}, Im[(x + I y)^0.5] /. {x -&gt; 0, y -&gt; -10}}]}, {Red, PointSize[0.025], Point[{Re[(x + I y)^0.5] /. {x -&gt; 0, y -&gt; -1}, Im[(x + I y)^0.5] /. {x -&gt; 0, y -&gt; -1}}]}, {Black, PointSize[0.025], Point[{Re[(x + I y)^0.5] /. {x -&gt; 0, y -&gt; 1}, Im[(x + I y)^0.5] /. {x -&gt; 0, y -&gt; 1}}]}}]; Row[{p2, p3}] Whiffee Bollenbach 2019-03-24T21:26:59Z [GIF] Symmetric Minimality (symmetric lattice trefoil knot) https://community.wolfram.com/groups/-/m/t/1639178 ![Symmetric lattice trefoil knot] **Symmetric Minimality** After I posted [_Minimal_] on [Mathstodon], [David Eppstein asked about] and then [found] a minimal lattice trefoil with 3-hedral symmetry. Here are the (mean-centered) vertices: symmetrictrefoil = # - Table[Mean[#], {Length[#]}] &amp;[{{0, 0, 0}, {1, 0, 0}, {2, 0, 0}, {2, 0, 1}, {2, 1, 1}, {2, 2, 1}, {1, 2, 1}, {0, 2, 1}, {-1, 2, 1}, {-1, 2, 0}, {-1, 2, -1}, {-1, 1, -1}, {0, 1, -1}, {1, 1, -1}, {1, 1, 0}, {1, 1, 1}, {1, 1, 2}, {1, 2, 2}, {1, 3, 2}, {0, 3, 2}, {0, 3, 1}, {0, 3, 0}, {0, 2, 0}, {0, 1, 0}}]; The animation demonstrates the 3-fold symmetry which is lacking from the relatively asymmetric minimal trefoil from [_Minimal_] (which was just the one built into [KnotPlot]). smootheststep[t_] := -20 t^7 + 70 t^6 - 84 t^5 + 35 t^4; DynamicModule[{p = {-1, 0, 0}, q = Normalize[{0, 1, 1}], a, b, n, M, pl, θ, cols = RGBColor /@ {&#034;#404b69&#034;, &#034;#f73859&#034;, &#034;#283149&#034;}}, Manipulate[ θ = 2 π/3 smootheststep[t]; {n, b} = RotationMatrix[θ, {-1, -1, 1}].# &amp; /@ {p, q}; a = Cross[b, n]; M = {a, b}; pl = M.# &amp; /@ symmetrictrefoil; Graphics[{ Thickness[.0052], cols[], Line[Append[#, First[#]] &amp;[pl]], cols[], Disk[M.#, .05] &amp; /@ Sort[symmetrictrefoil, n.#1 &gt; n.#2 &amp;]}, ImageSize -&gt; 540, PlotRange -&gt; {{-2.75, 2.75}, {-2.5, 3}}, Background -&gt; cols[[-1]]], {t, 0, 1}] ] : https://community.wolfram.com//c/portal/getImageAttachment?filename=lt20q.gif&amp;userId=610054 : https://mathstodon.xyz : https://mathstodon.xyz/@11011110/101768975543746276 : https://mathstodon.xyz/@11011110/101770193254542093 : https://community.wolfram.com/groups/-/m/t/1634541 : https://knotplot.com Clayton Shonkwiler 2019-03-24T20:43:19Z Mathematica speedup from 2019 iMac over late 2015 iMac? https://community.wolfram.com/groups/-/m/t/1639163 My current computer, a late 2015 iMac 27” has a 4 GHz Core i7 processor, 32 GB RAM, 3 TB Fusion drive, and Radeon R9 M395X with 4 GB VRAM, Retina display. What kind of speedup with Mathematica, if any, might I expect from a new, 2019, iMac 27” with the following configuration? - 3.6 GHz Core i9 processor (8-core) - 64GB RAM - 3 TB Fusion drive - Radeon Pro Vega 48 with 8GB HBM2 memory Although this new CPU has Turbo Boost up to 5 GHz, I’m concerned that the “default” of only 3.6 GHZ, being below my current 4 GHz, might impede perfornance. Presumably the graphics rendering will be faster, right? Or do the additional cores make up for that difference? In fact, can Mathematica take advantage of those additional cores (without my explicitly coding for parallel kernels)? Murray Eisenberg 2019-03-24T16:24:32Z Why is system of equations (6 variables) yielding a non-nonsensical answer? https://community.wolfram.com/groups/-/m/t/1638692 Hello, I am new to Mathematica, and I just downloaded it tonight. I need to do a very specific procedure: calculate a complicated system of equations in 6 variables. I have tried for hours on end to do this, following the instructions as they are listed in Mathematica: &#034;In a system of equations with multiple variables, you can solve for some or all of the variables by using a list in the second argument.&#034; I have done so, but my answer is given as one number, which makes no sense. My work is given below. Solve[{44826600000*a+406601000000*b+ 134691918588*c+656526*f+512206908*e+170700546*d-7642032.5==0,3757520000000*b +406601000000*a+1233170000000*c+5925820*f+4678814294*e+ 1544327542*d-69097900==0, 406601000000*c+134692000000*a+ 1233170000000*b+1967580*f+1544327592*e+512206908*d -22936700==0, 170700546*a+1544327592*b+512206908*c+2550*f+1967580*e+656526*d-29327.5==0, 512206908*a+4678814150*b+1544327592*c+7634*f+5925818*e+1967580*d-87833==0, 10*f+656526*a+5925820*b+1967580*c+7634*e+2550*d-113.5==0}, {a,b,c,d,e,f}] Answer: 4.06601 x 10^11. What is this answer??? I should be getting a different value for a, b, c, d, e, and f, not a single number. Can someone please help me and tell me what exactly I am doing wrong? Thanks! Quentin Moliterno 2019-03-24T02:43:24Z Is GraphDistance (and other graph analysis functions) compiled in 32bits? https://community.wolfram.com/groups/-/m/t/1637570 Hi. I have a Windows 10 PC with 32GB RAM and currently use Mathematica 11.3 I tried to obtain the GraphDistance between two nodes in a 500,000 node 600,000 vertex graph and Mathematica crashed without warning (all the fonts went from blue or black to dark purple, like when you exit the kernel). I thought that it was because my computer ran out of memory but I repeated the process with the Task Manager open and Mathematica never used more than 2GB RAM. Is it possible that GraphDistance is compiled in 32bits and this is the reason it crashes once it reaches 2GB? Related question: is there a way to obtain my GraphDistance in Mathematica for such a large network? It is kind of a trivial network in C++. Thanks! Fernando Fernando Perez 2019-03-22T16:01:52Z Mathematica: Solving for expression https://community.wolfram.com/groups/-/m/t/1638221 This may be a dumb question, but I often need to solve expressions for something other than a variable. As a trivial example, say we have a common-emitter amplifier: Vout = Vsupply - (Vin - Vbe)((hfe + 1)/hfe) * RC/RE And I want to solve it for the DC transfer function Vout/Vin. Can Mathematica do this, at all? Now, I understand there is actually no solution here, but a small change makes it solvable (and still easy to reason around): Vout = - (Vin - Vbe)((hfe + 1)/hfe)*RC/RE Now, this simple example I can solve easily. But there are complex expression created in cascades of stages and ladders that get a bit more complex in hurry... But even being to solve the simple problems would be nice as a &#034;calculator&#034; function. I can calculate square roots and look up logarithms in tables myself also, but I sure prefer to work with a calculator. Any ideas? Maybe I just missed something obvious? Jan Brittenson 2019-03-23T05:18:07Z Import large data files for Machine Learning? https://community.wolfram.com/groups/-/m/t/1599142 I want to run a machine learning task on my Win 10 PC, 16GB RAM, Mathematica 11.3.0, but I am facing the following problems: training set size 10GB CSV file, with 700,000,000 x 2 datasets. Mathematica simply stops during import via Import or ReadList function. My idea is to split the input file into several smaller files that could be imported and to load the smaller files in a batch to feed the Predict function or perhabs a neural network. Any idea how to make it happen? Do you have a better idea? Many thanks in advance for support! Jürgen Kanz 2019-01-26T11:41:17Z How do I create a loop of these lines of code? https://community.wolfram.com/groups/-/m/t/1637113 Hello Community, I have a question about how to create a loop made with this code and expressions as follows: dig = 100; a = IntegerDigits; b = FromDigits[RandomSample[a]]; c = If[b &gt; 10^9, b, FromDigits[RandomSample[a]]]; d = If[c &gt; 10^9, c, FromDigits[RandomSample[a]]]; e = If[d &gt; 10^9, d, FromDigits[RandomSample[a]]]; f = If[e &gt; 10^9, e, FromDigits[RandomSample[a]]]; g = If[f &gt; 10^9, f, FromDigits[RandomSample[a]]]; h = If[g &gt; 10^9, g, FromDigits[RandomSample[a]]]; m = IntegerPart[h/9999999999*10^dig]; G = FromDigits[RandomSample[IntegerDigits[m]]]; aa = If[G &gt; 10^(dig - 1), G, FromDigits[RandomSample[IntegerDigits[m]]]]; bb = If[aa &gt; 10^(dig - 1), aa, FromDigits[RandomSample[IntegerDigits[m]]]]; cc = If[bb &gt; 10^(dig - 1), bb, FromDigits[RandomSample[IntegerDigits[m]]]]; dd = If[cc &gt; 10^(dig - 1), cc, FromDigits[RandomSample[IntegerDigits[m]]]]; ee = If[dd &gt; 10^(dig - 1), dd, FromDigits[RandomSample[IntegerDigits[m]]]]; ff = If[ee &gt; 10^(dig - 1), ee, FromDigits[RandomSample[IntegerDigits[m]]]]; gg = If[ff &gt; 10^(dig - 1), ff, FromDigits[RandomSample[IntegerDigits[m]]]]; P = If[gg &gt; 10^(dig - 1), gg, FromDigits[RandomSample[IntegerDigits[m]]]]; z = StringPartition[ToString[P], 2]; zz = StringCount[ z, {&#034;11&#034;, &#034;22&#034;, &#034;33&#034;, &#034;44&#034;, &#034;55&#034;, &#034;66&#034;, &#034;77&#034;, &#034;88&#034;, &#034;99&#034;, &#034;00&#034;}]; s = StringPartition[StringDrop[ToString[P], 1], 2]; ss = StringCount[ s, {&#034;11&#034;, &#034;22&#034;, &#034;33&#034;, &#034;44&#034;, &#034;55&#034;, &#034;66&#034;, &#034;77&#034;, &#034;88&#034;, &#034;99&#034;, &#034;00&#034;}]; k = N[2*(Count[zz, 1] + Count[ss, 1])/dig, 4] V = If[k &lt; 0.16, P, &#034;xx&#034;] The question is this: When the conditions in line *V* are satisfied for *k* the result of *P* must be shown (only with one result, the first that meets the condition) and when conditions are not satisfied, instead of *&#034;xx&#034;* I want the program to return to expressions from line *G* onwards until the condition in *V* is fulfilled. In a way every time I evaluate this entire code the condition will be fulfilled. How do I do that? ... I tried everything I know but I do not understand how to do this ... can anyone give me an example that I can apply in this situation or even use my lines of code to solve this doubt of mine? Thanks a lot for the help. Claudio Chaib 2019-03-21T18:57:02Z Plotting two graphs together and doing manipulation https://community.wolfram.com/groups/-/m/t/1637789 I need help in plotting two graphs together and doing some sort of manipulation. I have a sequence: A=ListPlot[List, PlotRange -&gt; {{0, 201}, {-0.01, 0.01}}], where List=Table[a[n], {n, 200}] and a[n_]=(-1)^n/n^2 And I need two parallel lines which can be manipulated, so I have written sth like that, but I am not sure if it is correct: B[z_] = Plot[{z,-z}, {x, 0, 200}, Filling -&gt; {1 -&gt; {2}}] And I have written such a command to plot A and B and to be able to change values of &#039;z&#039;: Manipulate[Show[A, B], {z, 0.000001, 0.02}] But unfortunately, it doesn&#039;t work. It drew only a Listplot and skipped B. Where did I make a mistake? Kamil Sokołowski 2019-03-22T20:50:22Z Solve a system of Differential Equations with EigenSystem DSolve MatrixExp? https://community.wolfram.com/groups/-/m/t/1632964 In calculating a system of differential equations, I used 3 different methods: EigenSystem, DSolve and MatrixExp. DSolve and MatrixExp porduced the same answers but a different answers than EigenSystem and I don&#039;t understand why (See Attached). In all three cases, I used a default value of {1,1} for the values of the arbitrary constants. It appears that DSolve and MatrixExp simply dropped the negative exponent. I don&#039;t understand what I am overlooking. Thanks, Mitch Sandlin Mitchell Sandlin 2019-03-15T16:41:44Z How to export all variables of a notebook in a text file? https://community.wolfram.com/groups/-/m/t/1637561 Hi, I would like to export all variables of a notebook in a text file, in two columns: name of variables and variable value. For instance,let&#039;s consider the notebook: In:= a = 20 b = 3 c = 10 Out= 20 Out= 3 Out= 10 The file, let&#039;s name it &#034;output.txt&#034; should be as follows: a = 20 b = 3 c = 10 Thank you in advance. Andrea Mastellone 2019-03-22T15:21:57Z Calculate this integral with NIntegrate? https://community.wolfram.com/groups/-/m/t/1635118 Hi, This integral seems to have a singularity.. all constants are defined. NIntegrate[Exp[-alpha*Sqrt[(R^2 - 2*x*R*Cos[theta] + (x)^2) + z^2]], {z, 10*-a, 10*(L - a)}, {theta, 0, 2 Pi}] I get a NIntegrate::slwcon warning. Haress Nazary 2019-03-18T14:54:19Z Divergent response of a LTI system https://community.wolfram.com/groups/-/m/t/1637180 Good morning, I have a mathematical question related to a particular transfer function. Let&#039;s say I have an LC transfer function (if you don&#039;t know anything about electronics it doesn&#039;t matter, it&#039;s just mathematics): 1/(1 + s^2 L C) with L and C &gt; 0. It has two complex conjugate poles at j/Sqrt[LC]. This means that for the real frequency 1/Sqrt[LC] at input the system will respond with a divergent sinusoid at that frequency. My question is: what type of system is this? In my opinion it is linear time invariant since I could apply the Laplace transformation on it. Still the fact that the output diverges buzzes me. How can this divergence be explained with a better insight? Ermanno Citraro 2019-03-22T05:53:39Z RaspberryPi 3 Model B+ and I2C issue https://community.wolfram.com/groups/-/m/t/1431827 Hello, I have been struggling with SenseHAT and Mathematica. First Mathematica was not able to find SenseHAT at all even than I followed I2C setup guide but eventually after adding following line to /boot/config.txt I was able to make some progress: dtparam=i2c0=on After that there is two i2c buses in the system: pi@raspberrypi:~$ ls -l /dev/i2c-* crw-rw---- 1 root i2c 89, 0 Aug 30 21:34 /dev/i2c-0 crw-rw---- 1 root i2c 89, 1 Aug 30 21:34 /dev/i2c-1 However Mathematica reports variety I2C errors: pi@raspberrypi:~ $wolfram Wolfram Language 11.3.0 Engine for Linux ARM (32-bit) Copyright 1988-2018 Wolfram Research, Inc. In:= sensehat = DeviceOpen[&#034;SenseHAT&#034;] Out= DeviceObject[{SenseHAT, 1}] In:= DeviceRead[sensehat, &#034;Temperature&#034;] DeviceWrite::unknownMRAAWriteError: An unknown error occured writing to the I2C bus. DeviceWrite::unknownMRAAWriteError: An unknown error occured writing to the I2C bus. DeviceWrite::unknownMRAAWriteError: An unknown error occured writing to the I2C bus. General::stop: Further output of DeviceWrite::unknownMRAAWriteError will be suppressed during this calculation. Out= 42.4979 degrees Celsius when investigating further linux journal it seems that libmraa (presumably of Mathematica MRAALink) tries to use I2C-0 bus: Aug 30 21:38:05 raspberrypi libmraa: libmraa version v1.6.1 initialised by user &#039;pi&#039; with EUID 100 Aug 30 21:38:05 raspberrypi libmraa: libmraa initialised for platform &#039;Raspberry Pi Model B Rev 1&#039; Aug 30 21:38:05 raspberrypi libmraa: i2c_init: Selected bus 0 Aug 30 21:38:22 raspberrypi libmraa: i2c0: write: Access error: Remote I/O error Aug 30 21:38:22 raspberrypi libmraa: i2c0: write: Access error: Remote I/O error However as far as I can tell the SenseHAT is in i2c bus 1. So I removed &#034;dtparam=i2c0=on&#034; and after reboot added symbolic link for i2c-0 from i2c-1: pi@raspberrypi:/$ ls -la /dev/i2c-* lrwxrwxrwx 1 root root 10 Aug 30 21:43 /dev/i2c-0 -&gt; /dev/i2c-1 crw-rw---- 1 root i2c 89, 1 Aug 30 21:41 /dev/i2c-1 and tried again SenseHAT in Mathematica which seems to work now: pi@raspberrypi:/ $wolfram Wolfram Language 11.3.0 Engine for Linux ARM (32-bit) Copyright 1988-2018 Wolfram Research, Inc. In:= sensehat = DeviceOpen[&#034;SenseHAT&#034;] Out= DeviceObject[{SenseHAT, 1}] In:= DeviceRead[sensehat, &#034;Temperature&#034;] Out= 38.9896 degrees Celsius So for me it looks that Matkematica uses wrong I2C bus at least in this particular model: pi@raspberrypi:/dev$ cat /proc/device-tree/model Raspberry Pi 3 Model B Plus Rev 1.3 pi@raspberrypi:/ $cat /etc/os-release PRETTY_NAME=&#034;Raspbian GNU/Linux 9 (stretch)&#034; NAME=&#034;Raspbian GNU/Linux&#034; VERSION_ID=&#034;9&#034; VERSION=&#034;9 (stretch)&#034; ID=raspbian ID_LIKE=debian HOME_URL=&#034;http://www.raspbian.org/&#034; SUPPORT_URL=&#034;http://www.raspbian.org/RaspbianForums&#034; BUG_REPORT_URL=&#034;http://www.raspbian.org/RaspbianBugs&#034; I think this should be fixed to Mathematica. Teemu Ahola 2018-08-30T18:49:14Z Open links from cloud notebook in the same tab https://community.wolfram.com/groups/-/m/t/1636977 [@Jan Poeschko][at0] gave a talk at WTC 2018 on [developing a blog in the Wolfram Cloud using notebooks]. In the presentation he&#039;s able to navigate between different pages (notebooks) without leaving the tab. I&#039;ve deployed his same code but every time I click a link it opens a new tab. Can someone tell me if this is a browser setting, Wolfram Cloud setting, or notebook/deployment expression? Thanks, Eric : https://youtu.be/m5dxZ6OKrC4 [at0]: https://community.wolfram.com/web/jpoeschko Eric Smith 2019-03-21T19:14:20Z Coding challenge: Unfold a nested association https://community.wolfram.com/groups/-/m/t/1636998 I&#039;m embarrassed by my code because there has to be a better way to do it. Here&#039;s a hierarchical list of lab tests Category --&gt; Class --&gt; Test --&gt; Status &lt;|&#034;Asphaltene&#034; -&gt; &lt;|&#034;Flocculation Point Apparatus&#034; -&gt; &lt;|&#034;FPA&#034; -&gt; &#034;Not started&#034;|&gt;, &#034;Miscellaneous Asphaltenes&#034; -&gt; &lt;|&#034;Asphaltene Content (Heptane \ Insolubles)&#034; -&gt; &#034;Not started&#034;|&gt;|&gt;, &#034;General Characterization&#034; -&gt; &lt;|&#034;Chemical Stability&#034; -&gt; &lt;|&#034;Long Term \ HT Stability&#034; -&gt; &#034;Not started&#034;, &#034;Long Term Low Temp Stability&#034; -&gt; &#034;Not started&#034;|&gt;, &#034;Pour Point&#034; -&gt; &lt;|&#034;Pour Point&#034; -&gt; &#034;Not started&#034;|&gt;|&gt;|&gt; I want to turn it into this: Asphaltene - Flocculation Point Apparatus - FPA Asphaltene - Miscellaneous Asphaltenes - Asphaltene Content (Heptane Insolubles) General Characterization - Chemical Stability - Long Term HT Stability General Characterization - Chemical Stability - Long Term Low Temp Stability General Characterization - Pour Point - Pour Point There has to be a shortcut I&#039;m not thinking of so consider this a fun coding challenge to write the shortest form of the following function: (*A function to unfold an association*) unfoldAssociation[association_] := KeyValueMap[With[{key = #1, val = #2}, If[ ListQ[val], Function[v, &lt;|key -&gt; v|&gt;] /@ val, &lt;|key -&gt; val|&gt;] ] &amp;, association] (*Map it at each level*) unfold3LevelAssociation[association_]:=Block[{temp}, temp=Map[ unfoldAssociation,association, {2}]; temp=Flatten/@Map[ unfoldAssociation,temp, {1}]; temp=FixedPoint[Normal,unfoldAssociation[temp]/.Rule-&gt;List//Flatten]/.Rule-&gt;List; Partition[Flatten[temp],4] ] (*apply the unfold3layer function and do some formatting - drop the last column*) unfold3LevelAssociation[lProjectList[][&#034;Test Statuses&#034;]]; StringRiffle[#, &#034; - &#034;] &amp; /@ %[[;; , ;; 3]] // TableForm It works but it&#039;s ugly. What magic function does this in one line? Eric Smith 2019-03-21T20:55:18Z Analysing wikipedia articles per language & its native speakers population https://community.wolfram.com/groups/-/m/t/1617437 ![enter image description here] Today (21st of February) is UNESCO International Mother Language Day and I decided to celebrate it by exploring a bit [LanguageData] function. In particular, I will show how to create the top [BubbleChart] using two properties of LanguageData: &#034;NativePopulation&#034; and &#034;WikipediaArticleCount&#034;. The goal behind using these properties is to explore the &#034;fitness&#034; of languages by measuring the ratio &#034;number of wikipedia articles&#034;/&#034;number native speakers&#034; which will be represented by the size and color of the bubbles. This way I can easily illustrate how well-protected languages have a bigger internet presence (wikipedia articles counts per native speaker). And languages from poor countries like Tigrigna from Ethiopia and Eritrea (Africa) are underrepresented in wikipedia. Interestingly languages from small European countries like Sweden, Netherlands, Scotland, Catalonia, Basque Country,… are among the highest in terms of wikipedia activity. For this purpose, I preselected languages that have at least some native speakers alive and some wikipedia articles. Here there is a list of such languages (Disclaimer: some languages fulfilling such conditions might be missing): languages = {&#034;Abkhaz&#034;, &#034;Aceh&#034;, &#034;Adyghe&#034;, &#034;Afar&#034;, &#034;Afrikaans&#034;, &#034;Akan&#034;, &#034;AlbanianTosk&#034;, &#034;Amharic&#034;, &#034;Arabic&#034;, &#034;ArabicEgyptianSpoken&#034;, &#034;Aragonese&#034;, &#034;Armenian&#034;, &#034;Assamese&#034;, &#034;Asturian&#034;, &#034;Atikamekw&#034;, &#034;Avar&#034;, &#034;AzerbaijaniSouth&#034;, &#034;Bamanankan&#034;, &#034;Banjar&#034;, &#034;Bashkir&#034;, &#034;Basque&#034;, &#034;Bavarian&#034;, &#034;Belarusan&#034;, &#034;Beng&#034;, &#034;Bengali&#034;, &#034;BicolanoCentral&#034;, &#034;Bishnupriya&#034;, &#034;Bislama&#034;, &#034;Bosnian&#034;, &#034;Breton&#034;, &#034;Bugis&#034;, &#034;Bulgarian&#034;, &#034;BuriatChina&#034;, &#034;BuriatRussia&#034;, &#034;Burmese&#034;, &#034;BwamuCwi&#034;, &#034;CatalanValencianBalear&#034;, &#034;Cebuano&#034;, &#034;Chamorro&#034;, &#034;Chavacano&#034;, &#034;Chechen&#034;, &#034;Cherokee&#034;, &#034;Cheyenne&#034;, &#034;ChineseGan&#034;, &#034;ChineseHakka&#034;, &#034;ChineseMandarin&#034;, &#034;ChineseMinDong&#034;, &#034;ChineseMinNan&#034;, &#034;ChineseWu&#034;, &#034;ChineseYue&#034;, &#034;Choctaw&#034;, &#034;Chuvash&#034;, &#034;Corsican&#034;, &#034;CrimeanTurkish&#034;, &#034;Croatian&#034;, &#034;Czech&#034;, &#034;Danish&#034;, &#034;Dimli&#034;, &#034;Dutch&#034;, &#034;Dzongkha&#034;, &#034;English&#034;, &#034;Erzya&#034;, &#034;Ewe&#034;, &#034;Extremaduran&#034;, &#034;Faroese&#034;, &#034;FarsiEastern&#034;, &#034;Fijian&#034;, &#034;Finnish&#034;, &#034;FrancoProvencal&#034;, &#034;French&#034;, &#034;FrisianEastern&#034;, &#034;FrisianNorthern&#034;, &#034;Friulian&#034;, &#034;Gagauz&#034;, &#034;Galician&#034;, &#034;Ganda&#034;, &#034;Georgian&#034;, &#034;German&#034;, &#034;GermanPennsylvania&#034;, &#034;Gikuyu&#034;, &#034;Gilaki&#034;, &#034;Greek&#034;, &#034;Gujarati&#034;, &#034;HaitianCreoleFrench&#034;, &#034;Hausa&#034;, &#034;Hawaiian&#034;, &#034;Hebrew&#034;, &#034;Hindi&#034;, &#034;HindustaniFijian&#034;, &#034;Hungarian&#034;, &#034;Icelandic&#034;, &#034;Igbo&#034;, &#034;Ilocano&#034;, &#034;Indonesian&#034;, &#034;InuktitutGreenlandic&#034;, &#034;IrishGaelic&#034;, &#034;Italian&#034;, &#034;JamaicanCreoleEnglish&#034;, &#034;Japanese&#034;, &#034;Javanese&#034;, &#034;Kabardian&#034;, &#034;Kabiye&#034;, &#034;KalmykOirat&#034;, &#034;Kannada&#034;, &#034;KarachayBalkar&#034;, &#034;Karakalpak&#034;, &#034;Kashmiri&#034;, &#034;Kashubian&#034;, &#034;Kazakh&#034;, &#034;KhmerCentral&#034;, &#034;Kirghiz&#034;, &#034;Kolsch&#034;, &#034;KomiPermyak&#034;, &#034;KonkaniGoanese&#034;, &#034;Koongo&#034;, &#034;Korean&#034;, &#034;KurdishCentral&#034;, &#034;Kwanyama&#034;, &#034;Ladino&#034;, &#034;Lak&#034;, &#034;Lao&#034;, &#034;Lezgi&#034;, &#034;Ligurian&#034;, &#034;Limburgisch&#034;, &#034;Lingala&#034;, &#034;Lithuanian&#034;, &#034;Livvi&#034;, &#034;Lombard&#034;, &#034;LuriNorthern&#034;, &#034;Luxembourgeois&#034;, &#034;Macedonian&#034;, &#034;Maithili&#034;, &#034;Malayalam&#034;, &#034;Maldivian&#034;, &#034;Maltese&#034;, &#034;Maori&#034;, &#034;Marathi&#034;, &#034;MariEastern&#034;, &#034;MariWestern&#034;, &#034;Marshallese&#034;, &#034;Mazanderani&#034;, &#034;Minangkabau&#034;, &#034;Mingrelian&#034;, &#034;MirandaDoDouro&#034;, &#034;Moksha&#034;, &#034;Muskogee&#034;, &#034;NahuatlCentral&#034;, &#034;NapoletanoCalabrese&#034;, &#034;Narom&#034;, &#034;Nauruan&#034;, &#034;Navajo&#034;, &#034;Ndonga&#034;, &#034;Newar&#034;, &#034;Nyanja&#034;, &#034;OjibwaSevern&#034;, &#034;Osetin&#034;, &#034;Pampangan&#034;, &#034;Pangasinan&#034;, &#034;PanjabiEastern&#034;, &#034;PanjabiWestern&#034;, &#034;Papiamentu&#034;, &#034;PashtoCentral&#034;, &#034;Piemontese&#034;, &#034;PitcairnNorfolk&#034;, &#034;Polish&#034;, &#034;Pontic&#034;, &#034;Portuguese&#034;, &#034;Ravula&#034;, &#034;Romanian&#034;, &#034;RomanianMacedo&#034;, &#034;RomaniVlax&#034;, &#034;Romansch&#034;, &#034;Rundi&#034;, &#034;Russian&#034;, &#034;Rusyn&#034;, &#034;Rwanda&#034;, &#034;SaamiNorth&#034;, &#034;SaintLucianCreoleFrench&#034;, &#034;Samoan&#034;, &#034;Sango&#034;, &#034;Sanskrit&#034;, &#034;Saterfriesisch&#034;, &#034;SaxonLow&#034;, &#034;Schwyzerdutsch&#034;, &#034;Scots&#034;, &#034;ScottishGaelic&#034;, &#034;Serbian&#034;, &#034;Shona&#034;, &#034;Sicilian&#034;, &#034;Sindhi&#034;, &#034;Sinhala&#034;, &#034;Slovak&#034;, &#034;Slovenian&#034;, &#034;Somali&#034;, &#034;SorbianLower&#034;, &#034;SorbianUpper&#034;, &#034;SothoNorthern&#034;, &#034;SothoSouthern&#034;, &#034;Spanish&#034;, &#034;Sranan&#034;, &#034;Sunda&#034;, &#034;Swahili&#034;, &#034;Swati&#034;, &#034;Swedish&#034;, &#034;Tagalog&#034;, &#034;Tahitian&#034;, &#034;Tajiki&#034;, &#034;Tamil&#034;, &#034;Tatar&#034;, &#034;Telugu&#034;, &#034;Tetun&#034;, &#034;Thai&#034;, &#034;TibetanCentral&#034;, &#034;Tigrigna&#034;, &#034;TokPisin&#034;, &#034;Tongan&#034;, &#034;Tsonga&#034;, &#034;Tswana&#034;, &#034;Tulu&#034;, &#034;Tumbuka&#034;, &#034;Turkish&#034;, &#034;Turkmen&#034;, &#034;Tuvin&#034;, &#034;Udmurt&#034;, &#034;Ukrainian&#034;, &#034;Urdu&#034;, &#034;Uyghur&#034;, &#034;Venda&#034;, &#034;Venetian&#034;, &#034;Veps&#034;, &#034;Vietnamese&#034;, &#034;Vlaams&#034;, &#034;Walloon&#034;, &#034;WarayWaray&#034;, &#034;Welsh&#034;, &#034;Wolof&#034;, &#034;Xhosa&#034;, &#034;Yakut&#034;, &#034;YiddishEastern&#034;, &#034;YiSichuan&#034;, &#034;Yoruba&#034;, &#034;Zeeuws&#034;, &#034;Zulu&#034;}; Then, using LanguageData it&#039;s quite straightforward to get the native speakers population and the number of wikipedia articles. We can also easily compute the aforementioned ratio: bubbles = Map[Callout[{#[], #[], #[]/#[]}, #[]] &amp;, LanguageData[ languages, {&#034;Name&#034;, &#034;NativePopulation&#034;, &#034;WikipediaArticleCount&#034;}]] Finally we can plot the BubbleChart: BubbleChart[ bubbles, ScalingFunctions -&gt; {&#034;Log&#034;, &#034;Log&#034;, Automatic}, ColorFunction -&gt; Function[{x, y, z}, Hue[Log[1 + z]]], ColorFunctionScaling -&gt; False, PlotLabel -&gt; Style[&#034;Language Wikipedia Articles Per Native Speaker&#034;, Bold, 24], FrameLabel -&gt; {Style[&#034;Number Of Native Speakers&#034;, 20], Style[&#034;Number Of Wikipedia Articles&#034;, 20]}, PlotTheme -&gt; &#034;Detailed&#034;, ImageSize -&gt; 800] (See Top BubbleChart) It&#039;s really interesting to see that most of the biggest bubbles tend to be from languages spoken in developed countries but they don&#039;t have their own state yet; i.e. Basque, Scots, Catalan, Breton... My mother tongue is [Catalan] and I&#039;m quite happy to see that it&#039;s still quite healthy (at least according to its wikipedia activity). PS: Two years ago [@Vitaliy Kaurov][at0] wrote a really nice post about the same celebration day. You can read it [here]. Happy International Mother Language Day! [at0]: https://community.wolfram.com/web/vitaliyk : https://community.wolfram.com//c/portal/getImageAttachment?filename=bubblechart_Languages.png&amp;userId=95400 : https://reference.wolfram.com/language/ref/LanguageData.html : https://reference.wolfram.com/language/ref/BubbleChart.html : https://en.wikipedia.org/wiki/Catalan_language : https://community.wolfram.com/groups/-/m/t/1019123 Jofre Espigule 2019-02-22T01:45:41Z SplineToLine function from David Park's "Presentations" add-on? https://community.wolfram.com/groups/-/m/t/1636443 What is the definition of the function SplineToLine that was at one time included in David Park&#039;s *Presentations* add-on application? The current version of that proprietary add-on, which I have, does not seem to include that function, although it has a commented-out reference to it... DeclarePackage[&#034;PresentationsDSplineDrawing&#034;,{&#034;DrawIndexedPoints&#034;,&#034;SplineToLine&#034;}]; ... but I find no SplineDrawing package. And the &#034;Free Presentations&#034; version of the add-on, which is more or less a &#034;run-time&#034; version of the full add-on and omits documentation, contains no reference whatsoever in its packages to SplineToLine. Or, can you tell me whether the function was superceded by a similar function with a different name, or whether somehow BSplineCurve or another built-in *Mathematica* function does the same thing? Note: The function is used in the paper &#034;Visualizing complex functions with the Presentations application,&#034; by David Park and myself, which appears in *The Mathematica Journal* vol. 11 (2009). The function is used in the form, e.g., circuit1 = SplineToLine[{{0.342528, -0.32536}, {0.369328, 0.492018}, {0.020937, 1.3094}, {-0.809841, 1.2826}, {-1.60042, 0.43842}, {-2.2436, -0.633552}, {-2.4044, -1.47773}, {-2.458, \ -2.20131}, {-1.52002, -2.5497}, {-0.421251, -2.05391}, {0.181733, \ -1.08914}, {0.342528, -0.32536}}, Cubic, 40]; and that is in turn used within a graphic expression in the form: Arrow[circuit1] I note that in Park&#039;s package *DrawGraphics*, which was a predecessor to part of *Presentations*, the SplineToLine function was defined by: SplineToLine[pts : {{_, _}, {_, _} ..}, mode_, numpts_Integer?Positive] := Module[{sfun, n = Length[pts] - 1}, sfun = SplineFit[pts, mode]; Line[Table[sfun[t], {t, 0, n, n/(numpts - 1)}]] ] But that used the function SplineFit, formerly supplied with Mathematica but no longer included. So a substitute for SplineFit would suffice here. (See also https://mathematica.stackexchange.com/questions/193681/how-reproduce-old-splinefit-function.) Murray Eisenberg 2019-03-20T22:32:39Z Solve numerically a system of 5 ODEs using NDSolve? https://community.wolfram.com/groups/-/m/t/1636689 Hello all! I&#039;m trying to solve numerically a system of 5 ODEs using NDSolve[]. The problem is that some of the solutions take negative values, which doesn&#039;t make sense from a physical point of view. Is there any way to force these functions to stay non-negative? I&#039;ve read about the command WhenEvent[], but I don&#039;t know if it can be useful to fix this. Thank you in advance for any help! PD: This isn&#039;t my mathematical model, which is pretty large, but it might serve as an example: \[Phi] = 0.08; a = 0.7; b = 0.8; tmax = 200.0; V0 = 1.0; U0 = 1.0; i = 1.0; sol = NDSolve[{V == V0, U == U0, V&#039;[t] == V[t] - 1/3 V[t]^3 - U[t] + i, U&#039;[t] == \[Phi] (V[t] + a - b U[t])}, V[t], {t, 0, tmax}, DependentVariables -&gt; {V[t], U[t]}, Method -&gt; &#034;Adams&#034;]; Plot[V[t] /. sol, {t, 0, tmax}] David Aragonés 2019-03-20T20:07:08Z Why is Wolfram Absent from Forrester and Gartner's Data Science Reports? https://community.wolfram.com/groups/-/m/t/1636461 Dear Community members, the latest reports from Gartner and Forrester regarding data science and machine learning don&#039;t mention Wolfram in them but they both consider Mathworks. Does anybody have any ideas why? Ruben Garcia Berasategui 2019-03-21T09:24:18Z "Functional Dataflow"​ Wolfram Live Coding Session // Mar 19 https://community.wolfram.com/groups/-/m/t/1634956 For those interested in data science, please join us for a 1 hour Wolfram Live Coding Session Tuesday Mar 19 2019 at 4pm ET on Zoom (https://wolfram.zoom.us/j/4659236576) . Please see the Linkedin post: [https://www.linkedin.com/pulse/functional-dataflow-wolfram-live-coding-session-mar-19-calvitti-phd] Abstract This live coding session will focus on functional methods and patterns to write compact but flexible pipes for data science using real-world examples. The Wolfram Language is ideal to data science due to its functional orientation, large-scale symbolic processing and pattern matching abilities. Many of these features have no direct counterpart in object-oriented languages like Python. Consequently WL workflow is more programmer efficient: line-count ratios of 5:1 and often much more, are common relative to equivalent Python (inclusive of its extensive libraries). Functional programming lets you do more with less code and is more convenient and safer to refactor. After a brief tour of the forthcoming book Functional Dataflow, the focus will be on data transformation, aka &#034;data wrangling&#034; - recognized to be a highly time-consuming aspect of workflow - rather than on math or statistical methods. Exposition will be adapted from Excursion chapters in FD. Key skills described include composing operator pipes, combining tabular, hierarchical, temporal and graphical datasets, exploring queries on data slices then scaling up to the whole dataset, creating insightful visualizations, and writing flexible utility (eg one-liner operator) libraries for reuse in future projects. Overview Mathematica notebook containing links to data and dependencies: [enter link description here] : https://www.linkedin.com/pulse/functional-dataflow-wolfram-live-coding-session-mar-19-calvitti-phd : %22https://drive.google.com/drive/folders/1Af0yNPA5YZB0ep0Y9a6Vj2kbsWDSRqYV?usp=sharing%22 Alan Calvitti 2019-03-18T15:17:10Z The Chaos Game - Sierpinski triangles and beyond - part I https://community.wolfram.com/groups/-/m/t/1025180 EDIT: See also the follow up posts [here.] and [here]. ![enter image description here] Roughly 8-9 years ago a friend of mine told me I could make the Sierpinski triangle by starting at one of the vertices of an equilateral triangle, and then repeatedly jump half-way to one of the (randomly chosen) vertices. ## 0 memory ## The following code will accomplish that: ClearAll[sequence] sequence[n_,m_]:=RandomChoice[Range[n],m] pts=N@CirclePoints; pts=FoldList[(#1+pts[[#2]])/2&amp;,RandomChoice[pts],sequence[3,10]] Graphics[{{FaceForm[],EdgeForm[Black],RegularPolygon},Red,Arrow[Partition[pts,2,1]]}] giving: ![enter image description here] If one does this 1000s of time, and only mark the viewed points, one will get: ClearAll[sequence] sequence[n_,m_]:=RandomChoice[Range[n],m] pts=N@CirclePoints; pts=FoldList[(#1+pts[[#2]])/2&amp;,RandomChoice[pts],sequence[3,25000]]; Graphics[{FaceForm[],EdgeForm[Black],RegularPolygon,PointSize[0.001],Point[pts]}] giving: ![enter image description here] Which will indeed show that by randomly choosing a vertex we can still get structure! Quite a surprise! Of course we can do this with squares, pentagons, hexagons et cetera: ClearAll[sequence] sequence[n_,m_]:=RandomChoice[Range[n],m] Table[ circlepoints=N@CirclePoints[n]; pts=FoldList[(#1+circlepoints[[#2]])/2&amp;,RandomChoice[circlepoints],sequence[n,50000]]; Rasterize[Graphics[{FaceForm[],EdgeForm[Black],RegularPolygon[n],PointSize[0.001],Point[pts]},ImageSize-&gt;500,PlotRange-&gt;1.1],&#034;Image&#034;] , {n,3,8} ] // Partition[#, 3] &amp; // ImageAssemble giving: ![enter image description here] Very neat! (apart from 4, which just gives a homogeneous distribution of points). Here I run the pentagon many many points and high resolution to get: ![enter image description here] Where now the gray-color represents the density of points. ## 0 memory - restricted ## Now we can make the dynamics a bit more interesting by not moving to any other vertex but to only specific vertices. Imagine that we are at some position p, then we always have n choices (n being the number of sides): we can jump to the vertex 1 ahead, 2 ahead, .... n ahead (same as last time). ClearAll[CreateSequence,CreateSequenceImage] CreateSequence[n_,steps_,choices_]:=Mod[Accumulate[RandomChoice[choices,steps-1]~Prepend~1],n,1] CreateSequenceImage[n_,m_,choices_]:=Module[{seq,pts}, seq=CreateSequence[n,m,choices]; pts=N@CirclePoints[n]; seq=FoldList[(#1+pts[[#2]])/2&amp;,First[pts],seq]; Rasterize[Graphics[{PointSize[0.001],Point[seq]},ImageSize-&gt;500,PlotRange-&gt;1],&#034;Image&#034;,RasterSize-&gt;{300,300}] ] For a 3 sided polygon (i&#039;ve been told these are called triangles) we can jump 1, 2, or 3 ahead or subsets of that: Grid[Join@@@Partition[{#,CreateSequenceImage[3,10^5,#]}&amp;/@Subsets[Range,{1,\[Infinity]}],UpTo],Frame-&gt;All] ![enter image description here] Some interesting structure can be seen for some of the subsets. For squares: Grid[Join@@@Partition[{#,CreateSequenceImage[4,10^5,#]}&amp;/@Subsets[Range,{1,\[Infinity]}],UpTo],Frame-&gt;All] ![enter image description here] and for pentagons: Grid[Join@@@Partition[{#,CreateSequenceImage[5,10^5,#]}&amp;/@Subsets[Range,{1,\[Infinity]}],UpTo],Frame-&gt;All] ![enter image description here] the higher the number of sides, the more subsets we can choose. The number of subsets scales as 2^n -1 (minus one because the set can not be empty; we have to jump somewhere!). Lastly, for hexagons: Grid[Join@@@Partition[{#,CreateSequenceImage[5,10^5,#]}&amp;/@Subsets[Range,{1,\[Infinity]}],UpTo],Frame-&gt;All] ![enter image description here] Ok, you can try polygons with large number of sides on your own, but note that the number of subsets doubles every time. ## 1 memory - restricted ## We can even go beyond this, and consider the position of the penultimate vertex as well: ![enter image description here] We can consider 5 cases for a pentagon (or, in general, n cases). We will consider the last point to be at position 0 (or n), now the penultimate vertex could be in 5 different positions. For each of these combinations we can choose a different subset of {1,2,3,4,5}. Just to get an idea how many possibilities we now have: the number of subsets is 2^n - 1, and we have to choose n of these, so there will be (2^n-1)^n different systems to explore: Table[{n, (2^n - 1)^n}, {n, 3, 8}] // Grid ![enter image description here] as one can see, the combination grow very quickly. ClearAll[Stamp,CreateSequence2,CreateSequenceImage2] CreateSequence2[n_,m_,start:{start1_,start2_},choices_]:=Module[{out,last, penultimate,new,pos2}, {penultimate,last}=out=start; out=Reap[Do[ pos2=Mod[penultimate-last,n,1]; new=Mod[last+RandomChoice[choices[[pos2]]],n,1]; penultimate=last; last=new; Sow[new] , {m-2} ]][[2,1]]; Join[start,out] ] Stamp[n_,choices_]:=Module[{}, Image[Normal[SparseArray[Thread[Join@@MapThread[Thread[{#1,#2}]&amp;,{Range[Length[choices]],choices}]-&gt;1],{n,n}]]] ] CreateSequenceImage2[n_,m_,start:{start1_,start2_},choices_]:=Module[{seq,pts,ras,stamp}, seq=CreateSequence2[n,m,start,choices]; pts=N@CirclePoints[n]; seq=FoldList[(#1+pts[[#2]])/2&amp;,First[pts],seq]; ras=Rasterize[Graphics[{PointSize[0.001],Point[seq]},ImageSize-&gt;500,PlotRange-&gt;1],&#034;Image&#034;,RasterSize-&gt;{300,300}]; stamp=ImagePad[Stamp[n,choices],1,Red]; ImageCompose[ras,stamp,{Center,Bottom},{Center,Bottom}] ] Before looking at the general case, we can look at a small subset, namely one can **not** jump i ahead from the last, and j ahead from the penultimate. Here the example for i=1, and j =3: ClearAll[JumpPos2] JumpPos2[n_,{d1_,d2_}]:=Module[{pos}, pos=Range[n]; pos=DeleteCases[pos,d1]; DeleteCases[pos,Mod[d2+#,n,1]]&amp;/@Range[n] ] CreateSequenceImage2[4,10^4,{1,2},JumpPos2[4,{1,3}]] ![enter image description here] Very neat structure! Of course we can try all i and j from the set {1,2,3,4}: delta=Tuples[Range,2]; deltas=JumpPos2[4,#]&amp;/@delta; Grid[Join@@@Table[{{i,j},CreateSequenceImage2[4,10^4,{1,2},JumpPos2[4,{i,j}]]},{i,4},{j,4}],Frame-&gt;All] ![enter image description here] All very neat, but it is just a small subset of the 50625 possibilities. Here let&#039;s try 64 random ones: sc=Reverse@Subsets[Range,{1,\[Infinity]}]; Table[ CreateSequenceImage2[4,10^4,{1,2},RandomChoice[sc,4]] , {64} ] // Partition[#,8]&amp; // ImageAssemble ![enter image description here] As you can see very nice and rich structure! Notice that I &#039;stamped&#039; all of them with their &#039;input&#039;: CreateSequenceImage2[4, 10^4, {1, 2}, {{1, 4}, {3}, {1, 3, 4}, {1, 2, 3}}] ![enter image description here] And if one looks closely (save the image and zoom), one will see the &#039;stamp&#039; (or the rule) at the bottom: ![enter image description here] This can be read as follows: - The first (top) line, the white pixels are in places 1 and 4, so if the penultimate vertex was &#039;1&#039;, move 1 or 4 places from the last vertex - The 2nd line, the white pixel is in place 3, jump the position 3 ahead compared to last vertex - 3rd line, white pixel at 1,3, and 4. - 4th line 1, 2, or 3. Basically the nth line corresponds to the position of the penultimate vertex. and the white pixels corresponds to &#039;allowed&#039; number of jumps. I&#039;ll stop here for now. There are many more ideas to explore, I&#039;ll name a few: - &lt;s&gt;3D positions, 3D images&lt;/s&gt; See below the post of Henrik! - Anything other than regular polygons - Have different probabilities for each of the vertices... - Move in the perpendicular direction - ... See also the follow up posts [here.] and [here] and some additional visualizations below! : http://community.wolfram.com/groups/-/m/t/1039030 : http://community.wolfram.com/groups/-/m/t/1047603 : http://community.wolfram.com//c/portal/getImageAttachment?filename=opener.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=trial1.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=trial2.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=3446trial3.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=trial4b.jpg&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=trial5.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=trial6.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=trial7.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=trial8.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=explanation-01.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=trial9.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=trial10.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=trial11.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=5983trial12.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=trial13.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=trial14.png&amp;userId=73716 : http://community.wolfram.com/groups/-/m/t/1039030 : http://community.wolfram.com/groups/-/m/t/1047603 Sander Huisman 2017-03-04T21:41:21Z The Chaos Game - infinitygon and Markov-chains - part III https://community.wolfram.com/groups/-/m/t/1047603 In case you missed the first two parts check them out before reading this post: - [The Chaos Game - Sierpinski triangles and beyond - part I] - [The Chaos Game - part II] Today on the menu is to go from triangles, squares, pentagon, and hexagons all the way to a regular polygon with infinite vertices: the infinitygon, commonly known as a circle. So let&#039;s do the jumping again, but this time to a random point on a circle: ClearAll[CreateSequence,CreateSequenceImage] CreateSequence[steps_]:=RandomReal[{0,2Pi},steps] CreateSequenceImage[m_,\[Alpha]_]:=Module[{seq,circlepoints,pts,plotdata,colors}, seq=CreateSequence[m]; seq=Transpose[{Cos[seq],Sin[seq]}]; pts=Rest@FoldList[(1-\[Alpha])#1+\[Alpha] #2&amp;,seq]; Rasterize[Graphics[{FaceForm[],EdgeForm[Black],Circle[{0,0},1],PointSize[0.001],Point@pts,Text[NumberForm[\[Alpha],{\[Infinity],2}],{0,1.05}]},ImageSize-&gt;300,PlotRange-&gt;1.1],&#034;Image&#034;,RasterSize-&gt;300] ] here alpha is the step-factor, as before. Let&#039;s vary alpha from 0.1 to 0.9: ImageAssemble[Partition[CreateSequenceImage[30000, #] &amp; /@ Range[0.1, 0.9, 0.1], 3]] ![enter image description here] For small alpha it just tends to go the center, and for large alpha we go towards the rim, while the center remains inaccessible. Probability density function ---------------------------- Let&#039;s have a look at PDF of the radial position of the points to see how they are distributed for a range of alpha: ClearAll[CreateSequence,CreateSequenceHistogram] CreateSequence[steps_]:=RandomReal[{0,2Pi},steps] CreateSequenceHistogram[m_,\[Alpha]_,\[Delta]_:0.01]:=Module[{seq,circlepoints,pts,plotdata,colors}, seq=CreateSequence[m]; seq=Transpose[{Cos[seq],Sin[seq]}]; pts=Rest@FoldList[(1-\[Alpha])#1+\[Alpha] #2&amp;,seq]; Histogram[Norm/@pts,{0,1,\[Delta]},&#034;PDF&#034;,Frame-&gt;True,PlotLabel-&gt;\[Alpha],ImageSize-&gt;300,PlotRange-&gt;{{0,1},{0,4.5}}] ] Grid[Partition[CreateSequenceHistogram[10^6,#]&amp;/@Range[0.1,0.8,0.1],UpTo]] ![enter image description here] Especially the cases around 0.7 look interesting because of its unexpected shape, let&#039;s make high-resolution PDF for that alpha: CreateSequenceHistogram[10^7, 0.7, 0.001] ![enter image description here] So we can calculate this more quickly? Well, let&#039;s first look at how a single jump works: Clear[GetOverView,GetPlot\[Theta]r,GetCDFFunc,GetPDFFunc,r] GetOverView[b_,\[Alpha]_]:=Graphics[{Circle[],Red,Point[{b,0}],Black,Circle[{(1-\[Alpha])b,0},\[Alpha]]}] GetPlot\[Theta]r[b_,\[Alpha]_]:=Plot[Sqrt[\[Alpha]^2+(1-\[Alpha])^2 b^2+2\[Alpha] Cos[\[Theta]](1-\[Alpha])b],{\[Theta],0,2Pi},PlotRange-&gt;{0,1},AxesLabel-&gt;{&#034;\[Theta]&#034;,&#034;r&#034;},Ticks-&gt;{Range[0,2Pi,Pi/2]}] GetCDFFunc[b_, \[Alpha]_] := \[Piecewise] { {0, r &lt; Abs[b (1 - \[Alpha]) - \[Alpha]]}, {1, r &gt; b (1 - \[Alpha]) + \[Alpha]}, {((\[Pi] - ArcCos[(b^2 - r^2 - 2 b^2 \[Alpha] + \[Alpha]^2 + b^2 \[Alpha]^2)/(2 b (-\[Alpha] + \[Alpha]^2))])/\[Pi]), \!$$TagBox[&#034;True&#034;, &#034;PiecewiseDefault&#034;, AutoDelete-&gt;False, DeletionWarning-&gt;True]$$} } GetPDFFunc[b_,\[Alpha]_]:=D[GetCDFFunc[b,\[Alpha]],r] GetPDFFunc[b_, \[Alpha]_] := \[Piecewise] { {0, r - Abs[b (1 - \[Alpha]) - \[Alpha]] &lt; 0 || -b + r - \[Alpha] + b \[Alpha] &gt; 0}, {-(r/(b \[Pi] (-\[Alpha] + \[Alpha]^2) Sqrt[ 1 - (b^2 - r^2 - 2 b^2 \[Alpha] + \[Alpha]^2 + b^2 \[Alpha]^2)^2/( 4 b^2 (-\[Alpha] + \[Alpha]^2)^2)])), \!$$TagBox[&#034;True&#034;, &#034;PiecewiseDefault&#034;, AutoDelete-&gt;False, DeletionWarning-&gt;True]$$} } GetPlotCDF[b_,\[Alpha]_]:=Plot[GetCDFFunc[b,\[Alpha]],{r,0,1},AxesLabel-&gt;{&#034;r&#034;,&#034;CDF(r)&#034;},PlotRangePadding-&gt;None] GetPlotPDF[b_,\[Alpha]_]:=Plot[GetPDFFunc[b,\[Alpha]],{r,0,1},AxesLabel-&gt;{&#034;r&#034;,&#034;PDF(r)&#034;},PlotRangePadding-&gt;None] Manipulate[GraphicsGrid[Partition[{GetOverView[b,\[Alpha]],GetPlot\[Theta]r[b,\[Alpha]],GetPlotCDF[b,\[Alpha]],GetPlotPDF[b,\[Alpha]]},2],Spacings-&gt;Scaled[.5],ImageSize-&gt;600],{{b,0.78},0,1},{{\[Alpha],0.5},0,1}] ![enter image description here] the red point shown above can jump to any position of the inner circle. Top right shows the radius (from the center) as a function of theta for that circle. Bottom left shows the CDF of the possible radial positions, and bottom right the PDF of the possible radial positions. For the shown example you can see it will end up somewhere with a radius between 0.2 and 0.9, and most likely at those edges as the PDF is very large there. Starting from an initial flat PDF of equal probability as a function of radius we can iterate that PDF to get the next PDF if we &#039;jump those probabilities&#039;: ClearAll[GetMatrix,DoPDFFind] GetMatrix[binranges_,\[Alpha]_]:=Module[{midbins,func}, midbins=MovingAverage[binranges,2]; Transpose[Table[ func=GetCDFFunc[Subscript[midbins, [[i]]],\[Alpha]]; Differences[Table[func,{r,binranges}]] , {i,Length[midbins]} ]] ] DoPDFFind[\[Alpha]_,bins_Integer,n_:25]:=Module[{binwidth,initprob,prob,binranges,tmp,mat,plotdata}, binwidth=1/bins; initprob=1/bins; prob=N[ConstantArray[initprob,bins]]; binranges=N[Range[0,1,binwidth]]; mat=Re[GetMatrix[binranges,\[Alpha]]]; tmp=bins Nest[mat.#&amp;,prob,n]; plotdata={MovingAverage[binranges,2],tmp}\[Transpose]; plotdata=Mean/@Partition[plotdata,2]; ListLinePlot[plotdata,PlotRange-&gt;{{0,1},{0,All}},PlotStyle-&gt;Directive[Red,Thick]] ] Now we check if the PDF matches: \[Alpha]=0.7; Show[{CreateSequenceHistogram[10^7,\[Alpha],0.001],DoPDFFind[\[Alpha],500]},ImageSize-&gt;500,AxesLabel-&gt;{&#034;r&#034;,&#034;PDF(r)&#034;},PlotLabel-&gt;Row[{&#034;\[Alpha]=&#034;,\[Alpha]}],Frame-&gt;True] ![enter image description here] We can actually see the convergence: ClearAll[DoPDFFindAll] DoPDFFindAll[\[Alpha]_,bins_Integer,n_:25]:=Module[{binwidth,initprob,prob,binranges,tmp,mat}, binwidth=1/bins; initprob=1/bins; prob=N[ConstantArray[initprob,bins]]; binranges=N[Range[0,1,binwidth]]; mat=GetMatrix[binranges,\[Alpha]]; mat=Re[mat]; tmp=bins NestList[mat.#&amp;,prob,n]; tmp={MovingAverage[binranges,2],#}\[Transpose]&amp;/@tmp; tmp=(Mean/@Partition[#,2])&amp;/@tmp; ListLinePlot[tmp,PlotRange-&gt;{{0,1},{0,All}},Frame-&gt;True,PlotLegends-&gt;Automatic,ImageSize-&gt;600] ] DoPDFFindAll[0.7,500,5] ![enter image description here] As you can see, it quickly converges to its final form. What we&#039;ve done here is called a Markov chain, and this entire procedure could&#039;ve been simplified by using the **DiscreteMarkovProcess** function in the Wolfram Language: bins=500; binwidth=1/bins; initprob=1/bins; prob=N[ConstantArray[initprob,bins]]; binranges=N[Range[0,1,binwidth]]; mat=GetMatrix[binranges,0.7]; dmp=DiscreteMarkovProcess[prob,Transpose@mat]; sd=StationaryDistribution[dmp]; sdpdf=PDF[sd,x]; plotdata=Table[{x/bins,bins Chop[sdpdf]},{x,1,bins}]; ListPlot[plotdata,Joined-&gt;True,Frame-&gt;True,ImageSize-&gt;500,PlotRange-&gt;{0,4.5}] giving the same result: ![enter image description here] That is it for now... : http://community.wolfram.com/groups/-/m/t/1025180 : http://community.wolfram.com/groups/-/m/t/1039030 : http://community.wolfram.com//c/portal/getImageAttachment?filename=ChaosGame1.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=ChaosGame2.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=ChaosGame3.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=ChaosGame4.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=10684ChaosGame5.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=ChaosGame6.png&amp;userId=73716 : http://community.wolfram.com//c/portal/getImageAttachment?filename=ChaosGame8.png&amp;userId=73716 Sander Huisman 2017-03-29T22:52:21Z Enable code captions in Mathematica for Raspberry Pi? https://community.wolfram.com/groups/-/m/t/1636173 How can I enable code captions in Mathematica for Raspberry Pi? I followed this instruction ( https://reference.wolfram.com/language/workflow/ConfigureNonEnglishCodeCaptions.html ) but I can&#039;t find &#039;Preferences&#039; or settings. Questions: - Where can I find options? - How can I enable code captions? Jeongho Shin 2019-03-20T12:24:35Z Create 9 sided dice? https://community.wolfram.com/groups/-/m/t/1632720 G&#039;Day Folks, I am interested in creating a (3d printed) sudoku board... I wanted to start with (something like) a 9-sided dice. I think that if you &#039;sliced&#039; 9 flat faces into a sphere you&#039;d get something like it. :) The faces would need to be the same size and equidistant; which sounds simple. But, my mathematical knowledge isn&#039;t good enough for this. I&#039;ve been using Open SCAD for modelling; and have created a Dodecahedron (12 sided regular polyhedron); and I guess this would be OK - with 3 &#034;black&#034; faces. Does anyone have any suggestions!? cheers Steve Stephen Peter 2019-03-15T05:49:34Z [GIF] Minimal (Rotating minimal lattice trefoil knot) https://community.wolfram.com/groups/-/m/t/1634541 ![Rotating minimal lattice trefoil knot] **Minimal** This shows the trefoil knot lying on the simple cubic lattice with the fewest possible number of edges (it&#039;s [a theorem of Yuanan Diao] that the lattice stick number of the trefoil is 24), rotated, and projected to the plane. The 3D vertex locations are in [KnotPlot]. At least in the MacOS version of KnotPlot, the data is contained in the app bundle at /Applications/KnotPlot/KnotPlot.app/Contents/Resources/special/mscl/3.1; if you don&#039;t have KnotPlot installed, you can download the data by going to &lt;https://knotplot.com/download/&gt; and clicking the link to download kpdist.tar.gz. If you do that and then unzip to get a directory called kpsdist, the following commands will import the vertices and mean center: lattice31 = Import[&#034;kpdist/special/mscl/3.1&#034;, &#034;Table&#034;]; lattice31 = lattice31 - Table[Mean[lattice31], {Length[lattice31]}]; As usual for animations where I want to smoothly stop and start a motion, I&#039;m going to use the [smootheststep function]: smootheststep[t_] := -20 t^7 + 70 t^6 - 84 t^5 + 35 t^4; Here, then, is the Manipulate for the above animation (the giant obnoxious Which is to switch between different axis rotations, which I obviously could have made a little cleaner with some extra work): DynamicModule[{p, q, a, b, n, M, θ, pl, cols = RGBColor /@ {&#034;#fd5f00&#034;, &#034;#05004e&#034;, &#034;#fbfaf1&#034;}}, Manipulate[ Which[t &lt; 1 || t == 4, {p, q} = RotationMatrix[ArcTan[1/Sqrt]].{Normalize[{1, 1, 0}], {0, 0, 1}}; θ = -(ArcTan[1/Sqrt] + π/2) smootheststep[Mod[t, 1]]; {n, b} = RotationMatrix[θ].{p, q};, 1 &lt;= t &lt; 2, {p, q} = {{0, 0, 1}, {-(1/Sqrt), -(1/Sqrt), 0}}; θ = (π - ArcTan[Sqrt[23 - 16 Sqrt]]) smootheststep[Mod[t, 1]]; {n, b} = RotationMatrix[-θ, N@{Sqrt[1/17 (5 + 2 Sqrt)], Sqrt[1/17 (7 - 4 Sqrt)], Root[1 - 10 #1^2 + 17 #1^4 &amp;, 1]}].# &amp; /@ {p, q};, 2 &lt;= t &lt; 3, {p, q} = {{-1, 0, 0}, {0, 0, 1}}; θ = 3 π/4 smootheststep[Mod[t, 1]]; {n, b} = RotationMatrix[θ].{p, q}, 3 &lt;= t, {p, q} = {{1/Sqrt, 0, -(1/Sqrt)}, {-(1/Sqrt), 0, -(1/Sqrt)}}; θ = (π - ArcCot[(3 - 2 Sqrt + 2 Sqrt + Sqrt)/Sqrt[ 13 - 4 Sqrt + 2 Sqrt]]) smootheststep[Mod[t, 1]]; {n, b} = RotationMatrix[-θ, N@{Root[1 - 156 #1^2 + 1670 #1^4 - 5148 #1^6 + 4801 #1^8 &amp;, 1], Root[1 - 52 #1^2 + 870 #1^4 - 5044 #1^6 + 4801 #1^8 &amp;, 2], (2 + Sqrt)/Sqrt[ 94 - 48 Sqrt + 48 Sqrt - 32 Sqrt]}].# &amp; /@ {p, q}; ]; a = Cross[b, n]; M = {a, b}; pl = M.# &amp; /@ lattice31; Graphics[ {Thickness[.004], cols[], Line[Append[#, First[#]] &amp;[pl]], FaceForm[cols[[-1]]], EdgeForm[Directive[Thickness[.004], cols[]]], Disk[M.#, .05] &amp; /@ Sort[lattice31, n.#1 &gt; n.#2 &amp;]}, ImageSize -&gt; 540, PlotRange -&gt; 2.2, Background -&gt; cols[[-1]]], {t, 0, 4}] ] : https://community.wolfram.com//c/portal/getImageAttachment?filename=lt7q.gif&amp;userId=610054 : https://doi.org/10.1142/S0218216593000234 : https://knotplot.com : https://en.wikipedia.org/wiki/Smoothstep Clayton Shonkwiler 2019-03-17T23:11:24Z NDSolve piecewise differential equations associated with a water hammer? https://community.wolfram.com/groups/-/m/t/1636116 I am trying to solve the differential equations associated with water hammer. I have three pipe segments and I am using piecewise function for the differential equations. When I try to solve using NDSolve I get an error message &#034; The function value {0,.....} is not a list of numbers with dimension {50} at {x,P[x,t],V[x,t]}={...}&#034;. Can someone please help me with this. L1 = 3100; (*Length of first pipe*) L2 = 2700;(*Length of second pipe*) L3 = UnitConvert[Quantity[30., &#034;ft&#034;], &#034;m&#034;][[ 1]];(*Length of third pipe*) D1 = UnitConvert[Quantity[4, &#034;in&#034;], &#034;m&#034;][[ 1]]; (*Diameter of first pipe *) D2 = UnitConvert[Quantity[6, &#034;in&#034;], &#034;m&#034;][[ 1]];(*Diameter of second pipe *) D3 = UnitConvert[Quantity[1.75, &#034;in&#034;], &#034;m&#034;][[ 1]];(*Diameter of third pipe *) f = 0.002; (*Friction factor*) \[Rho] = 1000; (*Density of fluid*) Ef = 2.19*^9; (*Bulk modulous of fluid*) Ep = 210*^9;(*Elastic modulous of pipe*) ee = 4.5*^-5; (* Pipe roughness*) \[Mu] = 0.001002; (* Fluid viscosity in Poise*) Qmax = 0.1; A1 = Pi/4 D1^2; A2 = Pi/4 D2^2; A3 = Pi/4 D3^2; w = UnitConvert[Quantity[0.2, &#034;in&#034;], &#034;m&#034;][]; solEe = Solve[1/EE == 1/Ef + 1/(w Ep), EE][]; Ee = EE /. solEe; c = Sqrt[Ee/\[Rho]]; pde1 = D[P[x, t], t] + \[Rho] c^2 D[V[x, t], x] == 0 sol1 = NDSolve[{pde1, D[V[x, t], t] + 1/\[Rho] D[P[x, t], x] == Piecewise[{{-((f V[x, t] Abs[V[x, t]])/(2 D1)), 0 &lt; x &lt; L1}, {-((f V[x, t] Abs[V[x, t]])/(2 D2)) == 0, L1 &lt; x &lt; L1 + L2}, {-((f V[x, t] Abs[V[x, t]])/(2 D3)) == 0, L1 + L2 &lt; x &lt; L1 + L2 + L3}}], V[x, 0] == 0., P[x, 0] == 0., P[L1 + L2 + L3, t] == \[Rho]/(2 A3^2) (A3 V[L1 + L2 + L3, t])^2, V[L1 + L2 + L3, t] == 10 t}, {P, V}, {x, 0, L1 + L2 + L3}, {t, 0, 12}] srinivas.gk 2019-03-20T03:26:00Z [✓] Use Epilog in Manipulate? https://community.wolfram.com/groups/-/m/t/1635365 Hello, Epilog with &#034;No Points&#034; in Manipulate are not working as it should be. Does anyone know what&#039;s wrong? data2 = {{1, 10}, {2, 11}, {3, 20}, {4, 30}}; Manipulate[ ListLinePlot[data2 , Epilog -&gt; If[points == &#034;No Points&#034;, None , If[points == &#034;Points&#034;, {PointSize[0.04], Red, Point[data2]}] ]] , {points, {&#034;No Points&#034;, &#034;Points&#034;}} ] Thank you in advance ! Regards,....Jos Jos Klaps 2019-03-19T01:28:52Z [✓] Draw a bell curve with specified shading under the curve? https://community.wolfram.com/groups/-/m/t/1635282 Pardon the newbie-type question, but I&#039;m struggling with the Mathematica syntax for a bell curve. All I want to draw is a bell curve with mean 3 and SD of 0.3, but with the region between the graph, the x-axis, -2sigma and +1 sigma shaded (where sigma = standard deviation). Can someone help? TIA Geoffrey geoffrey Marnell 2019-03-19T01:13:46Z [✓] Play back an imported audio file using ListPlay? https://community.wolfram.com/groups/-/m/t/1634947 Dear all, I am a complete beginner at Mathematica in general, and at using it to try to investigate sounds in particular. I have done the following thing: Imported a short sample of spoken text using Import. I then looked at the plot of this imported object, using AudioPlot. The signal looks to be the same as how it was when I had the file open in another program (audacity). Then I used AudioData to extract a sample from the imported file. At this point I am confused as to what AudioData is actually doing, because when I then use ListPlot to visualize the extracted data, it had quite clearly been clipped. Then when I tried playing back the data using ListPlay, it has transformed a sample that is 9 seconds long into a load of unintelligible nonsense that lasts for nearly a minute. Can anyone give me a clue as to what is going on? Do I need to upload the sample file and notebook? Thanks very much! Sara Ann 2019-03-18T15:03:58Z Create dynamic PlotLegends? https://community.wolfram.com/groups/-/m/t/1635563 How to add dynamic PlotLegends to the below code? DynamicModule[{inputData = 0, dataSet = {}}, Column[{ InputField[Dynamic[inputData]], Button[&#034;Plot&#034;, AppendTo[dataSet, Table[inputData + i^j, {i, 5}, {j, 2}]]], Spacer, Dynamic@ListPlot[dataSet, Joined -&gt; True, ImageSize -&gt; {300}] }]] I would like to have a PlotLegends which appears only when the Button is pressed and ListPlot prints the curve, otherwise it shouldn&#039;t be visible. Also every time the Button is pressed ListPlot appends the new curve to the old one, therefore the PlotLegends should print the name for every printed curve, but one at the time. How to achieve that? I spent hours on searching some guidance which could give me at least an idea of how to start, but all I found is for the static PlotLegends. This is why I&#039;m asking you for a help. Kamila Szklarczyk-Marshall 2019-03-19T10:59:50Z [✓] Evaluate a function in two variables at a particular point (a,b)? https://community.wolfram.com/groups/-/m/t/1635060 I need evaluate a a function in two variables in a particular point, I mean, if f(x,y)=x^2+y^2, and p=(1,1), I want to get f(1,1). Kratos Desparta 2019-03-18T17:32:13Z [Package] Phylogenetics for Mathematica https://community.wolfram.com/groups/-/m/t/784207 [Dr. P. David Polly from Indiana University] published a [Phylogenetics package for Mathematica]. A detailed [User&#039;s Guide] is also available. Short discription is copied below. **Keywords**: Phylogenetics; Ancestral Node Reconstruction; Newick Trees **Abstract**: This add-in package for Mathematica performs basic phylogenetic functions, including reading and drawing Newick format trees, calculating phylogenetically independent contrasts, reconstructing ancestral values for continuous traits, performing random walks, and simulating continuous traits on phylogenetic trees. The file is a &#034;.m&#034; file, which can be imported into Mathematica 6.0 and later (functions do not work in earlier versions of Mathematica). Install using the &#034;Install&#034; item on the &#034;File&#034; menu. Once installed, you must load the package like any other with the line &lt;&lt;PollyPhylogenetics, using either this suggested name or another. : http://mypage.iu.edu/~pdpolly : https://scholarworks.iu.edu/dspace/handle/2022/14614 : http://mypage.iu.edu/~pdpolly/Software/Guide%20to%20PollyPhylogenetics%203.0.pdf Vitaliy Kaurov 2016-02-01T13:07:47Z [✓] Use Cases with RuleDelayed? https://community.wolfram.com/groups/-/m/t/1632770 Let us assume very simple and dumb example of pattern extracting from some data list by Cases[]: Cases[{{1}, {2}}, x_ -&gt; x[]] One can run it and get During evaluation of In:= Part::partd: Part specification x[] is longer than depth of object. Out= {1, 2} What a hell, why x is not an array? Or a little more complex example: In:= Cases[{&#034;2&#034;,&#034;1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1&#034;}, mList_String -&gt; StringExtract[mList, All], 1] During evaluation of In:= StringExtract::strse: String or list of strings expected at position 1 in StringExtract[mList,All]. Out= {{&#034;2&#034;},{&#034;1&#034;, &#034;0&#034;, &#034;0&#034;, &#034;0&#034;, &#034;0&#034;, &#034;1&#034;, &#034;0&#034;, &#034;0&#034;, &#034;0&#034;, &#034;0&#034;, &#034;1&#034;, &#034;0&#034;, &#034;0&#034;, &#034;0&#034;, &#034;0&#034;, &#034;1&#034;}} One can tell, that as we get after all an correct output there is no big problem in such warnings. But if we go a little deeper the real problem rises: In:= Cases[{&#034;2&#034;, &#034;1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1&#034;}, mList_String -&gt; ToExpression[StringExtract[mList, All]], 1] During evaluation of In:= StringExtract::strse: String or list of strings expected at position 1 in StringExtract[mList,All]. During evaluation of In:= ToExpression::notstrbox: StringExtract[mList,All] is not a string or a box. ToExpression can only interpret strings or boxes as Wolfram Language input. Out= {$Failed, \$Failed} Any correct result at all. So, what is exact problem with Cases[] and how to fix it correctly (i managed to make a simple and dirty fix, but do not like it)? Snegirev Maksym 2019-03-15T17:01:05Z Calculate delta coefficients? https://community.wolfram.com/groups/-/m/t/1635481 Hi, I want to calculate delta coefficients in Mathematica. However, I cannot find the optimal way to do it. The mathematical definition can be found there [here]. If t+n&gt;n then the last element is used. Similarly, for t-n, the first element is used. I tried to compute this by first padding n first elements at the beginning and n last elements at the end and then calculating the deltas from the definition. delta = Sum[(n-l)*(lst[[t+n]-lst[[t-n]]]),{n,l+1,2l}]; delta = delta/(2*Sum[n^2,{n,1,l}]); Where lst is the array, l is the length of the array (before padding) and t is the element for which we want to calculate delta. I think, that there should be a better way to do this, nevertheless I cannot find is. Therefore, my question is, how can I improve the computation? : http://practicalcryptography.com/miscellaneous/machine-learning/guide-mel-frequency-cepstral-coefficients-mfccs/ Jan Malinowski 2019-03-19T09:20:14Z Specify the size of points and square in RandomPoint? https://community.wolfram.com/groups/-/m/t/1635092 The following two lines generate almost exactly what I want: pts = RandomPoint[Rectangle[], 250] Graphics[{ImageSize-&gt;Small,PointSize[Tiny], Point[pts]}] However, I want to be able to specify specific sizes for the points (i.e. diameter of 1.5 microns on a square that is 1000 um x 1000 um). Is there a way to do set these parameters? If not, is there a good function in Python that would allow me to randomly plot circles of specific diameters on squares of specified size? Claire Ruddiman 2019-03-18T19:36:50Z Automate converting an imported excel spreadsheet to a dataset? https://community.wolfram.com/groups/-/m/t/1566323 I would like to import a large excel spreadsheet with many columns into Mathematica. The first row of the spreadsheet contains the column headings and the remaining rows contain the data. After importing I first separate the column headings and data into separate variables and would like to convert the data to a dataset. Here is an example of what I have tried. These steps simulate of importing the spreadsheet and separating into columns and data cols = {&#034;col1&#034;, &#034;col2&#034;, &#034;col3&#034;, &#034;col4&#034;, &#034;col5&#034;}; dat = RandomReal[{0, 1}, {10, 5}]; I now need to create an association to use to map the data to the columns but here is where I am having trouble. The best I am able to come up with is to generate assoc = Table[cols[[k]] -&gt; #[[k]], {k, 1, 5}] This results in some error messages, but produces {&#034;col1&#034; -&gt; 1, &#034;col2&#034; -&gt; #1[], &#034;col3&#034; -&gt; #1[], &#034;col4&#034; -&gt; #1[], &#034;col5&#034; -&gt; #1[]} which is nearly the result desired. I can then copy that result, paste it into a new cell, and edit that cell by hand, changing the first element of the list, applying an association function, and applying a function to get the desired function to apply to the data assoc1 = Association[{&#034;col1&#034; -&gt; #[], &#034;col2&#034; -&gt; #1[], &#034;col3&#034; -&gt; #1[], &#034;col4&#034; -&gt; #1[], &#034;col5&#034; -&gt; #1[]}] &amp; Map[assoc1,dat] With this association I can then generate the dataset. Is there any way of generating this function without the necessity of the hand editing step? Mike Luntz 2018-12-05T14:55:47Z NDSolve two coupled first order PDEs with specific boundary conditions? https://community.wolfram.com/groups/-/m/t/1635326 Hi :-) Reading and re-reading the NDSolve documentation, I don&#039;t understand the generic way to express boundary conditions. I want to solve the wave equation expressed as a system of two coupled first order equations on the voltage v(t,x) and current i(t,x). The initial v(0,x) has a bell shape and the initial i(0,x) is zero everywhere. eq1 = D[v[t, x], x] + D[i[t, x], t] == 0; eq2 = D[i[t, x], x] + D[v[t, x], t] == 0; shape = D[0.125 Erf[(x - 0.5)/0.125], x]; ics ={v[0, x] == shape, i[0, x]==0}; Now the problem is to be numerically integrated with NDSolve over x in [0,1] and t in [0,2]. I want to specify either open ends v[t, 0] =v[t, 1]=0 or non reflective boundary conditions. In the first case I can do it: region = Line[{{0}, {1}}]; bcs = {v[t, 0] == 0, v[t, 1] == 0}; sol = NDSolve[{eq1,eq2, ics, bcs}//Flatten, {v, i}, {t,0,2}, {x} \[Element] region] How to do the same in the non-reflective (or impedence matched) case? All my attemps fail: calling sol2 = NDSolve[{eq1,eq2, ics}//Flatten, {v, i}, {t,0,2}, {x} [Element] region] without bcs renders a solution that does not correspond to the targeted case (by the way, which default bcs are assumed in this case?). Using v= Z i with Z=1 the wave and load impedence, i.e. bcs2b = {v[t, 0] == i[t, 0] , v[t, 1] == i[t, 1]}; sol2b = NDSolve[{eq1,eq2, ics, bcs2b}//Flatten, {v, i}, {t,0,2}, {x} \[Element] region] returns an error about &#034;Cross-coupling of dependent variables in DirichletCondition&#034;. bcs3c = { Derivative[0,1][v][t, 0] ==-Derivative[1,0][i][t, 0] , Derivative[0,1][v][t, 1] ==-Derivative[1,0][i][t, 1] }; sol3c = NDSolve[{eq1,eq2, ics, bcs3c}//Flatten, {v, i}, {t,0,2}, {x} \[Element] region] returns an error about too high order derivatives in boundary conditions. How to proceed with this system of coupled first order PDEs? (note that I know how to do with a second order wave equation and Neumann values, but that&#039;s not my question). I want to express the conditions on v and i. Thank you for your help. Denis Vion 2019-03-18T19:56:07Z Avoid error with the following recursive code? https://community.wolfram.com/groups/-/m/t/1634599 Thanks for any help! I must be doing something wrong in the following recursive code: ClearAll[lim, hlim, count, e] lim = 25; hlim = lim/5; count[heading_, v_] := count[heading, v] = Block[{nv = v}, If[Total[nv] == lim, If[heading == 0, 1, 0], If[nv[[heading]] == hlim, 0, nv[[heading]] = nv[[heading]] + 1; count[If[heading == 4, 0, heading + 1], nv] + count[If[heading == 0, 4, heading - 1], nv]]]] e[] := Module[{}, 2*count[1, {1, 0, 0, 0, 0}]] e[] // Timing I expect a number, but I get: {0.007164, 870 If[List == 5, 0, nv[] = nv[] + 1; count[If[0 == 4, 0, 0 + 1], nv] + count[If[0 == 0, 4, 0 - 1], nv]]} Joe Gilray 2019-03-18T07:03:07Z Avoid .NET/Link error in Visual Studio 2015? https://community.wolfram.com/groups/-/m/t/1634807 Hi All, Hope you are all fine. I am trying to maintain and extend the functionality of a very old C++ program (initially coded in 2009). It was using .NET/Link feature of Wolfram. However it does not have many documentation neither comments for the code. I&#039;ve encountered a problem of compiling and running it with the error said: Exception thrown: &#039;System.TypeLoadException&#039; in mscorlib.dll Exception thrown: &#039;System.DllNotFoundException&#039; in Wolfram.NETLink.dll Exception thrown: &#039;System.TypeInitializationException&#039; in Wolfram.NETLink.dll Exception thrown: &#039;System.TypeInitializationException&#039; in [My Project].exe I should mention that this happens in the very first beginning of the code: kernel = nullptr; kernel = MathLinkFactory::CreateKernelLink(); And the similar problem happens to me when I was trying to run the sample code from Wolfram official platform, it is a C# program though: Exception thrown: &#039;System.TypeLoadException&#039; in mscorlib.dll Exception thrown: &#039;System.DllNotFoundException&#039; in Wolfram.NETLink.dll Exception thrown: &#039;System.TypeInitializationException&#039; in Wolfram.NETLink.dll &#039;MathKernelApp.vshost.exe&#039; (CLR v2.0.50727: MathKernelApp.vshost.exe) I am not sure if this is a problem of environment setup or it is because of the incompatibility between Wolfram and Windows 10. Operating System: Windows 10 IDE: Visual Studio 2015 Target Platform Version: 10.0.16299.0 Platfomr Toolset: Visual Studio 2015 (v140) **A quick update:** I have resolved problem in MathKernelApp provided by Wolfram by copying and pasting the ml64i4.dll into the Release folders. I thought it may help to my original problem but not. It is a separate problem and I still have no idea of how to fix the first one. Haifeng Zhao 2019-03-18T00:41:44Z Import .dae 3D format files without ignoring nodes? https://community.wolfram.com/groups/-/m/t/1633798 Collada .dae 3D format is in fact xml document which contains &lt;library_geometries&gt; section with some &#034;meshes&#034;, where the coordinates and normals of surface meshes points are provided. But that coordinates are not refereed to basic coordinate system. DAE file contains an other, &lt;library_visual_scenes&gt; section, which holds a tree of nested lists of &#034;nodes&#034; - transformation matrices describing coordinate transformation of the nested node from the parent one. And only the last, leaf node contains reference to some mesh name, so the mesh coordinate system is given by set of coordinate transformation. A lot of 3D modelling soft exports a set of model &#034;parts&#034; in very such way. Looks like Mathematica Import[] function do not take into account nodes section, so imported complex models have details teared apart and grouped near the center of coordinates. Import[SomeModel, &#034;CoordinateTransform&#034;] provides a single and unit transformation matrix not changes at all on change of &#034;nodes&#034; matrices 1. Have tried to import some .dae models. Import[SomeModel, &#034;MeshRegion&#034;] and Import[SomeModel, &#034;GraphicsComplex&#034;] both give the same teared apart result. 2. Coded some handmade parser, which extracts meshes from &lt;library_geometries&gt; and provides the resulting set of 3D surfaces without additional transformations - completely the same &#034;teared&#034; result as in stage 1. 3. Coded additional parser, which extracts a set of transformation matrices for every mesh, and applied a result to it - valid 3D model with the parts on proper places. ps: it would be very convenient if Import[] did not &#034;melts&#034; all meshes in a single one, but provides them as a set of objects together with their transformation martices, or have a option for this. Snegirev Maksym 2019-03-16T09:40:04Z Generate Newton-Girald formula? https://community.wolfram.com/groups/-/m/t/1634323 n = 2 I am not getting the determinant of the NW. Can somebody suggest what is wrong? S = Table[i*e[i], {i, 1, n}] S = {1, Table[e[i], {i, 1, n - 1}]} S = {0, 1, Table[e[i], {i, 1, n - 2}]} For[i = 4; t = x, i &lt; n + 1, i++, S[i] = {ConstantArray[0, i - 2], ConstantArray[1, 1], Table[e[j], {j, 1, n - i + 1}]}; Print[S[i]]] EQ1 = Table[S[j], {j, 1, n}] NW = MatrixForm[EQ1] NW1 = Det[Transpose[NW]] Rajan Prasad 2019-03-17T03:30:03Z Increase mathematica's menu font size? https://community.wolfram.com/groups/-/m/t/1634439 Hello, I have vision issues &amp; need to increase the size of the font in my menu. Can someone tell me how to do this? Thanks, Jeffrey Jeffrey Denison 2019-03-16T19:30:11Z Avoid issue in DateString? https://community.wolfram.com/groups/-/m/t/1633972 Consider the following code: DateString[{2000, 1, 1, 0, 0, 0}, {&#034;Year&#034;, &#034; &#034;, &#034;Month&#034;, &#034; &#034;, &#034;Day&#034;, &#034; &#034;, &#034;SecondExact&#034;, &#034; &#034;}] yields 2000 01 01 00.000 but DateString[{2000,1,1,0,0,0},{&#034;Year&#034;,&#034; &#034;,&#034;Month&#034;,&#034; &#034;,&#034;Day&#034;,&#034; &#034;,&#034;MinuteExact&#034;,&#034; &#034;}] and DateString[{2000,1,1,0,0,0},{&#034;Year&#034;,&#034; &#034;,&#034;Month&#034;,&#034; &#034;,&#034;Day&#034;,&#034; &#034;,&#034;HourExact&#034;,&#034; &#034;}] yield 2000 01 01 {0., QuantityMagnitude[Minute]} and 2000 01 01 {0., QuantityMagnitude[Hour]} respectively. It does not seem like the units should be present in the last two cases for Minute and Hour. Vincent Virgilio 2019-03-15T23:42:20Z