Community RSS Feed
https://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions from all groups sorted by activeIs there a cheap subscription for Instant APIs?
https://community.wolfram.com/groups/-/m/t/2169635
I needed a solver as part of an application and prototyped a simple function using Wolfram Cloud trial. I am interested in calling this function in the web using CloudDeploy/APIFunction.
I'd like to use this function as part of a small-scale professional project. As I understand it, I have to buy a Wolfram|One Professional licence in order to use Instant APIs in commercial applications. However, the licence is too expensive for this simple one-off project.
Are there cheaper options to deploy Instant APIs?Arnaud Durand2021-01-21T17:40:16ZVARIANCE and PDF
https://community.wolfram.com/groups/-/m/t/2169540
Hello all,
I am struggling to find the correct function for Variance. It does exist, but it is the SAMPLE variance, i.e. the (n-1) denominator.
I need to find (if it does exist) the SIGMA variance, i.e. the one with just N at the denominator.
Anyone knows ?
Plus, suppose I wanted to plot the pdf f(x) =ce^-x (0<x<1) and find the CDF and its expected value. How would I proceed?
Thank you all.Mauro Benjamin Mistretta2021-01-21T19:50:36Z3D Helmholtz resonance in the violin body with f-holes
https://community.wolfram.com/groups/-/m/t/2153362
*Wolfram notebook is attached at the end of the post.*
----------
![enter image description here][1]
This post is about FEM simulation of violin vibration modes in 3D. As well known there are Helmholtz resonances of air inside the violin body with frequencies dependent on geometry of f-holes. This is the main reason why violin has so pronounced sound. To simulate these modes with Mathematica FEM we first define the body geometry (this is my design with given volume and area of f-holes, but it taken from the real violin):
xy = {{3.805405405405406`,3.34954954954955`},{3.8252252252252257`,6.6990990990991`},{3.9441441441441443`,7.9081081081081095`},
{4.47927927927928`,8.601801801801802`},{5.014414414414414`,8.264864864864865`},{4.816216216216216`,7.8882882882882885`},
{4.895495495495496`,7.630630630630631`},{5.232432432432433`,7.432432432432433`},{5.47027027027027`,7.491891891891892`},
{5.648648648648649`,7.8882882882882885`},{5.668468468468468`,8.046846846846847`},{5.56936936936937`,8.403603603603605`},
{5.252252252252252`,8.681081081081082`},{4.855855855855856`,8.780180180180182`},{4.518918918918919`,8.8`},
{3.9639639639639643`,8.522522522522523`},{3.567567567567568`,7.967567567567568`},{3.3693693693693696`,7.372972972972973`},
{3.2306306306306305`,6.67927927927928`},{3.1513513513513516`,3.3693693693693696`},{3.1513513513513516`,2.655855855855856`},
{2.9729729729729732`,1.783783783783784`},{2.8738738738738743`,1.4666666666666668`},{2.100900900900901`,0.7927927927927928`},
{1.7243243243243245`,1.3081081081081083`},{2.021621621621622`,1.7639639639639642`},{2.0414414414414415`,2.0414414414414415`},
{1.9621621621621623`,2.23963963963964`},{1.6648648648648652`,2.4378378378378383`},{1.4666666666666668`,2.5171171171171176`},
{1.10990990990991`,2.338738738738739`},{0.891891891891892`,1.9423423423423425`},{0.9315315315315316`,1.4072072072072073`},
{1.5657657657657658`,0.7927927927927928`},{2.081081081081081`,0.6342342342342343`},{2.5963963963963965`,0.7927927927927928`},
{3.0918918918918923`,1.2090090090090093`},{3.5081081081081082`,1.902702702702703`},{3.706306306306306`,2.6954954954954955`}};
reg1 = RegionUnion[Disk[{0, 19.5/2}, 19.5/2],
Disk[{0, 36 - 15.5/2}, 15.5/2],
Rectangle[{-10, 15}, {10, 25}]]; reg2 =
RegionDifference[reg1,
RegionUnion[Disk[{-10, 20}, 9.5/2], Disk[{10, 20}, 9.5/2]]];
c0 = {0, 36 - 15.5/2}; c1 = {7.03562, 25};
f[x_] := c0[[2]] + x (c1[[2]] - c0[[2]])/(c1[[1]] - c0[[1]]); r1 =
Norm[c1 - {10, f[10]}];
reg3 = RegionDifference[reg2, Disk[{10, f[10]}, r1]];
f1[x_] := c0[[2]] - x (c1[[2]] - c0[[2]])/(c1[[1]] - c0[[1]]);
reg4 = RegionDifference[reg3, Disk[{-10, f1[-10]}, r1]]; c10 = {0,
19.5/2}; c11 = {8.215838362577491`, 15};
f11[x_] := c10[[2]] + x (c11[[2]] - c10[[2]])/(c11[[1]] - c10[[1]]);
r2 = Norm[c11 - {10, f11[10]}];
reg5 = RegionDifference[reg4, Disk[{10, f11[10]}, r2]];
f12[x_] := c10[[2]] - x (c11[[2]] - c10[[2]])/(c11[[1]] - c10[[1]]);
reg6 = RegionDifference[reg5, Disk[{-10, f12[-10]}, r2]]; p6 =
RegionPlot[reg6, AspectRatio -> Automatic];
fh[xf_, yf_] :=
RegionUnion[
Polygon[Table[{xy[[i, 1]] - xf, xy[[i, 2]] + yf}, {i,
Length[xy]}]],
Polygon[Table[{-xy[[i, 1]] + xf, xy[[i, 2]] + yf}, {i,
Length[xy]}]]];
General view of the violin body from the front and back side
Show[p6, Graphics[fh[7, 12], AspectRatio -> Automatic]]
dz = 3.79; reg8 =
ImplicitRegion[Element[{x, y}, reg6] && 0 <= z <= dz, {x, y, z}];
mesh3d1 = DiscretizeRegion[reg8, {{-10, 10}, {0, 36}, {0, dz}}]
![Figure 1][2]
Next step is the computation of air modes in the violin body with using ` NDEigensystem[]` as follows
ca = 34321(*T=20C*); L = -Laplacian[u[x, y, z], {x, y, z}]; {vals, funs} =
NDEigensystem[{L,
DirichletCondition[u[x, y, z] == 0,
Element[{x, y}, fh[7, 11.49]] && z == dz]}, u,
Element[{x, y, z}, mesh3d1], 15];
Finally we visualize first 5 modes and the main mode in 3D
{Table[DensityPlot[funs[[i]][x, y, dz/2], {x, -10, 10}, {y, 0, 36},
PlotRange -> All, PlotLabel -> ca Sqrt[vals[[i]]]/(2 Pi),
ColorFunction -> "Rainbow", AspectRatio -> Automatic], {i, 1,
5}],
DensityPlot3D[
funs[[1]][x, y, z], {x, -10, 10}, {y, 0, 36}, {z, 0, dz},
PlotRange -> All, PlotLabel -> ca Sqrt[vals[[1]]]/(2 Pi),
ColorFunction -> "Rainbow", AspectRatio -> Automatic,
PlotLegends -> Automatic, PlotPoints -> 100, BoxRatios -> Automatic,
OpacityFunction -> None, Boxed -> False]}
![Figure 2][3]
Therefore the first mode of 440.033 Hz is close to "A4" (440 Hz) tone. But we expecting "C4" (261.626 Hz), or "C#4" (277.183 Hz). The main reason of this discrepancies could be the wood plate vibration from the back side. Thus we define mesh, parameters of the wood plate and modes as follows
dreg = DiscretizeRegion[reg6, {{-10, 10}, {0, 36}},
MaxCellMeasure -> .05]
Y = 10.8*10^9; nu = 31/100; rho = 500; h = .003; d =
10^4 Sqrt[Y h^2/(12 rho (1 - nu^2))];Ld2 = {Laplacian[-d u[x, y], {x, y}] +
v[x, y], -d Laplacian[v[x, y], {x, y}]};
{vals, funs} =
NDEigensystem[{Ld2, DirichletCondition[u[x, y] == 0, True]}, {u, v},
Element[{x, y}, dreg], 5];
Table[DensityPlot[Re[funs[[i, 1]][x, y]], {x, y} \[Element] dreg,
PlotRange -> All, PlotLabel -> vals[[i]]/(2 Pi),
ColorFunction -> "Rainbow", AspectRatio -> Automatic], {i, 2,
Length[vals]}]
![Figure 3][4]
Hence for wood plate we have mode of 259.394 Hz and it is close to C4 tone.
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2021-01-04at1.47.31PM.jpg&userId=20103
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=bd9Wx.png&userId=1218692
[3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=w7dPm.png&userId=1218692
[4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=qb3HU.png&userId=1218692Alexander Trounev2021-01-03T23:13:58ZTilings and constraint programming
https://community.wolfram.com/groups/-/m/t/2135869
Introduction
------------
The goal of this post is to start from images like this example one :
![Girl3][1]
and generate pictures like:
![Girl3Gray][2]
or
![Girl3Color][3]
Mathematica at least 12.1 will be required since Mixed Integer programming is used.
Explanation
-----------
Let's take the first image (black and white) as an example.
Let's assume we have a collection of 16 tiles:
![GrayTiles][4]
The problem to solve is how to place the tiles on the picture so that the gray content of a tile is close to the gray content of the picture below it and at the same time the topological constraints are satisfied.
By topological constraints, I mean that the tiles must be compatible.
This is allowed:
![Allowed][5]
This is forbidden because the dark horizontal band is continuing as a white horizontal band.
![Forbidden][6]
We are going to translate this problem into a set of equations on integer variables and with a linear cost function to optimize. The final problem will be solved with the LinearOptimization function from Mathematica 12.1.
Each pixel of the image is encoded by a vector ![eq1][7] because there are 16 different tiles in this example. The components of the vector can be either 0 or 1.
This is expressed as:
VectorLessEqual[{0, v}], VectorLessEqual[{v, 1}], v \[Element] Vectors[nbTiles, Integers]
For each pixel, only one tile can be used. We cannot put several tiles on a pixel but only choose one and only one.
If we use the constraint:
![eq2][8]
then we express that only one tile can be used. Indeed, since the component are integers and equal to 0 or 1, then the only way to satisfy this equation is that one of the components, and only one, is equal to one.
Expressing the topological constraints is similar.
We have equations like:
![eq3][9]
This equation is describing a relationship between pixel (x,y) and pixel (x+1,y).
The values on left and right side can either be 0 or 1 (at same time). When zero it means : none of the tiles is used. When one, it means one of the tile is used. So, the translation of the equation is:
If the tile 0,3 or 5 are used at pixel (x,y) then the tiles 3,6,9 or 11 must be used at pixel (x+1,y).
(I have not checked if it makes sense with the set of tiles I am using as example. The constraints for those tiles are probably different.).
To describe the topological constraint of the tiles, we have functions like:
rightSide[tileA[{a_,b_,c_}]] :={b,c};
This is giving a key describing the right side of the tile. Those keys are then used in associations to build the topological constraints. The key can be anything so if you want to add new tiles, you can just use the key you want to describe the sides of your tiles.
The generic function rightSide must be extended with new cases when new tiles are added.
Then, we need to express how good the tiles are approximating the original picture.
For this, an error function is created. It is a sum of terms:
![eq4][10]
It means that if the tile i is selected for pixel (x,y) then the approximation error is `Subscript[f, k]`
The function averageColor must be extended with new tiles. It returns the color content of a tile : a RGBColor. The code is using a color distance to compute the errors.
That's why the input picture is always converted to RGB and the alpha channel removed.
So, finally we have translated our problem into a set of integer constraints and with a linear cost function to optimize. It is a mixed integer programming problem which can be solved with LinearOptimization.
The tiles must be displayed. It is done by the function tileDraw and the tile is drawn in a square from (0,0) to (1,1) corners.
The code is rasterizing those graphics into 50x50 pixel images.
I have had lots of problems with those pictures due to rounding errors ... probably due to the very old GPU on my very old computer.
So I tuned the vector code assuming the final tile image is 50x50 pixels. Now the pictures are well aligned, there is no more one row or one column of wrong pixels on the boundary of the tiles.
But this may cause a problem on your configuration. So, if the tile pictures are not rendering correctly on your side, you'll need to tune my vector graphic code again.
If the picture is too big, solving the full mixed integer programming problem may take too long. But we can solve a sub-optimal problem. We divide the picture into sub-pictures and solve the problem on each sub-picture then we recombine the solutions. For it to work : we must add new constraints to express compatibility between the pictures.
For instance, the left side of a picture at (row,col) must be compatible with the right side of the picture at (row,col-1). So, the problem must be solved in a given order so that the constraints can be propagated from one sub-picture to the other.
For some tiles, the sub-optimal solution can be very good from an artistic point of view (the dark tiles below are working well). For other tiles (the smith tiles in the notebook) either the sub-optimal problem cannot always be solved (because the constraints coming from the previous pictures can't be satisfied) or the sub-optimal problem will look bad from time to time.
So this idea of using sub-picture is really dependent on the kind of tiles used. You need to experiment. But it is art after all.
Example of use
--------------
First, we get an example picture:
srcImage = ImageCrop[ExampleData[{"TestImage", "Girl3"}], {190, 270}]
The picture is resized, converted to RGB and any alpha channel removed.
imgToAnalyze =
ImageResize[
ImageAdjust[
RemoveAlphaChannel[ColorConvert[srcImage, "RGB"], Black]], {50,
Automatic}]
For the dark tiles (knots), we decide to only use gray levels. First color is the background of the tiles. Other colors are for the circles and vertical and horizontal bands.
tileData =
mkDarkTiles[RGBColor[
0.5, 0.5, 0.5], {RGBColor[0., 0., 0.], RGBColor[1., 1., 1.]}];
It gives a total of 16 tiles. The more tiles, the more difficult it is to solve the problem. 16 is ok on my old computer.
tileData["allTilesImg"] // Length
The problem is solved on 15x15 sub pictures.
solution = partitionSolve[tileData, imgToAnalyze, 15];
The final picture is generated from the tiles and the solution.
img = createPict[tileData, solution];
And you'll get:
![Girl3Gray][2]
Have fun ! I hope the vectorial code will not have to be tuned to generate the tile pictures (rounding errors).
The notebook is attached to the post.
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Girl3.png&userId=89693
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Girl3Gray.png&userId=89693
[3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Girl3Color.png&userId=89693
[4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Tiles.png&userId=89693
[5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Allowed.png&userId=89693
[6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Forbidden.png&userId=89693
[7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=eq1.png&userId=89693
[8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=eq2.png&userId=89693
[9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=eq3.png&userId=89693
[10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=eq4.png&userId=89693
[11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=LenaGray.png&userId=89693Christophe Favergeon2020-12-11T16:08:18ZDetermine inverse Laplace transforms of these expressions?
https://community.wolfram.com/groups/-/m/t/2163007
Hi, I have a new problem with determining inverse Laplace transforms. The following code generates a series expansion of a certain expression, and then attempts to calculate inverse Laplace transforms of the successive series coeffcients. The coefficients are functions of the Laplace variable s that appear rather hard (for me) to be expressed by any recursive formula, so that I do not see a way to represent them in an alternative way. The problem is that the InverseLaplaceTransform[] command manages to invert only the first three coefficients, and I need at least 40. I believe all these inverses should contain the DawsonF[] function. Application of Apart[] makes things even worse, and diminishes the number of inverted coefficients. Is there any other method that could be applied to rearrange the expressions in some systematic way so that the inverses can be obtained?
Leslaw.
The code:
nmax=5;
F[s_]:=(((1+s)^2+3*s^(3/2)*(1+s)^(1/2)*th-4*s*(1+s)*th+3*s^(1/2)*(1+s)^(3/2)*th+s^2*th^2))/
(8 (s^(3/2)*(1+s)^(1/2)*((1+s)^(1/2)+s^(1/2)*th)^3));
ser0=Simplify[Series[F[s],{th,0,nmax}]];
coeffs0=Table[SeriesCoefficient[ser0,n],{n,0,nmax}];
coeffs1=InverseLaplaceTransform[coeffs0,s,t]Leslaw Bieniasz2021-01-14T19:51:12ZHow can I graph the area.
https://community.wolfram.com/groups/-/m/t/2170003
How can I graph the area described by the expression
Im[R Cos[x/2]^2] + Re[R Sin[x]] != Im[R Sin[x/2]^2] ||
Re[R Cos[x/2]^2] < Im[R Sin[x]] + Re[R Sin[x/2]^2] ||
1 + Im[R Sin[x]] + Re[R Sin[x/2]^2] < Re[R Cos[x/2]^2]
?
x is polar angle and R is the radius in polar coordinates.h r2021-01-22T00:11:17ZSolving a system of nonlinear equations with inequality constraints
https://community.wolfram.com/groups/-/m/t/2165987
Hi! I'm pretty new to Mathematica, am I am having trouble trying to solve a system of nonlinear equations. In this example I have 5 equations, with 4 inequality constraints. I've looked through the forums, and found an example (seen as the second example) using FindInstance, so I tried to use it for my problem, but unlike the one I found on the forum, when I try to execute my command (the top one), I don't get an output. I know this series of nonlinear equations should have valid solutions because I found some solutions on MATLAB, but I'm trying to double check my answers.
Also, if FindInstance isn't the right command for this, please let me know. I know about Solve and Reduce, but I don't know how to incorporate inequality constraints with those commands. Thanks in advance!
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/38908c44-39f4-4898-b6c5-fdf2b6437694Sabrina Chui2021-01-18T04:50:10Z[WWS21] Defect movement in lattice rewriting systems
https://community.wolfram.com/groups/-/m/t/2164049
![enter image description here][1]
&[Wolfram Notebook][2]
Code: https://github.com/taliesinb/LatticeRewriting
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=image%287%29.png&userId=2161364
[2]: https://www.wolframcloud.com/obj/65c63b92-6ee9-44fc-b0b6-08a8524da33c
[Original]: https://www.wolframcloud.com/obj/da875739-a182-4834-aaf4-3928a539f7c4Keith Patarroyo2021-01-15T18:52:23ZThe nearest weather stations to the Equator?
https://community.wolfram.com/groups/-/m/t/2169182
Hi,
I tried to find the two nearest weather stations to the NorthPole, Antarctica, and also the Equator.
I used the below command. How can I fix this problem?
Thank you for your help
In[20]:= WeatherData[{"Equator", 2}]
During evaluation of In[20]:= WeatherData::notent: {"Equator", 2} is not a known entity, class, or tag for WeatherData. Use WeatherData[] for a list of entities.
Out[20]= WeatherData[{"Equator", 2}]
In[21]:= WeatherData[{"Arctic", 2}]
During evaluation of In[21]:= WeatherData::notent: {"Arctic", 2} is not a known entity, class, or tag for WeatherData. Use WeatherData[] for a list of entities.
Out[21]= WeatherData[{"Arctic", 2}]Alex Teymouri2021-01-21T08:27:47ZPredicting COVID-19 using cough sounds classification
https://community.wolfram.com/groups/-/m/t/2166833
&[Wolfram Notebook][1]
[Original]: https://www.wolframcloud.com/obj/dfed8d32-9a69-4246-89ed-2a471c343a30
[1]: https://www.wolframcloud.com/obj/569968ad-436d-4694-adf1-e4b03148e3a2Siria Sadeddin2021-01-18T22:46:11ZMathematica on the iPad
https://community.wolfram.com/groups/-/m/t/1951871
The iPad Pro is already way more powerful than a lot of notebooks so it makes a lot of sense now to have a full version of Mathematica running locally instead of just the Wolfram Cloud app.
This would also be a good excuse to provide full Metal support so GPUs in the Apple ecosystem would be supported for computation as well and not just graphics.maxscience n2020-04-23T12:31:14ZRational tetrahedra: edge lengths from given angles
https://community.wolfram.com/groups/-/m/t/2169279
At stackexchange I [posted a question][1]:
> In the paper [Space Vectors Forming Rational Angles][2] a special set
> of tetrahedra is mentioned.
>
> "The remaining three are in the R-orbit of the tetrahedron with
> dihedral angles (π/7, 3π/7, π/3, π/3, 4π/7, 4π/7)."
>
> What is a set of edge lengths or vertices for this tetrahedron? I've
> written a function that converts [edges to angles][3], but I need the
> reverse.
I found the tetrahedron. First, the angles need to be arranged so that a particular determinant is zero. Here's one arrangement that works.
{a, b, c, d, e, f} = {\[Pi]/7, \[Pi]/3, (4 \[Pi])/7, (4 \[Pi])/7, \[Pi]/3, (3 \[Pi])/7};
RootReduce[Det[{{-1, Cos[a], Cos[b], Cos[c]},
{Cos[a], -1, Cos[d], Cos[e]},
{Cos[b], Cos[d], -1, Cos[f]},
{Cos[c], Cos[e], Cos[f], -1}}]]
Then I used [TetrahedronEdgeAngles][4] on two set points and two random points, their distances, millions of random points, and annealing to boil things down to exact values.
vert={{-(1/2),0,0},{1/2,0,0},{-0.0678\[Ellipsis],0.552\[Ellipsis],-0.126\[Ellipsis]},{0.0678\[Ellipsis],0.552\[Ellipsis],0.126\[Ellipsis]}};
Graphics3D[Tube/@Subsets[vert,{2}]]
![seventh tetrahedron][5]
I'm not sure how to do the R-orbit, but that's the first one. I'd like to get all of the rational tetrahedra and put them into something like [Solid and Dihedral Angles of a Tetrahedron][6].
A notebook with this tetrahedron is below
&[Wolfram Notebook][7]
[1]: https://math.stackexchange.com/questions/3993429/given-dihedral-angles-find-a-set-of-edges
[2]: http://www-math.mit.edu/~poonen/papers/space_vectors.pdf
[3]: https://resources.wolframcloud.com/FunctionRepository/resources/TetrahedronEdgeAngles/
[4]: https://resources.wolframcloud.com/FunctionRepository/resources/TetrahedronEdgeAngles/
[5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=seventh.png&userId=21530
[6]: https://demonstrations.wolfram.com/SolidAndDihedralAnglesOfATetrahedron/
[7]: https://www.wolframcloud.com/obj/87b6062b-40b3-45af-a67f-267aae7bb7a9Ed Pegg2021-01-21T16:00:11ZGet a condition on parameters to compare 2 thresholds
https://community.wolfram.com/groups/-/m/t/2168187
Hi,
I'm trying to compare two thresholds in my model but I'm not sure if I type correctly the command. My code does not stop running making me believe that I'm missing something. What I want is to take into account the different condition I defined as a hypothesis to find the condition on parameters of my model under which condition I have one threshold being greater than the other (this might be always true whatever the value of parameters without being an issue by the way). I wonder if I should put not only theta B but also theta C or/and Fb and Fc? Any tip will be useful!
Thank you allXavier Koch2021-01-20T13:46:35ZComplexPlot non analytic function
https://community.wolfram.com/groups/-/m/t/2168399
ComplexPlot introduced in 12.0 can be used to create nice distorted checkerboards:
ComplexPlot[z (3 + Exp[Im[z]]), {z, 3}, Mesh -> 20,
MeshFunctions -> {Re[#2] &, Im[#2] &},
MeshShading -> {{None, Black}, {Black, None}}, Frame -> False]
![enter image description here][1]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=checkerboard.png&userId=1094216Oliver Seipel2021-01-20T14:38:01ZHow to start Mathematica on RPi using VNC?
https://community.wolfram.com/groups/-/m/t/183436
I found and followed
[url=http://whatapalaver.co.uk/2013/12/controlling-raspberry-pi-from-ipad]http://whatapalaver.co.uk/2013/12/controlling-raspberry-pi-from-ipad[/url]
to control my Raspberry Pi from my iPad.
Using my iPad, I installed and started tightvncserver using SSH. Then I connected with VNC Viewer. I started Mathematica. All was well. I was running Mathematica from my iPad and I was happily turning LEDs on and off from my iPad.
Then I "did" something and now I can't start Mathematica with VNC any more.
What I "did" was follow instructions found above for running tightvncserver at startup, and run VNC viewer on my Mac.
I created the file ~/.config/autostart/tightvnc.desktop containing[code][Desktop Entry]
Type=Application
Name=TightVNC
Exec=vncserver: 1
StartupNotify=False[/code]
This has been edited so a space is between the : and 1. VNC then starts on the Pi at boot up.
This post was made because VNC didn't start. I had misprint in tightvnc.desktop.
VNC Viewer on both iPad and Mac connect to Pi.
In my case, the IP address is 192.168.0.16. Port 1 works but I am using 5901.
A password is needed for tightvnc.
Sorry for confusion.
Roger Kirchner2014-01-10T03:02:16ZJudge the sign of a multi parameter equality Using 'Simplify'
https://community.wolfram.com/groups/-/m/t/2169058
I'm not sure this method is available for judging the sign of a multi parameter equality using the function "Simplify" in Mathematica.
But in the official document, the "Simplify" could "use assumptions to prove inequalities".
So I tried this method to judge my complex equation (it's other formula's first derivative and I need to judge it positive or negative)
And I posted my code here, please help me why it can not obtain the outcome of "True of False".
Simplify[1 + (
b^m E^((qL \[Rho])/\[Lambda]) m p^(-1 + m)
RqL (E^(b/\[Lambda]) +
E^((qL \[Rho])/\[Lambda]) (-1 + \[Alpha]) -
E^((b^m qH)/((b^m + p^m) \[Lambda])) \[Alpha]))/((b^m + p^
m)^2 (-E^(((2 b)/\[Lambda])) + E^((
b + (b^m qH)/(b^m + p^m))/\[Lambda]) +
E^((b^m (qH + qL))/((b^m + p^m) \[Lambda])) (-1 + \[Alpha]) -
E^((2 qL \[Rho])/\[Lambda]) (-1 + \[Alpha]))) + (b^(2 m) E^((
qL \[Rho])/\[Lambda]) m p^(-1 + m)
RqL (E^((
b^m (qH + 2 qL))/((b^m + p^m) \[Lambda])) (qH -
qL) (-1 + \[Alpha]) +
E^(b/\[Lambda]) (-E^(((2 b)/\[Lambda])) qL -
2 E^((b^
m (qH + qL))/((b^m + p^m) \[Lambda])) (qH -
qL) (-1 + \[Alpha]) -
2 E^((b + (b^m qL)/(b^m + p^m))/\[Lambda])
qL (-1 + \[Alpha]) +
E^((2 qL \[Rho])/\[Lambda]) qL (-1 + \[Alpha]) -
E^((2 b^m qH)/((b^m + p^m) \[Lambda])) qL \[Alpha] +
E^((b + (b^m qH)/(
b^m + p^m))/\[Lambda]) (-qH +
qL + (qH + qL) \[Alpha]))))/((b^m + p^m)^3 (E^((
2 b)/\[Lambda]) - E^((b + (b^m qH)/(b^m + p^m))/\[Lambda]) -
E^((b^m (qH + qL))/((b^m + p^m) \[Lambda])) (-1 + \[Alpha]) +
E^((2 qL \[Rho])/\[Lambda]) (-1 + \[Alpha]))^2 \[Lambda]) <
0, 100 > qH > qL > b > p > 0 && 0 < \[Rho] < 1 &&
2 > \[Lambda] > 0 && 0 < \[Alpha] < 1 && 2 > m > 1]Li Siqi2021-01-21T06:51:26ZSpeed of Jobs on AWS with RemoteBatchSubmit
https://community.wolfram.com/groups/-/m/t/2169240
Hello,
I have been playing with the new remote batch computation capabilities in Mathematica and have come across speed issues that I do not understand. My calculation involves thousands of Fourier transforms on complex lists with tens of thousands of elements per "step".
It runs reasonably fast on my local computer with a seven year old mobile i7 (4 cores, 8 threads) but much slower on AWS. Also the speed on AWS seems to be affected by parameters that (in my understanding) should not affect it. To rule out that the jobs run on slower hardware, I created a stack with only "c5a" as allowed instance type.
All tests are performed with one master kernel and zero subkernels. On my local machine CPU load is 50 %, so the calculation uses all cores. First I tested the performance of sequential single jobs with RemoteBatchSubmit:
![single job speed][1]
The achieved speeds are not great, but still something I could work with. When working with array batch jobs it gets more confusing and slower though.
When running an array job (RemoteBatchMapSubmit, 16 evaluations, 16 jobs, 1 vCPU each) every child job sees just one CPU, but 64 GB memory, the speed started at 0.8 steps/s when only one child was running but dropped to 0.05 steps/s when multiple ones were - should different child jobs influence each other like this?
To test this I started a single job with "VCPUCount" -> 2. This job reported 128 GB of $SystemMemory and ran with 0.9 steps/s. I started an additional and identical single job and the speed of both running jobs dropped to 0.6 steps/s. After starting a third identical job the speed of all three single jobs dropped to 0.3 steps/s.
Has anyone else experienced these issues or has a better understanding to explain what is happening? I would love to use this feature, but as of now there is no benefit, it runs much faster locally.
Thank you!
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2021-01-21-121904_export.png&userId=1915196Stefan Popien2021-01-21T11:34:28ZThe Math(s) Fix Conference Registration is Now Open!
https://community.wolfram.com/groups/-/m/t/2144156
[![enter image description here][1]](https://www.computerbasedmath.org/events/maths-fix-conference-2021)
Next month on 28 January, we'll be bringing together thought leaders, practitioners, employers and policymakers to map out a path to achieving widespread Computational Literacy and advanced Computational Thinking across the world. Join the change for a fundamentally renewed maths education to power our societies for the AI age and help us achieve this.
Check The Math(s) Fix Conference here:
https://www.computerbasedmath.org/events/maths-fix-conference-2021
Feel free to contact us if you have any questions regarding this conference. Our email address is events-europe@wolfram.com.
[![enter image description here][2]](https://www.computerbasedmath.org/events/maths-fix-conference-2021)
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=TMF-conference-logo.png&userId=20103
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2021-01-20at10.03.01AM.png&userId=20103Yaran Liang2020-12-21T17:08:48ZModelica Fluids Library
https://community.wolfram.com/groups/-/m/t/1940145
Hi I recently bought SystemModeler and was disappointed that the Fluids Library is not included In the Modelica Standard Library . Is there a plan to include this library in SystemModeler future updates and when will this happanCraig Branch2020-04-15T18:34:58Z3D AR Graphing with Wolfram
https://community.wolfram.com/groups/-/m/t/2166965
Hi everyone! I made a website that uses Wolfram's client library for python in order to make 3D models of an inputted equation and view them in AR! Check it out here:
https://devpost.com/software/3d-ar-grapher
Does anyone have any suggestions or improvements I could make?Richard Sbaschnig2021-01-18T22:10:17ZInstalling Mathematica under 64-bit Kali Linux on a Raspberry Pi
https://community.wolfram.com/groups/-/m/t/2167291
Since, from what I understand the bundle license for personal use of Mathematica is tied to the Raspberry hardware and not to the Raspian OS, and since I prefer the 64-bit version of Kali Linux to Raspian, here the steps I took to get Mathematica working on my RasPi under Kali Linux:
- In case you haven’t done so, make an attempt of making your installation a 32/64-bit multi-architecture system:
dpkg --add-architecture armhf
- download the Raspberry Pi Mathematica Installer from Wolfram Research
wget https://wolfr.am/wolfram-engine-raspi-install
- run whatever script the above link downloads, currently that’s: (and this may take a while, as it downloads the bulk of the install)
bash ./install-wolfram-engine-12.1.1.sh
- as long as Mathematica installs 32-bit binaries, it seems to have overlooked the following dependency, the 64-bit version of the library was already on my system (although it might have been installed as a dependency for something else...)
apt install libatomic1:armhf
- Mathematica requires rather questionable access to `/dev/vchiq` and `/dev/fb0` the latter of which is already group `video` with group read-write access. For `/dev/vchiq` we need to do this manually. Not sure I’m happy about the security implications of this… (In case future versions of Kali have different default permissions, commented out the otherwise required steps for `/dev/fb0` )
#chgrp video /dev/fb0
chgrp video /dev/vchiq
#chmod g+rw /dev/fb0
chmod g+rw /dev/vchiq
- for each non-root user who wants to successfully use Mathematica, the following is required:
sudo usermod -a -G video $(whoami)
That should do it, things work, etc.
There are however a few issues, to summarize:
1) I’m not sure how comfortable anyone should be with non-privileged users getting access to `/dev/fb0` and `/dev/vchiq` just to run Mathematica. If access to such resources is required, then that should be something handled in a privileged task and not require giving users wholesale access to devices.
2) As pointed out elsewhere in this forum, Mathematica failing with a seemingly totally unrelated licensing failure when access to these devices isn’t granted, is less than ideal. Unless one happens to stumble across this thread here [On Raspberry Pi 2, how do I get beyond the 'Product Activation' dialog?][1] good luck figuring out what’s the actual problem...
3) The install script, while otherwise rather good at installing dependencies, missed the dependency on `libatomic1` which consequently had to be installed manually, which is only in so far a problem as it’s another failure point, and, in case of a future de-installation of Mathematica, will linger as ghost, unless equally manually removed.
4) Of course, we’d all be even happier, if we could finally see an `arm64` rather than the `armhf` version of Mathematica, so the higher-end Raspberry Pi can effectively use their CPU and RAM most efficiently. But this is a good bridge solution for the time being, at least I won’t have to run a 32-bit kernel or OS anymore.
Anyway, enjoy! Hope this is helpful for someone...
[1]: https://community.wolfram.com/groups/-/m/t/444854Ronald Antony2021-01-19T18:19:52ZInstalling the Wolfram Language and Mathematica on your Raspberry Pi
https://community.wolfram.com/groups/-/m/t/157340
[i]Mathematica [/i]and The Wolfram Language are now available from ours and the Raspberry Pi foundation's software repositories for the default Raspbian Linux distribution for the Pi. If you're running a Raspbian image provided by the Raspberry Pi foundation, you can now install the software with the following steps:
[list=1]
[*]Ensure that you have at least [b]600[/b] megabytes of free storage on your Raspberry Pi's SD card. The package itself will take up 429 megabytes of disk space when installed.
[*][code]$ sudo apt-get update && sudo apt-get install wolfram-engine[/code]
[*]Agree to the licensing terms displayed (Use tab to move between fields in the license window. You will only need to do this once).
[*]Wait for the installation to complete.
[/list]You should now find Mathematica and the Wolfram Language installed on the LXDE desktop under the [b]Education[/b] menu and the Wolfram Language under the [b]Programming [/b]
menu.
In order to start the application from the Linux command line, type:[code]$ wolfram[/code]To start Mathematica, type:[code]$ mathematica[/code]
If you have any questions about installing the application on your Raspberry Pi, feel free to ask! Alex Newman2013-11-21T17:12:50ZRoadmap to Mathematica 12 on Raspberry Pi?
https://community.wolfram.com/groups/-/m/t/1664758
Great to see Mathematica 12 released and I can't wait to try the new functionality!
What is the timeline and roadmap to get Mathematica 12 to the Pi? Thanks!Michael Byczkowski2019-04-20T08:40:16ZDrawing a chess position from FEN (Forsyth–Edwards Notation)
https://community.wolfram.com/groups/-/m/t/2164714
![enter image description here][1]
I'm sure there have been many proposals on how to do this. I gave it a try, and after a few painful attempts I came up with a visually decent result, without too much code (IMHO). Also I really wanted to use unicode symbols, not drawing of pieces found on the web.
&[chess.nb][2]
TODO:
- Avoid using a hard-coded font size ;
- White pieces should not look "transparent" on a dark square.
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2021-01-20at11.26.07AM.jpg&userId=11733
[2]: https://www.wolframcloud.com/obj/71555ba7-132e-4569-913e-fa3e69184a85Lucien Grondin2021-01-16T13:12:04ZGet the image from Wolfram|Alpha by using Python?
https://community.wolfram.com/groups/-/m/t/1535836
I'm buiding a Virtual Assistant based on Wolfram Alpha and Python. However, a problem comes up,I want it to release an image. I've searched on the web but nothing. For example, when I type "Show me the image of a cat", the VA will release an image of a cat. My VA now only returns text. In that case, the result will be "none". Can you show me how to do this (Python code,please!)Nguyen Tuan2018-10-27T09:46:12ZCOVID19 Tokyo per days of the week
https://community.wolfram.com/groups/-/m/t/2133807
*MODERATOR NOTE: coronavirus resources & updates:* https://wolfr.am/coronavirus
----------
![enter image description here][1]
Seven curves represent number of confirmed COVID-19 cases in each day of the week through the year 2020, with top 4 points highlighted on each curve
(In Japanese)２０２０年東京の新規感染者数を曜日ごと（月曜から日曜までの７種類の曲線）に図示したグラフ。各曲線にはＴＯＰ４のランキングがマークされている。
-------------------------------------------
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7263tokyo.gif&userId=1875183
[2]: https://www.wolframcloud.com/obj/wolfram-community/Published/covid19TokoyoWeek3_1.nb
[Original notebook]: https://www.wolframcloud.com/obj/i-maruyama/Published/covid19TokyoWeek2.nb
[Original lead image]: https://community.wolfram.com//c/portal/getImageAttachment?filename=tokyo.gif&userId=1875183
[Original lead image2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Lead_figure4.gif&userId=20103Isao Maruyama2020-12-09T13:26:27ZMaking graphs over system dynamics models
https://community.wolfram.com/groups/-/m/t/2137836
&[Wolfram Notebook][1]
[Original]: https://www.wolframcloud.com/obj/antononcube/Published/Making-Graphs-over-System-Dynamics-Models.nb
[1]: https://www.wolframcloud.com/obj/wolfram-community/Published/Making-Graphs-over-System-Dynamics-Models_2.nbAnton Antonov2020-12-14T16:07:09ZWhy are minimum and maximum numbers fixed?
https://community.wolfram.com/groups/-/m/t/2166639
Hi, I would be happy to understand the way in which floating point numbers are represented in MATHEMATICA. In particular, I don't understand why the minimum and maximum positive numbers have fixed values, whereas simultaneously one can vary the accuracy of the representation. Is there any lucid explanation available? My question is motivated by the attempts to avoid underflow or overflow in computations involving (for example) exponential function. LeslawLeslaw Bieniasz2021-01-18T17:09:48ZSpeech to Wolfram Language code?
https://community.wolfram.com/groups/-/m/t/2166660
I shattered my right elbow falling on ice just before Christmas, had surgery to put my elbow back together on 12/28, and am starting a graduate program in Complex Systems on February 1st. I will be in a cast for a while. (I am right-handed.)
***Is there an efficient way to dictate Wolfram Language code?*** Or am I better off just typing with my left hand?Kathryn Cramer2021-01-18T17:43:07ZTimelinePlot with InfiniteFuture seems broken
https://community.wolfram.com/groups/-/m/t/2168293
TimelinePlot with InfiniteFuture seems broken
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/24b362e0-b072-455b-bc76-a5e1145d4aceKlaus-Martin Simonic2021-01-20T11:47:40ZDefining the "iteration" before defining a Table
https://community.wolfram.com/groups/-/m/t/2168280
Hi,
I have 2 functions f[x] and g[x] defined.
I would like to compare them by displaying some values.
So I build two tables :
tbA = Table[f[x],{x,1,4}]
tbB = Table[g[x],{x,1,4}]
Can I define the "iterations" i.e. {x,1,4} before defining the tables, so as I have not to duplicate them?
Thanks for help.Francois Hurter2021-01-20T10:24:29ZGenerating Random Datasets
https://community.wolfram.com/groups/-/m/t/2109909
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/mike.besso/Published/creating-random-datasets-v2.nbMike Besso2020-11-06T21:34:01ZGet the transfer function from measured data curve ?
https://community.wolfram.com/groups/-/m/t/2168439
Any suggestion how to let Wolfram|Alpha automatically calculate the transfer function equation from measured data curve in a file? I would like to control hot plate by PID to follow reflow profile.John Deere2021-01-20T13:41:55ZSolve a Euro Math Cup 2020 Problem with GeometricScene
https://community.wolfram.com/groups/-/m/t/2168033
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2021-01-19_19-16-12.gif&userId=23928
[2]: https://www.wolframcloud.com/obj/shenghuiy/Published/EuroMathCup2020.nbShenghui Yang2021-01-20T04:18:41ZGenerate points with density following Gaussian distribution
https://community.wolfram.com/groups/-/m/t/2166132
Hello,
I want to generate a collection of 1000 points (x, y), at (near) origin with their density following a Gaussian distribution on both X and Y axes. The full width half maxima (FWHM) of this Gaussian distribution should be a variable, say 5 to start with.
Will appreciate any help. ThanksS G2021-01-18T06:41:30Z[GIF] Visualizing Interstellar's Wormhole: from article to programming
https://community.wolfram.com/groups/-/m/t/852052
*Click on image to zoom. Press browser back button to return to the post.*
----------
[![enter image description here][5]][5]
Let me start off by saying that I know almost nothing about general relativity, but I thought it was really fun translating the equations presented in [this paper](http://arxiv.org/abs/1502.03809) by Oliver James, Eugenie von Tunzelmann, Paul Franklin, and Kip Thorne into notebook expressions.
Embedding Diagrams
==================
The paper gives some really cool figures to show the curvature of 4-dimensional spacetime in the region around a wormhole. The physics of the wormhole is essentially described by three parameters:
1. $\rho$ - the radius of the wormhole
2. $a$ - the length of the wormhole
3. $\mathcal{M}$ - a parameter describing the curvature, described in the paper as the "gentleness of the transition from the wormhole's cylindrical interior to its asymptotically flat exterior"
To look at the curvature for a given set of parameters, we only really care about the ratios $a/\rho$ and $\mathcal{M}/\rho$.
Taking equations (5) and (6) from the paper, we can plot the curvature for any pair of these parameters using cylindrical coordinates. Since the $z$ coordinate is described found via numerical integration, I chose to speed up the `ParametricPlot3D` by first forming an interpolating function.
embeddingDiagram[a_, M_, lmax_: 4] := Module[{? = 1, z, zz, x, r},
x[l_] := (2 (Abs[l] - a))/(?*M);
r[l_] := ? +
UnitStep[
Abs[l] - a] (M (x[l]*ArcTan[x[l]] - 1/2 Log[1 + (x[l])^2]));
z[l_] :=
NIntegrate[Sqrt[
1 - (UnitStep[
Abs[ll] -
a] (2 ArcTan[(2 (-a + Abs[ll]))/(M ?)] Sign[
l])/?)^2], {ll, 0, l}];
zz = Interpolation@({#, z[#]} & /@ Subdivide[lmax, 20]);
ParametricPlot3D[{{r[l] Cos[t], r[l] Sin[t], zz[l]}, {r[l] Cos[t],
r[l] Sin[t], -zz[l]}}, {l, 0, lmax}, {t, 0, 2 ?},
PlotStyle -> Directive[Orange, Specularity[White, 50]],
Boxed -> False,
Axes -> False,
ImageSize -> 500,
PlotPoints -> {40, 15}]
]
and here are three examples shown in the paper,
embeddingDiagram[0.005, 0.05/1.43]
embeddingDiagram[0.5, 0.014]
embeddingDiagram[0.5, 0.43, 10]
![enter image description here][2]
Tracing rays through the wormhole
=================================
The appendix to the paper describes a procedure for creating an image taken from a camera on one side of the wormhole. The procedure involves generating a map from one set of spherical polar coordinates (the "camera sky") to the "celestial spheres" describing the two ends of the wormhole.
First a location is chosen for the camera, then light rays are traced backwards in time from the camera to one of the two celestial spheres. This ray tracing involves solving 5 coupled differential equations back from $t=0$ to minus infinity (or a large negative time).
For this I use [`ParametricNDSolve`](http://reference.wolfram.com/language/ref/ParametricNDSolve.html). The functions being solved for are the spherical coordinates of the light rays and their momenta.
The parameters for `ParametricNDSolve` are the wormhole parameters listed above, the camera's position `{lcamera, ?camera, ?camera}` and the "camera sky" coordinates, used to build the map. Rather than walk through their derivation (again, not a cosmologist), I cite the paper for the equations given below:
rayTrace = Module[{
(* auxilliary variables *)
nl, n?, n?, p?,
bsquared, M, x, r, rprime,
(* parameters for ParametricNDSolve *)
?camsky, \
?camsky, ?, lcamera, ?camera, ?camera, W, a,
(* time dependent parameters to be solved for *)
l, ?, ?, pl, p?,
(* the time variable *)
t
},
(* Eq. (7) *)
M = W/1.42953;
(*Eq. 5 *)
x[l_] := (2 (Abs[l] - a))/(?*M);
r[l_] := ? +
UnitStep[
Abs[l] - a] (M (x[l]*ArcTan[x[l]] - 1/2 Log[1 + (x[l])^2]));
rprime[l_] :=
UnitStep[
Abs[l] -
a] (2 ArcTan[(2 (-a + Abs[l]))/(M ?)] Sign[l])/?;
(* Eq. A.9b *)
nl = -Sin[?camsky] Cos[?camsky];
n? = -Sin[?camsky] Sin[?camsky];
n? = Cos[?camsky];
(*Eq. A.9d*)
p? = r[lcamera] Sin[?camera] n?;
bsquared = (r[lcamera])^2*(n?^2 + n?^2);
ParametricNDSolveValue[{
(* Eq. A.7 *)
l'[t] == pl[t],
?'[t] == p?[t]/(r[l[t]])^2,
?'[t] == p?/((r[l[t]])^2 (Sin[?[t]])^2),
pl'[t] == bsquared*rprime[l[t]]/(r[l[t]])^3,
p?'[t] ==
p?^2/(r[l[t]])^2 Cos[?[t]]/(Sin[?[t]])^3,
(* Eq. A.9c *)
pl[0] == nl,
p?[0] == r[lcamera] n?,
(* Initial conditions, paragraph following Eq. A.9d *)
l[0] == lcamera,
?[0] == ?camera,
?[0] == ?camera
},
{l, ?, ?, pl, p?},
{t, 0, -10^6},
{?camsky, ?camsky,
lcamera, ?camera, ?camera, ?, W, a}]];
Now to use the `rayTrace` function - we want to build up an array of values for which we can use a `ListInterpolation` function to map any direction in the camera's local sky to coordinates in one of the celestial spheres. Exactly which celestial sphere is determined by the sign of the lenght coordinate, `l`. The size of the array is very important. I find that it is important to use an odd number of array elements, or you'll end up with an ugly vertical line in the center of your image.
generateMap[nn_, lc_, ?c_, ?c_, ?_, W_, a_] :=
ParallelTable[{Mod[#2/?, 1], Mod[#3/(2 ?), 1], #1} & @@
Through[rayTrace[?, ?, lc, ?c, ?c, ?,
W, a][-10^6]][[;; 3]], {?,
Subdivide[?, nn]}, {?, Subdivide[2 ?, nn]}]
Finally you need a function to transform the two input images using the map generated by the above function. I would be very happy if someone could suggest a method to do this better - perhaps using `ImageTransformation`? I was able to make something work with `ImageTransformation` but it was much less efficient than this. Essentially, `ImageTransformation` can map pixels from one part of an image to another, but they won't grab pixels from another image. You could create a composite image, with the two stacked on top of each other, or you could use the transformation function on each one separately and then combine them.
blackHoleImage[foreground_, background_, map_] :=
Module[{raytracefunc, img1func, img2func, nrows, ncols, mapfunc},
{nrows, ncols} = Reverse@ImageDimensions@foreground;
raytracefunc =
ListInterpolation[#, {{1, nrows}, {1, ncols}},
InterpolationOrder -> 1] & /@ Transpose[(map), {2, 3, 1}];
img1func =
ListInterpolation[#, {{0, 1}, {0, 1}}] & /@
Transpose[(foreground // ImageData), {2, 3, 1}];
img2func =
ListInterpolation[#, {{0, 1}, {0, 1}}] & /@
Transpose[(background // ImageData), {2, 3, 1}];
mapfunc[a_, b_, x_ /; x <= 0] := Through[img2func[a, b]];
mapfunc[a_, b_, x_ /; x > 0] := Through[img1func[a, b]];
Image@Array[
mapfunc @@ Through[raytracefunc[#1, #2]] &, {nrows, ncols}]
]
Low-resolution test
===================
To generate a map using `nn=501` takes about 15 to 20 minutes on my PC, so it's no good for testing the effects of various parameters. So we'll make a much smaller map, and the quality of the image will be lower. We can grab a couple of images from the cite listed in the paper,
foreground=Import["http://www.dneg.com/wp-content/uploads/2015/02/InterstellarWormhole_Fig6b.jpg"];
background=Import["http://www.dneg.com/wp-content/uploads/2015/02/InterstellarWormhole_Fig6a.jpg"];
and make a 101 by 101 map in under a minute:
map1 =
generateMap[101, 6.0, ?/2, 0, 5.0, 0.07, 2.4]; // AbsoluteTiming
(* {36.2135, Null} *)
Here I've taken some some paramters I think make a cool picture ($ \rho = 5.0$, $a = 2.4$, $W = \mathcal{M}/1.43 = 0.07$) and put the camera at $\{l, \theta, \phi\} = \{ 6, \pi/2, 0 \}$. Since the map is low resolution, I can reduce the resolution of the images to get a quick result,
blackHoleImage[ImageResize[foreground, 500],
ImageResize[background, 500], map1]
[![enter image description here][3]][4]
But if you set `nn=501` and don't resize the images you get
![enter image description here][5]
Alien invasion
==============
Have you ever read the *Commonwealth Saga* by Peter F. Hamilton, wherein an alien invades human-held territories via wormhole with the intent of exterminating our species?
![Mathematica graphics](http://i.imgur.com/DQ33Qkh.gif)
[here](https://www.dropbox.com/s/f9zu8eyjnxx77jj/out.mp4?dl=1) is a better quality, lower filesize mp4 of the above animation. To make this one, I varied the wormhole width from 0 up to 5, then used `ImageCompose` to add in [this](http://www.wpclipart.com/cartoon/aliens/alien_ship/flying_saucer_2_T.png) stock image flying saucer, then shrunk the wormhole back to zero width.
Unfinished tasks
--
I think it would be very interesting to take the result of `rayTrace` and plot it on top of the embedding diagram, but I haven't quite figured this out.
I also think it would be pretty neat to take a terrestrial picture (say of the White House), and have a wormhole open up in the background. Finally, I would be very pleased to figure out how to put the wormhole at any position in an image I want, rather than just the center.
[1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=frame_100.png&userId=130877
[2]: http://i.stack.imgur.com/f3drY.png
[3]: http://i.stack.imgur.com/cvKBK.png
[4]: http://i.stack.imgur.com/cvKBK.png
[5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=frame_100.jpg&userId=20103Jason Biggs2016-05-06T13:44:35ZGet U.S. treasury yield curve via Wolfram|Alpha?
https://community.wolfram.com/groups/-/m/t/1776571
Carl Lange on the Mathematica Stack Exchange site suggest I ask the following here as well...
Disturbingly coincident with the U.S. Treasury Yield Curve's recent volatility and inversion, the previously highly reliable & available data from the Treasury's website a [Treasury's website xml data format][1], frequently becomes unreachable.
(Note: this data requires some parsing to become useful in Mathematica).
This unavailability also affects the [Treasury's Resource Center website's Daily Treasury Yield Curve Rates presentation][2] of the information, although not as often.
![Treasury Resource Center][3]
Not certain, of the underlying cause of the problem, I turned to WolframAlpha, which raises a couple of questions.
___________________
The U.S. Treasury publishes yield curve data at the end of each trading day. As I want the most current data I can typically access it by 4:15 PM Eastern time using the following WolframAlpha query:
WolframAlpha["United States, Treasury yield curve"]
![WolfraAlpha query][4]
I can, extract the relevant data values by adding "NumberData" to the query:
WolframAlpha["United States, Treasury yield curve", "NumberData"]
{{2, 1.79, 1.61, 1.5, 1.62, 2.11}}
But, this doesn't give me all yields available for all the maturities that the Treasury supplies.
Clicking on the WolframAlpha's "More" button shows that WolframAlpha has access to all of this data:
![More maturities][5]
__________
**Question 1**: How can I access the yields from all available maturities? Essentially, I want to use
"NumberData",
but get all of the values.
**Question 2**: The WolframAlpha data lags the data published on the Treasury site (when one can get to it). In the cases shown, WolframAlpha accesses the August 22, 2019 data rather than the August 23, 2019 data available on the Treasury site. Over the past couple of weeks I have seen lags of as many of 3 trading days. How come? Does any way exist to to force/direct WolframAlpha to access more current data?
**Alternatively**: Can I access any of this data with FinancialData[] or some other direct means? One could previously get the U.S. Treasury 30 yield prices from which one can derive the 30 yield with:
FinancialData["^TYX"]
but this doesn't seem to work anymore.
The [Yahoo][6] link to this data still works.
Thoughts appreciated.
[1]: http://%22https//www.treasury.gov/resource-center/data-chart-center/interest-%5C%20rates/pages/XmlView.aspx?data=yield%22
[2]: https://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield
[3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-08-26at9.13.11AM.png&userId=50524
[4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-08-26at8.47.28AM.png&userId=50524
[5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-08-26at8.48.16AM.png&userId=50524
[6]: https://finance.yahoo.com/quote/%5ETYX/Andreas Agas2019-08-26T17:53:39Z[UPDATES] Resources For Novel Coronavirus COVID-19
https://community.wolfram.com/groups/-/m/t/1872608
*Short URL to share this post*: https://wolfr.am/coronavirus
***JOIN*** *our* ***Medical Sciences*** *group for the latest updates & best networking*: https://wolfr.am/MedicalSciences
----------
This post is intended to be the hub for Wolfram resources related to novel coronavirus disease COVID-19 that originated in Wuhan, China. The larger aim is to provide a forum for disseminating ways in which Wolfram technologies and coding can be utilized to shed light on the virus and pandemic. Possibilities include using the Wolfram Language for data-mining, modeling, analysis, visualizations, and so forth. Among other things, we encourage comments and feedback on these resources. Please note that this is intended for technical analysis and discussion supported by computation. Aspects outside this scope and better suited for different forums should be avoided. Thank you for your contribution!
[![enter image description here][1]](https://www.wolframcloud.com/obj/examples/COVID19China)
[![enter image description here][2]](https://www.wolframcloud.com/obj/examples/COVID19US)
[![enter image description here][3]](https://www.wolframcloud.com/obj/examples/COVID19World)
[![enter image description here][4]](https://www.wolframcloud.com/obj/examples/COVID19Gene)
[![enter image description here][5]](https://www.wolframcloud.com/obj/examples/COVID19Patient)
[![enter image description here][6]](https://www.wolframcloud.com/obj/examples/COVID19Resources)
[![enter image description here][7]](https://www.wolframcloud.com/obj/examples/COVID19Dashboard)
*Short URL to share dashboard:* https://wolfr.am/COVID19Dashboard
## ________________________________________
## FEATURED CONTENT
- [COVID-19 Livestream Notebook March 24][10] by Stephen Wolfram
- [Agent-Based Networks Models for COVID-19][11] by Christopher Wolfram
- [Live-Stream: Exploring Pandemic Data][8] by Stephen & Christopher Wolfram + guests
- [Live-Stream: Exploring and Explaining Epidemic Modeling][9] by Stephen & Christopher Wolfram + guests
## ________________________________________
## [CALL for Making COVID-19 Data Computable (*link*)][14]
More pandemic-related information and data sets emerging every day. We invite people in the community to contribute to making more data surrounding this topic computable. Here is a call to action with some recommendations for people who want to do more, whether it's just pointing out relevant data sources, or taking the time to make some of that data computable and more instantly ready for other people to explore: https://wolfr.am/COVID-19-DATA .
## ________________________________________
## [Curated Computable Data (*link*)][15]
[FOLLOW THIS LINK][15] to see all available COVID-19 data repositories ready for computation in the Wolfram Language .
We have published and are continuously updating the Wolfram Data Repository entries. Below are a few key ones. Follow the link above to browse all repositories. We encourage you to make [*your own contributions*][16] of curated data relevant to COVID-19.
> **Pandemic Data for Novel Coronavirus COVID-19**
> https://www.wolframcloud.com/obj/resourcesystem/published/DataRepository/resources/Epidemic-Data-for-Novel-Coronavirus-COVID-19
> **Genetic Sequences for the SARS-CoV-2 Coronavirus**
> https://datarepository.wolframcloud.com/resources/Genetic-Sequences-for-the-SARS-CoV-2-Coronavirus
> **Patient Medical Data for Novel Coronavirus COVID-19**
> https://datarepository.wolframcloud.com/resources/Patient-Medical-Data-for-Novel-Coronavirus-COVID-19
> **COVID-19 Hospital Resource Use Projections**
> https://datarepository.wolframcloud.com/resources/COVID-19-Hospital-Resource-Use-Projections
> **OECD Data: Hospital Beds Per Country**
> https://datarepository.wolframcloud.com/resources/OECD-Data-Hospital-Beds-Per-Country
> **Hospital Beds Per US State**
> https://datarepository.wolframcloud.com/resources/Hospital-Beds-Per-US-State
## ________________________________________
## [Computational Publications (*link*)][17]
We encourage you to share your computational explorations relevant to coronavirus on Wolfram Community as stand-alone articles and then comment with their URL links on this discussion thread. We will summarize these articles in the following list:
### ________________________________
###FEATURED
> **COVID-19 Livestream Notebook March 24** by Stephen Wolfram
> https://www.wolframcloud.com/obj/s.wolfram/Published/COVID-19-Livestream-March-24.nb
> **Agent-Based Networks Models for COVID-19** by Christopher Wolfram
> https://community.wolfram.com/groups/-/m/t/1907703
> **Epidemiological Models for Influenza and COVID-19** by Robert Nachbar
> https://community.wolfram.com/groups/-/m/t/1896178
> **Epidemic simulation with a polygon container** by Francisco Rodríguez
> https://community.wolfram.com/groups/-/m/t/1901002
> **Distance to nearest confirmed US COVID-19 case** by Chip Hurst
> https://community.wolfram.com/groups/-/m/t/1911583
### ________________________________
### EPIDEMIC MODELING: SIMULATION
> **Epidemic simulation with a polygon container** by Francisco Rodríguez
> https://community.wolfram.com/groups/-/m/t/1901002
> **Agent based epidemic simulation** by Jon McLoone
> https://community.wolfram.com/groups/-/m/t/1900481
> **Modeling the spatial spread of infection diseases in the US** by Diego Zviovich
> https://community.wolfram.com/groups/-/m/t/1889072
> **Geo-spatial-temporal COVID-19 simulations and visualizations over USA** by Diego Zviovich
> https://community.wolfram.com/groups/-/m/t/1900514
### ________________________________
### EPIDEMIC MODELING: COMPARTMENTAL
> **Stochastic Epidemiology Models with Applications to the COVID-19** by Robert Nachbar
> https://community.wolfram.com/groups/-/m/t/1980051
> **COVID19: Italian SIRD estimates and prediction** by Christos Papahristodoulou
> https://community.wolfram.com/groups/-/m/t/1984320
> **Solver for COVID-19 epidemic model with the Caputo fractional derivatives** by Alexander Trounev
> https://community.wolfram.com/groups/-/m/t/1976589
> **Epidemiological Model for repetitive rapid testing for COVID-19** by Diego Zviovich
> https://community.wolfram.com/groups/-/m/t/2075883
> **Phase transition of a SIR agent-based models** by Diego Zviovich
> https://community.wolfram.com/groups/-/m/t/1977230
> **A simple estimate of covid-19 fatalities based on past data** by Kay Herbert
> https://community.wolfram.com/groups/-/m/t/1959438
> **SIR Model with Log-normal infected periods** by Diego Zviovich
> https://community.wolfram.com/groups/-/m/t/1946292
> **SEI2HR-Econ model with quarantine and supplies scenarios** by Anton Antonov
> https://community.wolfram.com/groups/-/m/t/1937880
> **COVID-19 - Policy Simulator - Can you find the perfect policy?** by Jan Brugard
> https://community.wolfram.com/groups/-/m/t/1931352
> **Epidemiological Models for Influenza and COVID-19** by Robert Nachbar
> https://community.wolfram.com/groups/-/m/t/1896178
> **Exploring Epidemiological Modeling** by Jordan Hasler
> https://community.wolfram.com/groups/-/m/t/1920119
> **SEI2HR model with quarantine scenarios** by Anton Antonov
> https://community.wolfram.com/groups/-/m/t/1926505
> **The SIR Model for Spread of Disease** by Arnoud Buzing
> https://community.wolfram.com/groups/-/m/t/1903289
> **COVID-19 - R0 and Herd Immunity - are we getting closer?** by Jan Brugard
> https://community.wolfram.com/groups/-/m/t/1911422
> **Basic experiments workflow for simple epidemiological models** by Anton Antonov
> https://community.wolfram.com/groups/-/m/t/1895675
> **Scaling of epidemiology models with multi-site compartments** by Anton Antonov
> https://community.wolfram.com/groups/-/m/t/1897377
> **WirVsVirus 2020 hackathon participation** by Anton Antonov
> https://community.wolfram.com/groups/-/m/t/1907256
> **An SEIR like model that fits the coronavirus infection data** by Enrique Garcia Moreno
> https://community.wolfram.com/groups/-/m/t/1888335
> **A SEIRD Model For COVID-19 Using DDEs** by Luis Borgonovo
> https://community.wolfram.com/groups/-/m/t/1996374
> **A Neat Package for Compartmental Model Diagrams** by Hamza Alsamraee
> https://community.wolfram.com/groups/-/m/t/2078640
### ________________________________
### EPIDEMIC MODELING: LOGISTIC
> **COVID-19 pandemic data in Italy** by Riccardo Fantoni
> https://community.wolfram.com/groups/-/m/t/1909687
> **Predicting Coronavirus Epidemic in United States** by Robert Rimmer
>https://community.wolfram.com/groups/-/m/t/1906954
> **Tracking Coronavirus Testing in the United States** by Robert Rimmer
> https://community.wolfram.com/groups/-/m/t/1902302
> **Logistic Model for Quarantine Controlled Epidemics** by Robert Rimmer
> https://community.wolfram.com/groups/-/m/t/1900530
> **Updated: coronavirus logistic growth model: China** by Robert Rimmer
> https://community.wolfram.com/groups/-/m/t/1890271
> **Coronavirus logistic growth model: China** by Robert Rimmer
> https://community.wolfram.com/groups/-/m/t/1887435
> **Coronavirus logistic growth model: Italy and South Korea** by Robert Rimmer
> https://community.wolfram.com/groups/-/m/t/1887823
> **Coronavirus logistic growth model: South Korea** by Robert Rimmer
> https://community.wolfram.com/groups/-/m/t/1894561
> **Logistic growth model for epidemic Covid-19 in Colombia** by Diego Ramos
> https://community.wolfram.com/groups/-/m/t/2092786
### ________________________________
### GENOMICS
> **Analyzing Nextstrain Data with WFR Newick Functions (COVID-19/SARS-CoV-2)** by John Cassel
> https://community.wolfram.com/groups/-/m/t/1958952
> **Estimating the number of times the SARS CoV-2 virus has replicated** by Carlos Munoz
> https://community.wolfram.com/groups/-/m/t/1943243
>**From sequenced SARS-CoV-2 genomes to a phylogenetic tree** by Daniel Lichtblau
>https://community.wolfram.com/groups/-/m/t/1961461
> **Genome analysis and the SARS-nCoV-2** by Daniel Lichtblau
> https://community.wolfram.com/groups/-/m/t/1874816
> **Visualizing Sequence Alignments from the COVID-19** by Jessica Shi
> https://community.wolfram.com/groups/-/m/t/1875352
> **A walk-through of the SARS-CoV-2 nucleotide Wolfram resource** by John Cassel
> https://community.wolfram.com/groups/-/m/t/1887456
> **Geometrical analysis of genome for COVID-19 vs SARS-like viruses** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/1878824
> **Chaos Game For Clustering of Novel Coronavirus COVID-19** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/1875994
### ________________________________
### DATA ANALYSIS
> **COVID-19 - The Swedish Experiment - Is it working?** by Jan Brugard
> https://community.wolfram.com/groups/-/m/t/1974412
> **A simple COVID-19 spread model** by Daniel Lichtblau
> https://community.wolfram.com/groups/-/m/t/1945196
> **COVID19: The performance of the Swedish strategy** by Christos Papahristodoulou
> https://community.wolfram.com/groups/-/m/t/1990972
> **Exploring social trends on Covid-19 pandemic using WikipediaData** by Jofre Espigule-Pons
> https://community.wolfram.com/groups/-/m/t/1931508
> **Google Mobility Data** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/1946686
> **Understanding Aggregate COVID Curves** by Christopher Wolfram
> https://community.wolfram.com/groups/-/m/t/2068457
> **Apple mobility trends data visualization** by Anton Antonov
> https://community.wolfram.com/groups/-/m/t/1942813
> **Computing COVID-19 Spread Rates in US Cities** by Daniel Lichtblau
> https://community.wolfram.com/groups/-/m/t/1930261
> **COVID-19 data and the Newcomb Benford Distribution** by Gustavo Delfino
> https://community.wolfram.com/groups/-/m/t/1913908
> **Short-time trends for COVID-19**, by Fabian Wenger
> https://community.wolfram.com/groups/-/m/t/1912710
> **What countries are hit hard by COVID19 outbreak?** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/1904507
> **COVID19 in Iran: under-diagnosis issue** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/1891140
> **Argentina: COVID-19 Data Analysis** by Tobias Canavesi
> https://community.wolfram.com/groups/-/m/t/1932910
> **Analysis of the Change in Phillips Curve After COVID-19 with Regression** by Seojin Yoon
> https://community.wolfram.com/groups/-/m/t/2055704
> **COVID wave alert: statistical analysis and visualization** by Antonio Neves
> https://community.wolfram.com/groups/-/m/t/2115658
> **Predicting COVID-19 using cough sounds classification** by Siria Sadeddin
> https://community.wolfram.com/groups/-/m/t/2166833
### ________________________________
### DATA VISUALIZATIONS
> **Top 20 COVID countries HeatMap by absolute death and death in ppm** by Rodrigo Murta
> https://community.wolfram.com/groups/-/m/t/2004800
> **US Counties COVID-19 confirmed cases by population density timelines** by Bob Sandheinrich
> https://community.wolfram.com/groups/-/m/t/1992898
> **3D Modeling of the SARS-CoV-2 Virus in the Wolfram Language** by Jeff Bryant
> https://community.wolfram.com/groups/-/m/t/1989540
> **California COVID19 Data** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/2132204
> **COVID-19 progress in Peru macro regions: coast vs mountain vs jungle** by Francisco Rodríguez
> https://community.wolfram.com/groups/-/m/t/1965079
> **COVID-19 reopening criterion: a simple visualization** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/1962615
> **100 Days of COVID19 Over US Counties** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/1956368
> **Population Density Map** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/1955760
> **Google Mobility Data** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/1946686
> **COVID19 Case-Fatality Ratio, Income, and Age: Simple Visualization** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/1939045
> **Data Analysis of Coronavirus in Mexico** by Ivan Martinez
> https://community.wolfram.com/groups/-/m/t/1927657
> **Confirmed COVID-19 Cases in Catalonia** by Bernat Espigulé Pons
> https://community.wolfram.com/groups/-/m/t/1919468
> **Distance to nearest confirmed US COVID-19 case** by Chip Hurst
> https://community.wolfram.com/groups/-/m/t/1911583
> **COVID19 Confirmed Cases: US Counties** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/1950980
> **COVID19 data visualization across US counties** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/2119049
> **Maps for Visualizing Covid-19's Effect** by Eric Mockensturm
> https://community.wolfram.com/groups/-/m/t/1934457
> **US Counties COVID-19 deaths plot** by Bob Sandheinrich
> https://community.wolfram.com/groups/-/m/t/1918332
> **Comparing the spread of COVID-19 between countries**, Jan Brugard
> https://community.wolfram.com/groups/-/m/t/1905992
> **NY Times COVID-19 data visualization** by Anton Antonov
> https://community.wolfram.com/groups/-/m/t/1911668
> **COVID-19 cases for each administrative division in Spain** by Bernat Espigulé Pons
> https://community.wolfram.com/groups/-/m/t/1910116
> **Propagation risk of COVID-19 by local contact in Spain (10 - 14 March)** by Bernat Espigulé Pons
> https://community.wolfram.com/groups/-/m/t/1898126
> **Visualizing the Pandemic Data COVID-19** by Martijn Froeling
> https://community.wolfram.com/groups/-/m/t/1899870
> **COVID-19 visualization of turning point** by Isao Maruyama
> https://community.wolfram.com/groups/-/m/t/1899911
> **Mapping "Live" COVID Data on a Globe** by Gabriel Lemieux
> https://community.wolfram.com/groups/-/m/t/1902102
> **Novel Coronavirus COVID-19 in Brazil** by Estevao Teixeira
> https://community.wolfram.com/groups/-/m/t/1905950
> **Mapping Novel Coronavirus COVID-19 Outbreak** by Jofre Espigule-Pons
> https://community.wolfram.com/groups/-/m/t/1868945
> **Ways to visualize COVID-19 simulation results?** by Kyle Keane
> https://community.wolfram.com/groups/-/m/t/1962739
> **General and COVID-19 deaths in Sweden** by Oscar Rodriguez
> https://community.wolfram.com/groups/-/m/t/2006377
> **COVID19 Tokyo per days of the week** Isao Maruyama
> https://community.wolfram.com/groups/-/m/t/2133807
### ________________________________
### DATA PROCESSING
> **Cov-Tell: Daily COVID-19 Updates with Alexa (made with Wolfram APIFunction)** by Jessica Shi
> https://community.wolfram.com/groups/-/m/t/1958307
> **Build a COVID-19 Chest X-Ray Image Uploader with Cloud & Data Drop** by Jofre Espigule-Pons
> https://community.wolfram.com/groups/-/m/t/1919770
> **Scraping OpenTable's "State of the Industry" page** by Aaron Enright
> https://community.wolfram.com/groups/-/m/t/1911043
> **City-level Search Tool for Coronavirus (COVID-19) Confirmed Cases** by David Lomiashvili
> https://community.wolfram.com/groups/-/m/t/1913247
> **Web Scraper: New York Times Coronavirus Data** by Robert Rimmer
> https://community.wolfram.com/groups/-/m/t/1894426
> **TraCOV: Personalized COVID-19 Risk Analysis Tool** by Jessica Shi
> https://community.wolfram.com/groups/-/m/t/1977700
> **Mobility changes data: transforming to Wolfram Language dataset** by Mads Bahrami
> https://community.wolfram.com/groups/-/m/t/2160386
### ________________________________
### Masks
> **Effect of mandatory mask usage in COVID cases** by Diego Zviovich
> https://community.wolfram.com/groups/-/m/t/1919060
> **Face mask detection: classifying image data** by Siria Sadeddin
> https://community.wolfram.com/groups/-/m/t/2139499
## ________________________________________
## [Livestream Archives (*link*)][18]
- Stephen & Christopher Wolfram + guests [Exploring Pandemic Data][19]
- Stephen & Christopher Wolfram + guests [Exploring and Explaining Epidemic Modeling][20]
- Robert Nachbar - [Epidemiological Models for Influenza and COVID-19][21]
- Brian Wood - [COVID-19 Dashboard Visualizations][22]
- John Cassel - [Behind the Genetic Sequences for Novel Coronavirus SARS-CoV-2][23]
- Keiko Hirayama - [Patient Data Exploration for the Novel Coronavirus COVID-19][24]
- Keiko Hirayama - [Pandemic Data Exploration for the Novel Coronavirus COVID-19][25]
- Diego Zviovich - [Geo-spatial-temporal COVID-19 Simulations and Visualizations Over USA][26]
- Anton Antonov - [COVID19 Epidemic Modeling: Compartmental Models][27]
- Anton Antonov - [Scaling of Epidemiology Models with Multi-site Compartments][28]
- Anton Antonov - [Simple Economic Extension of Compartmental Epidemiological Models][29]
- Juan Klopper - [Coronavirus medical data analysis][30]
- Juan Klopper - [Coronavrirus epidemiological data analysis][31]
- Rory Foulger - [Coronavirus Data Exploration - Wolfram Livecoding with Students][32]
## ________________________________________
## Other useful resources
- Arnoud Buzing [GitHub][33] repository and [Notebook Gallery][34] for coronavirus
- [Modeling a Pandemic like Ebola with the Wolfram Language](https://blog.wolfram.com/2014/11/04/modeling-a-pandemic-like-ebola-with-the-wolfram-language)
- [Epidemics at Wolfram Demonstrations](https://demonstrations.wolfram.com/search.html?query=epidemic)
- [IGSIRProcess - IGraph Epidemic models][35]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1China_c.png&userId=1624544
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1.5US_c.png&userId=1624544
[3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2World_c.png&userId=1624544
[4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=3Genetic_c.png&userId=1624544
[5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=4Patient_c.png&userId=1624544
[6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=5Resources_c.png&userId=1624544
[7]: https://www.wolframcloud.com/obj/examples/COVID19Preview.png
[8]: https://youtu.be/Vs5APySGYnk
[9]: https://youtu.be/kC6LHAv_lx0
[10]: https://www.wolframcloud.com/obj/s.wolfram/Published/COVID-19-Livestream-March-24.nb
[11]: https://community.wolfram.com/groups/-/m/t/1907703
[12]: https://community.wolfram.com/groups/-/m/t/1896178
[13]: https://community.wolfram.com/groups/-/m/t/1901002
[14]: https://community.wolfram.com/groups/-/m/t/1908923
[15]: https://datarepository.wolframcloud.com/search/?i=COVID-19
[16]: https://reference.wolfram.com/language/workflow/SubmitToTheWolframDataRepository.html
[17]: http://wolfr.am/StaffPicks
[18]: https://www.youtube.com/playlist?list=PLxn-kpJHbPx3_hUbroRYC_7NxcOwZ1SWa
[19]: https://youtu.be/Vs5APySGYnk
[20]: https://youtu.be/kC6LHAv_lx0
[21]: https://youtu.be/pcFB6_yrxGE
[22]: https://youtu.be/vUq8qx7kTYA
[23]: https://youtu.be/HCJgv3N_kDo
[24]: https://youtu.be/MlI_8o4A3BA
[25]: https://youtu.be/P86ZY-znE64
[26]: https://youtu.be/Kjk-sYlg-U0
[27]: https://youtu.be/LRs9rYCXIzs
[28]: https://youtu.be/b8oCNjRI0gY
[29]: https://youtu.be/C-sjXQiPE7s
[30]: https://youtu.be/gA0TPQZgNY0
[31]: https://youtu.be/I-n3zN4aU6c
[32]: https://youtu.be/4xCfPIiredM
[33]: https://github.com/arnoudbuzing/wolfram-coronavirus
[34]: https://wolfr.am/JZNRriEE
[35]: http://szhorvat.net/mathematica/IGDocumentation/#epidemic-modelsVitaliy Kaurov2020-02-04T15:18:14Z[WSG20] New Linear Algebra Daily Study Group begins Monday, October 12
https://community.wolfram.com/groups/-/m/t/2091247
A new study group devoted to linear algebra begins Monday! A list of daily topics can be found on our [Daily Study Groups page][1]. This group will be led by Wolfram certified instructor [@Luke Titus][at0] and will meet daily, Monday to Friday, over the next three weeks. Luke will share the excellent short lesson videos created by [@Devendra Kapadia][at1] for the Wolfram U course [Introduction to Linear Algebra][2]. Study group sessions include time for exercises, discussion and Q&A. Certifications are available. Sign up: [https://wolfr.am/Q9qbTXu3][3]
[at0]: https://community.wolfram.com/web/luket
[at1]: https://community.wolfram.com/web/dkapadia
[1]: https://www.wolfram.com/wolfram-u/special-event/study-groups/
[2]: https://www.wolfram.com/wolfram-u/introduction-to-linear-algebra/
[3]: https://wolfr.am/Q9qbTXu3Jamie Peterson2020-10-08T17:22:30ZUS Counties COVID-19 confirmed cases by population density timelines
https://community.wolfram.com/groups/-/m/t/1992898
*MODERATOR NOTE: coronavirus resources & updates:* https://wolfr.am/coronavirus
----------
&[Wolfram Notebook][1]
[Original]: https://www.wolframcloud.com/obj/bobs/Published/COVID19-USCounty-PopulationDensityTimelines.nb
[1]: https://www.wolframcloud.com/obj/2a2e1af5-c751-41e5-abf1-1ad84f695f24Bob Sandheinrich2020-06-02T16:28:47ZExport in For Loop
https://community.wolfram.com/groups/-/m/t/2167086
Hi,
I need to export as .xls tables create in a for loop. In particular, I would like to save the table generated in each cycle in a different worksheet of the same file. Can you help me?Giada P.2021-01-19T02:16:32ZBuild a 3D Self-Driving Car Simulation
https://community.wolfram.com/groups/-/m/t/2137315
## Introduction
In this article we will create a simple driving simulation to train a classifier to autonomously drive a virtual car. Our simulation will consist of a 3D scene composed of a windy road and a single car controller either by the user or the computer. The car will have a camera positioned in front of it to provide an image from its point of view (POV). This point of view image will be used as the input to our classifier to decide how to control the car. During each step of the simulation the car will be allowed to move forward or turn in place left or right.
![enter image description here][1]
## Building the Simulation
### Simulation Graphics
We will begin by creating the graphics functions to assemble and display the simulation. First lets create a texture for the ground. For simplicity we will rasterize a built-in curve containing both left and right turns for the road.
track = Rasterize[
With[{road =
HilbertCurve[2, DataRange -> {{0.25, 1.75}, {0.25, 1.75}}] /.
Line -> BSplineCurve},
Graphics[{
CapForm["Round"],
Gray, AbsoluteThickness[36], road,
Yellow, Dashing[0.033], AbsoluteThickness[2], road
},
PlotRange -> {{0, 2}, {0, 2}},
Background -> RGBColor["#e8e1ba"]
]
]
]
![enter image description here][2]
Next we will define a function to assemble the 3D scene encompassing the ground and car. We will be rendering this scene with two different cameras to provide an overview of the car on the road as well as the car's point of view image.
CarSimScene[sim_] := Module[{ground, car},
ground = {
Texture[track],
EdgeForm[None],
Polygon[
{{0, 0, 0}, {100, 0, 0}, {100, 100, 0}, {0, 100, 0}},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}
]
};
car =
With[{dimensions = {2, 1, 0}},
{Red,
Rotate[
Cuboid[sim["Position"] - dimensions ,
sim["Position"] + dimensions + {0, 0, 1}], sim["Rotation"],
{0, 0, 1},
sim["Position"]
]
}
];
{ground, car}
]
Lastly we need a function to position a camera in the 3D scene at the location of the car to record the point of view image. This image will only be used when classifying, so we rasterize at a relatively low resolution. After some experimentation I chose to use ImageResolution instead of RasterSize because it was over 2x faster to generate the final image. The ViewVector coordinates were determined experimentally to match the typical view from inside a car.
CarPOV[sim_] := Module[{
rotation = sim["Rotation"],
pos = sim["Position"]
},
Rasterize[
Graphics3D[
CarSimScene[sim],
ImageSize -> Small,
ViewVector -> {
sim["Position"] + {2.1 Cos[sim["Rotation"]],
2.1 Sin[sim["Rotation"]], 1.5},
sim["Position"] + {5 Cos[sim["Rotation"]],
5 Sin[sim["Rotation"]], -0.25}
},
ViewAngle -> 1.5,
Boxed -> False,
Background -> LightBlue,
ViewRange -> {0, 0.1}
],
ImageResolution -> 8
]
]
We can now put all of our graphics functions together into a single overarching function that displays the entire car simulation including the 3D scene and an inset from the car's point of view.
DisplayCarSim[sim_] := Module[{},
Overlay[{
Graphics3D[
CarSimScene[sim],
PlotRange -> {{0, 100}, {0, 100}, Automatic},
ImageSize -> Large,
Background -> LightBlue,
Boxed -> False
],
Labeled[
Framed[sim["POV"], FrameMargins -> None, FrameStyle -> Gray,
ImageSize -> Small], "Car POV", LabelStyle -> Gray]
}]
]
### Simulation Internals
With our simulation graphics complete we will proceed to building the functions that step the simulation forward. Our simulation state will be contained in a single association containing properties for the car's position, rotation, and current POV image, along with the history of all previous POV images and their associated actions.
NewCarSim initializes our data model for a new simulation. We allow a parameter to define which direction on the track the car starts from. We will generate training data in the "Forward" direction and then test the trained self-driving car in the opposite direction.
NewCarSim[direction_] := Module[{sim},
sim = If[
SymbolName[direction] == "Forward",
<|"Position" -> {10, 10, 0}, "Rotation" -> 0|>,
<|"Position" -> {90, 14, 0}, "Rotation" -> Pi|>
];
sim["History"] = {};
sim["POV"] = CarPOV[sim];
sim
]
Advancing the simulation is easy, StepCarSim takes a simulation state and action, one of "Up", "Left", or "Right", and moves the car accordingly. Every time the simulation is stepped forward the current car POV image is saved along with the provided action in our history list. At the end of a simulation step a new car POV image is generated.
StepCarSim[sim_, action_] := Module[{},
AppendTo[sim["History"], sim["POV"] -> action];
Switch[
action,
"Left", sim["Rotation"] += 0.05,
"Right", sim["Rotation"] -= 0.05,
"Up",
sim["Position"] += {Cos[sim["Rotation"]], Sin[sim["Rotation"]],
0}
];
sim["POV"] = CarPOV[sim];
sim
];
SetAttributes[StepCarSim, HoldFirst];
Our simulation is nearly complete, now it is time to build the interactive interface which allows a person to drive the car and generate training data.
## Generating Example Training Data
sim = NewCarSim[Forward];
EventHandler[
Style[Dynamic[DisplayCarSim[sim]], Selectable -> False],
{
"LeftArrowKeyDown" :> StepCarSim[sim, "Left"],
"RightArrowKeyDown" :> StepCarSim[sim, "Right"],
"UpArrowKeyDown" :> StepCarSim[sim, "Up"]
}
]
![enter image description here][3]
When I manually drove the car down the length of the entire track, the simulation generated nearly 600 training examples. This data is available in the Supplemental Materials section below if you would prefer not to create your own. Lets take a look at a few of the training examples:
TableForm@RandomSample[sim["History"], 3]
![enter image description here][4]
## Training the Self-Driving Car
Having generated our example data, we are now ready to train a classifier to drive the car!
selfDrivingCar =
Classify[sim["History"], Method -> "LogisticRegression"]
![enter image description here][5]
I chose to specify logistic regression because it provided the best accuracy for a relatively small evaluation time. We can show information about our classifier and see accuracy above 70%. By inspecting the learning curve and accuracy curve it looks like we are approaching a limit to our learning, but could probably still benefit from a few more training examples. Still, with our modest amount of example data, the autonomous car performs well.
Information[selfDrivingCar]
![enter image description here][6]
To preview our self-driving car we will step the simulation one hundred times using our new classifier to drive the car. This only gets us a little ways around the track, but shows the classifier is working.
DynamicModule[{selfDrivingSim = NewCarSim[Backward]},
Print[Dynamic[DisplayCarSim[selfDrivingSim]]];
Do[StepCarSim[selfDrivingSim, selfDrivingCar[selfDrivingSim["POV"]]],
100];
]
![enter image description here][7]
We could increase the number of steps to see the car drive to the end, but due to the relatively slow rendering performance I prefer to pre-render every 5th or 10th frame and assemble those in a Manipulate to easily pan back and forth through time:
selfDrivingSim = NewCarSim[Backward];
frames = Table[
With[{img = Rasterize[DisplayCarSim[selfDrivingSim]]},
Do[StepCarSim[selfDrivingSim,
selfDrivingCar[selfDrivingSim["POV"]]], 5];
img
],
120
];
Manipulate[frames[[t]], {t, 1, Length[frames] - 1, 1}]
![enter image description here][8]
So, how well does our self-driving car work? Quite well as a matter of fact. It can easily make it down the entire track, and stays on the right side of the road too! But what happens if we start the car on the wrong side of the road? Does it get confused? Let's see:
DynamicModule[{selfDrivingSim = NewCarSim[Backward]},
selfDrivingSim["Position"] -= {0, 4, 0};
Print[Dynamic[DisplayCarSim[selfDrivingSim]]];
Do[StepCarSim[selfDrivingSim, selfDrivingCar[selfDrivingSim["POV"]]],
100];
]
![enter image description here][9]
When starting on the wrong side of the road the self-driving car immediately corrects and steers back to the right side! Our car works wonderfully, especially considering the modest training set and limited manual optimization of Classify.
## Conclusion
In conclusion we can use Mathematica to create and render a 3D simulation while also interfacing with its machine learning tools to build a complete end to end experimental system. I hope this example provides some insight into the power of Mathematica's machine learning and graphics capabilities.
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ezgif-6-c4f303fe5f33.gif&userId=11733
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2020-12-13at2.19.25PM.png&userId=2137254
[3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2020-12-13at2.22.36PM.png&userId=2137254
[4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=10103ScreenShot2020-12-13at2.23.23PM.png&userId=2137254
[5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=9171ScreenShot2020-12-13at2.24.29PM.png&userId=2137254
[6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=5376ScreenShot2020-12-13at2.25.22PM.png&userId=2137254
[7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2020-12-13at2.26.30PM.png&userId=2137254
[8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2020-12-13at2.27.13PM.png&userId=2137254
[9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2628correcting-self-driving-car.gif&userId=2137254Dan Bridges2020-12-13T22:43:34ZReduce RAM and CPU usage for Mathematica?
https://community.wolfram.com/groups/-/m/t/2166242
Is there an easy method to permanently reduce the CPU and RAM consumption of Mathematica 11.3?
I would like a 'setting' that is enabled by default.
I am not that sophisticated in programing and I find it tough to write that piece of code to reduce RAM usage.
But I do not want a compromise in Mathematica's features.
Thanks in advance!Code Red2021-01-18T09:41:54ZMaTeX doesn't recognise all Latex symbols?
https://community.wolfram.com/groups/-/m/t/2166448
Question 1: Does MaTeX recognise all symbols
MaTeX["\otimes"] works but MaTeX["\bot"] where \bot is a the perpendicular sign in lateX doesn't work
Question 2: How to write just text in MaTeX?
MaTeX["Theory of everything"] yields *Theoryofeverything* in mathmode without spacing and MaTeX[Theory of everything] yields everythingofTheory without spacing and the words reversed.
Use the follwing code to install Matex:
ResourceFunction["MaTeXInstall"][]
<< MaTeX`Chris Django2021-01-18T11:34:44ZOn Raspberry Pi 2, how do I get beyond the 'Product Activation' dialog?
https://community.wolfram.com/groups/-/m/t/444854
Raspberry Pi 2, Jan 2015 Raspbian image. Launching Mathematica results in a 'Wolfram Product Activation' dialog and I'm asked for an Activation Key. What do I enter at this point so that I can click 'Activate'?Sam Nelson2015-02-19T10:37:50ZCUDA not working on Mathematica 12.2
https://community.wolfram.com/groups/-/m/t/2141352
hello all :)
CUDA is not working on 12.2.
Look at this:
What I am supposed to do ?
I also tried by downloading the CUDA pcklets: change nothing.
I have an NVIDIA RTX 3090 and the drivers are ok.
Thank you foe helping me.
Regards to all,
Jean-MichelJean-Michel Collard2020-12-18T02:04:15ZDensely Connected Convolutional Networks: construction and application
https://community.wolfram.com/groups/-/m/t/2166844
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/738560fc-a66b-45b8-9a30-957d5b5068e1
[Original]: https://www.wolframcloud.com/obj/59f60d36-b055-41bd-9bd5-8d75a14df0c8
[Modified1]: https://www.wolframcloud.com/obj/b4fd2d06-4972-463b-9f83-2e03356b267aSiria Sadeddin2021-01-18T23:09:50ZSurprising Reflections from Cylinder to Cone
https://community.wolfram.com/groups/-/m/t/2167228
![enter image description here][1]
Recognize your favorite snack or beverage in the above pictures? No worry, it is a catoptric- or mirror anamorphosis. These are distorted images that can only be seen undeformed when reflected in a mirror from a prescribed point of view. This contribution will explain how the above and other images are made with the help of Mathematica.
To set up an anamorphic experiment, one needs 3 items: a (curved) mirror, a (deformed) anamorphic surface and a defined point of view.
For the setup here, the **mirror**, where we want the undeformed image reflected, is a chrome plated right cone, also used in a previous experiment "[Optical Illusions and Self-Anamorphism in a Conical Mirror][2]". The **anamorphic surface** , where the deformed image will be, is the wall of a plastic open top right cylinder arranged around the conical mirror. The **point of view** is at infinity on the central axis of both cone and cylinder (the z-axis).
![enter image description here][3]
Let us take a look at the geometry of the setup: (due to the radial symmetry we show only one half of a cross section) the triangle TAO is a cross section of the cone and the line DE is a cross section of the cylinder wall.
![enter image description here][4]
S is a point on the cylinder wall ED. A ray of light emitted by S is reflected by the mirror at Q and meets the eye at V. n is the normal on the cone surface at Q.The eye looks down from V and perceives the point as the point R reflected in the conical mirror. In other words: R is the reflection of S and S is the anamorphic map of R.
The cone has a base radius rk of 30mm and a height hk of 52mm which makes an opening angle of 60 degrees. The surrounding cylinder has a radius rc of 47.5mm.
With the Cartesian coordinates of a point R in the cone's base, the following function computes the coordinates of S in a development along the wall of the cylinder:
anaCone2Cylinder[{xr_, yr_}, rc_ : 47.5] /; xr^2 + yr^2 <= 1800 :=
Module[{rk = 30., \[Alpha] = 30 Degree, ri, ti, ra},
(*polar coordinates of R*){ri, ti} = {Sqrt[xr^2 + yr^2],
ArcTan[xr, yr]};(*ordinatee of the pointS*)
ra = -(rc - ri) Cot[2 \[Alpha]] + (rk - ri) Cot[\[Alpha]]; {rc ti,
ra}]
This shows both domain (left) and range {right) of the function anaCone2Cylinder as a 20 by 20 lines raster. The domain is the base of the cone and the range is the development of the cylinder wall.
![enter image description here][5]
We can now test this function on an image defined by a set of points. A first experiment is to use a club suit letter-form available in Mathematica and convert it to a set of points scaled to fit inside the base of the cone:
clubPts =
5 MeshCoordinates[
BoundaryDiscretizeGraphics[
Text[Style["\[ClubSuit]", Bold]], _Text,
MaxCellMeasure -> 0.1]];
Graphics[{Circle[{0, 0}, 30], AbsoluteThickness[3], Blue,
Line[clubPts]}, Axes -> True, AxesStyle -> Small]
![enter image description here][6]
After applying *anaCone2Cylinder* to the set of points, we get a development of its anamorphic map on the cylinder wall.
anaClbPts = anaCone2Cylinder[#] & /@ clubPts;
Graphics[{AbsoluteThickness[6], Blue,
Line[Select[Partition[anaClbPts, 2, 1],
EuclideanDistance @@ # < 10 &]]}, Axes -> True,
AxesStyle -> Small]
![enter image description here][7]
This is the result of printing the above and fitting it inside the cylinder. The anamorphic print on the cylinder wall reflects as the original (virtual ) image in the base of the conical mirror:
![enter image description here][8]
Circular logos are ideal material to use here since they can completely fill the base of the cone without any "overflow". The following two logos are used here and are in full resolution on the attached notebook "usedLogos.nb"
{wolf, cow} = usedLogos;
![enter image description here][9]
To apply our function anaCone2Cylinder, we need to convert the logo images to a radial set of colored polygons. The function [ImageRadialDivide][10] that I submitted to the Wolfram Function Repository is ideal for this. This is a partial magnification of the wolf logo that shows the radially aligned polygons:
Graphics[ResourceFunction["ImageRadialDivide"][
ImageReflect[wolf, Left]]]
![enter image description here][11]
We then use the same procedure as with the club suit image and get the following cylinder development:
wolfPolys =
ResourceFunction["ImageRadialDivide"][ImageReflect[wolf, Left]];
anaWolfPolys =
wolfPolys /. {x_?NumericQ, y_} -> anaCone2Cylinder[30 {x, y}];
Graphics[anaWolfPolys]
![enter image description here][12]
The result of fitting the printout of the development inside the cylinder and reflecting it in the central mirror:
![enter image description here][13]
The same procedure can be repeated for the "laughing cow" logo to get the following:
cowLogo = ImageReflect[ImageResize[cow, 400], Left];
cowPolys = ResourceFunction["ImageRadialDivide"][cowLogo];
anaCowPolys =
cowPolys /. {x_?NumericQ, y_} -> anaCone2Cylinder[30 {x, y}];
Graphics[anaCowPolys]
![enter image description here][14]
![enter image description here][15]
Finally, here are some more famous logos with their anamorphic deformation (right) and the corresponding reflection (left) in a conical mirror .
![enter image description here][16]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2161logosintroduo.png&userId=68637
[2]: https://community.wolfram.com/groups/-/m/t/2027565
[3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=completesetupsmall.png&userId=68637
[4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=6442geometry.png&userId=68637
[5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=rasteroverview.png&userId=68637
[6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=clubreflectionsmall.png&userId=68637
[7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=clubdevelopmentsmall.png&userId=68637
[8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=clubcombismall.png&userId=68637
[9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=usedlogossmall.png&userId=68637
[10]: https://resources.wolframcloud.com/FunctionRepository/resources/ImageRadialDivide
[11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1352wolfradial.png&userId=68637
[12]: https://community.wolfram.com//c/portal/getImageAttachment?filename=wolfdevelopmentsmall.png&userId=68637
[13]: https://community.wolfram.com//c/portal/getImageAttachment?filename=wolfcombismall.png&userId=68637
[14]: https://community.wolfram.com//c/portal/getImageAttachment?filename=cowdevelopmentsmall.png&userId=68637
[15]: https://community.wolfram.com//c/portal/getImageAttachment?filename=cowcombi.png&userId=68637
[16]: https://community.wolfram.com//c/portal/getImageAttachment?filename=totaloverviewcopy.png&userId=68637Erik Mahieu2021-01-19T08:51:10ZStatistical age determination of tree rings
https://community.wolfram.com/groups/-/m/t/2167532
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Image20210119162952.jpg&userId=20103
[2]: https://www.wolframcloud.com/obj/wolfram-community/Published/tree_rings_3.nbMartin Ricker2021-01-19T13:30:37ZDifference between SetDelayed and Function
https://community.wolfram.com/groups/-/m/t/2164767
I am studying the Wolfram language, and in the [guides][1] I came across the method to define a function, for example:
f[x_] := x^2
Head[f]
(*Symbol*)
Which is nice, `f` is defined just as, for example, `Sin` and `Sqrt` are:
Head[Sqrt] (*Symbol*)
Head[Sin] (*Symbol*)
I also noticed this use of Function, in a guide about Pure Functions:
g=Function[x,x^2]
Head[g]
(*Function*)
What's is the difference between the two? Which one is preferred, and when?
A non similarity, as an example: One can define `f` to accept only `Integer`s:
f[x_Integer] := x^2
But [it is a bit harder][2] to do that for a Pure function.
[1]: https://reference.wolfram.com/language/tutorial/FunctionsAndPrograms.html
[2]: https://mathematica.stackexchange.com/questions/3174/Ehud Behar2021-01-16T14:25:17Z