Community RSS Feed
https://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions from all groups sorted by activeIs v. 13.2.1 unstable?
https://community.wolfram.com/groups/-/m/t/2918885
It seems to me that v 13.2.1 is buggy
I have suffered A LOT of various indignities. Lots of "Why the Beep?" messages, files that cannot be saved, files that save but cannot be opened, files that open with one cell corrupted. This is WAY more than what I am used to seeing with an upgrade. I am thinking of rolling back to 13.2.0
Before I do that I would like to know if anyone else has had this experienceRoger J Brown2023-05-12T17:02:27ZHow do I select nested lists?
https://community.wolfram.com/groups/-/m/t/2927162
This is a list manipulation question. For context, `FinancialData[“name”,”prop”,{start,end}]` returns a list with nested elements. For example,...
&[Wolfram Notebook][1]
...are dividends paid by General Electric over that period.
What is the best way to select ranges within the list, say the date-dividend elements during 1 Dec 2020 to 31 August 2021? In other words, to get... {{{2020, 12, 18}, 0.08}, {{2021, 3, 5}, 0.08}, {{2021, 6, 25}, 0.08}}?
Those examples are small to simplify my question. An obvious answer is repeated calls to FinancialData[]. But I'm sure I can avoid that inefficiency if I understand more about list manipulation in Mathematica. If you answer with a code example, I might need some explanation with it.
[1]: https://www.wolframcloud.com/obj/fe445d19-b08d-42b2-b587-15144b5fc183Jay Gourley2023-05-29T17:25:11ZWhy does the input DSolver returns the output Dsolve without error warnin
https://community.wolfram.com/groups/-/m/t/2927198
I am using a Mathematica package for the below.
Inputs are:
LXi = {Xi[1][r, t], Xi[2][t]};
LPhi = {f[r, t] u + g[r, t]};
EDsI = SubstInfinitesimals[EDs, LXi, LPhi]
Outputs are:
{0, 0, 0, 0, 1/2 \[Sigma]^2 Xi[1][r, t] + 1/2 r \[Sigma]^2 Derivative[1][Xi[2]][t] - r \[Sigma]^2 \!\(\*SuperscriptBox[\(Xi[1]\),
TagBox[ RowBox[{"(", RowBox[{"1", ",", "0"}], ")"}], Derivative], MultilineFunction->None]\)[r, t], -r u f[r, t] - r g[r, t] - v Xi[1][r, t] - r v Derivative[1][Xi[2]][t] + u \!\(\*SuperscriptBox[\(f\), TagBox[ RowBox[{"(",
RowBox[{"0", ",", "1"}], ")"}], Derivative], MultilineFunction->None]\)[r, t] + \!\(\*SuperscriptBox[\(g\),
TagBox[ RowBox[{"(", RowBox[{"0", ",", "1"}], ")"}], Derivative], MultilineFunction->None]\)[r, t] + u^2
\!\(\*SuperscriptBox[\(f\), TagBox[ RowBox[{"(", RowBox[{"1", ",", "0"}], ")"}], Derivative]
The one below there is no evaluation whatsoever nor error. Why is the case?
Input: EDsI[[7]]
Input: DSolve[EDsI[[7]] == 0, (* Xi[2],{t} *) Xi[2][t], t] (* This operation will make f[x,t] the subject of the \formula *)
Output: DSolve[ -Derivative[1][h][t] + 1/2 u[x, t] Derivative[1][Xi[2]][t] - 1/2 \[Alpha] \[Lambda][x, t] Derivative[1][Xi[2]][t] + 1/2 r \[Beta] \[Lambda][x, t] Derivative[1][Xi[2]][t] - 1/2 x (Xi[2]^\[Prime]\[Prime])[t] + Xi[2][t] \!\(\*SuperscriptBox[\(u\), TagBox[RowBox[{"(", RowBox[{"0", ",", "1"}], ")"}],Derivative],
MultilineFunction->None]\)[x, t] - \[Alpha] Xi[2][t] \!\(\*SuperscriptBox[\(\[Lambda]\), TagBox[
RowBox[{"(", RowBox[{"0", ",", "1"}], ")"}],Derivative], MultilineFunction->None]\)[x, t] +
r \[Beta] Xi[2][t] \!\(\*SuperscriptBox[\(\[Lambda]\), TagBox[RowBox[{"(", RowBox[{"0", ",", "1"}], ")"}],Derivative],MultilineFunction->None]\)[x, t] + h[t] \!\(\*SuperscriptBox[\(u\), TagBox[ RowBox[{"(", RowBox[{"1", ",", "0"}], ")"}], Derivative], MultilineFunction->None]\)[x, t] +
1/2 x Derivative[1][Xi[2]][t] \!\(\*SuperscriptBox[\(u\), TagBox[RowBox[{"(", RowBox[{"1", ",", "0"}], ")"}],Derivative], MultilineFunction->None]\)[x, t] - \[Alpha] h[t] \!\(\*SuperscriptBox[\(\[Lambda]\), TagBox[RowBox[{"(", RowBox[{"1", ",", "0"}], ")"}],Derivative],
MultilineFunction->None]\)[x, t] + r \[Beta] h[t] \!\(\*SuperscriptBox[\(\[Lambda]\), TagBox[RowBox[{"(", RowBox[{"1", ",", "0"}], ")"}],Derivative],MultilineFunction->None]\)[x, t] -
1/2 x \[Alpha] Derivative[1][Xi[2]][t] !\(\*SuperscriptBox[\(\[Lambda]\), TagBox[RowBox[{"(",
RowBox[{"1", ",", "0"}], ")"}],Derivative],MultilineFunction->None]\)[x, t] +
1/2 r x \[Beta] Derivative[1][Xi[2]][t] \!\(\*SuperscriptBox[\(\[Lambda]\), TagBox[RowBox[{"(", RowBox[{"1", ",", "0"}], ")"}],Derivative],
MultilineFunction->None]\)[x, t] == 0, Xi[2][t], t]
May you please advise further.
Thank you.Nomsa Ledwaba2023-05-29T20:11:12ZSolving optimization problem with matrix variable
https://community.wolfram.com/groups/-/m/t/2926898
Hello all,
I have been working on an optimization problem with a matrix variable in Mathematica, but I haven't managed to get a numerical solution, as I am receiving some error messages. Below is a simple example representing my code:
```
Xrs1 = RandomReal[{0, 1}, {10, 3}];
Xrs2 = RandomReal[{0, 1}, {40, 3}];
Xdr2 = RandomReal[{-5, 5}, {40, 2}];
d = DistanceMatrix[Xrs1, Xrs2];
dr[Xdr1_] := DistanceMatrix[Xdr1, Xdr2];
f[Xdr1_] := Total[(dr[Xdr1] - d)^2, 2];
FindMinimum[f[Xdr1], {Xdr1, ConstantArray[0., {10, 2}]}]
```
I receive several errors, despite the fact that the function `f` works perfectly with the initial solution or any other numerical matrix with that dimensions.
I would appreciate any help.
Thank you in advance for your time and support.David G. Aragonés2023-05-29T08:53:25ZUnexpected result from FourierTransform?
https://community.wolfram.com/groups/-/m/t/2925582
I have try to do a Fourier tranform with Mathematica for θ(t1^2 + t2^2 + t3^2 - a)， where a>0 and θ(x) is the Heaviside theta function. It seems that the Mathematica gave an incorrect answer. The code was,
FourierTransform[
HeavisideTheta[t1^2 + t2^2 + t3^2 - a], {t1, t2, t3}, {ω1, ω2, ω3},
Assumptions -> a > 0]
and the result gaven by Mathematica was (2π)^(3/2) δ(ω1) δ(ω2) δ(ω3). However, as definition, the Fourier transform for θ(t1^2 + t2^2 + t3^2-a) is,
![enter image description here][1]
where **ω**={ω1,ω2,ω3}.
The last item of I2(**ω**) is not zero. I'd like to know from which the problem arisen.
Thank you very much for your help.
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=10139FT2Theta.png&userId=2446077Jianhua Yang2023-05-26T07:11:01ZInconsistent result with inverse function in Wolfram Alpha?
https://community.wolfram.com/groups/-/m/t/2926762
Sorry to flag something that may seem obvious, but I have tried these two inverse function with inconsistent result:
A. inverse exp( -exp(-(x-a)/b)) results in a - b log(-log(x))
while...
B. inverse exp( -exp(-(x-u)/g)) results in x + g log(-log(u))
Observe the variable a=u and b=g placements.
Did I miss something here? Thank you for any help given.Budana P2023-05-29T05:26:48ZError solving convection-diffusion equation with continuity equation
https://community.wolfram.com/groups/-/m/t/2916823
I'm trying to resolve the convection-diffusion equation coupled with the continuity equation. I wrote this next code
A = 4;
h = 190;
Media = -60*h/190;
DesEst = 0.15*h;
Distribucion = A*PDF[SkewNormalDistribution[Media, DesEst, -5], x];
d1 = 17;
s3 = NDSolve[{D[c[x, t], t] - d1*D[c[x, t], x, x] +
V[x]*D[c[x, t], x] == 0, c[x, t]*D[V[x], x] == 0,
c[x, 0] == Distribucion,
c[-10*DesEst, t] == Distribucion /. x -> -10*DesEst,
DirichletCondition[V[x] == V[5000], x == -10*DesEst],
Derivative[1, 0][c][-10*DesEst, t] == 0}, {c[x, t],
V[x]}, {x, -10*DesEst, 5000}, {t, 0, 70}]
But I received the next message
NDSolve::overdet: There are fewer dependent variables, {c[x,t]}, than equations, so the system is overdetermined.
I don't understand what's the problem if I'm declaring c and V like dependent variables to resolve. Does anybody know how to fix it?Osmart Ochoa2023-05-09T04:54:50ZHow to display tubes more efficiently in 13.2?
https://community.wolfram.com/groups/-/m/t/2920496
To render outputs of some of the methods I use i need display large amounts of [Lines and Tubes][1]. This had some issues before but are now all fixed ([here][2], [here][3], and [here][4]). In my application I can easily generate 0.5M tracts and subsample them for display. For the type of images I need between 5k and 10k Lines or Tubes to be drawn.
Other considerations are:
- The tract coordinates are isotropic and different from the display coordinates
- The display coordinates are anisotropic (but i want the tubes to be round ->Scale)
- Tracts are colored for their local orientation
- Each tract can have a different length but a fixed step size
With 13.2 Generating some tracts with color and defining the Graphics primitives goes very fast and is very straight forward.
When you ask for display the troubles start. As far as i can see the frontend (but not the kernel) is doing some very big computations since CPU is at 50% for most of the wait time. The copying to the GPU is almost instant and once in GPU memory its smooth sailing.
For Lines this generally no problem and displaying 10k lines takes around 5-6s ( both on mac and windows) to display. Once on screen the GPU takes over and rotation is very smooth. For Tubes, 1k is OKish, however drawing only 2k can take up to 60s and if I increase to 4k waiting times are between 90 to 120s. But more annoying drawing can the also cause the frontend to crash (1 out of 4 times, see image) and in some cases even crash my display divers. Again once displayed (if successful) all is very smooth.
I have attached a notebook with some code. I'm curious if anyone can reproduce my problems and more important if anyone has some ideas about making displaying tubes more workable.
&[Wolfram Notebook][5]
![enter image description here][6]
![enter image description here][7]
![enter image description here][8]
[1]: https://community.wolfram.com/groups/-/m/t/2283047
[2]: https://community.wolfram.com/groups/-/m/t/2280594?p_p_auth=lDo6qe0w
[3]: https://community.wolfram.com/groups/-/m/t/2534605?p_p_auth=lDo6qe0w
[4]: https://community.wolfram.com/groups/-/m/t/2591464?p_p_auth=lDo6qe0w
[5]: https://www.wolframcloud.com/obj/cec2cf87-3987-465d-9033-2c579be58408
[6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=8513crash.png&userId=1332602
[7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=tr1.png&userId=1332602
[8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=tr4.png&userId=1332602Martijn Froeling2023-05-16T12:57:01ZHandwritten recognition and analysis
https://community.wolfram.com/groups/-/m/t/2091085
This post is based on the presentation given in Wolfram Technology Conference. Main team of that work is me, [Davit Baghdasaryan][1], and [Maria Sargsyan][2].
The Supporting data and images files will be attached to this post once they are ready. Please, once you get these files, put them in the same folder with the notebook embedded below so that the initialization cell at the bottom of the notebook can import them.
&[Wolfram Notebook][3]
[1]: https://community.wolfram.com/web/davitb
[2]: https://community.wolfram.com/web/marias
[3]: https://www.wolframcloud.com/obj/b8e3d207-9020-4b7c-96e3-81d1346a78baMikayel Egibyan2020-10-08T17:06:55ZFinancialData
https://community.wolfram.com/groups/-/m/t/2925852
Hi,
I know how to use
DateListPlot[FinancialData["ANSS", "Price", {{2023, 1, 1}, {2023, 5, 26}}],
Filling -> Axis]
Now, suppose I am looking for the Fund
Pictet Security R EU LU0270905242.
How can I use DateListPlot[FinancialData[ ...., {{2023, 1, 1}, {2023, 5, 26}}],
Filling -> Axis] ?
Thank youGianfranco Zosi2023-05-27T06:49:12ZAdding arrows in a smooth curve?
https://community.wolfram.com/groups/-/m/t/2592242
How to put arrows in a closed curve?Emy pena2022-08-04T18:09:35ZEffect of Dimerization on Vapor Liquid Equilibrium of Binary Systems
https://community.wolfram.com/groups/-/m/t/2926718
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/372e822b-3034-4e24-a14d-1cf505ce4ca1Housam Binous2023-05-29T04:39:02ZA Lecture about Wave Equations
https://community.wolfram.com/groups/-/m/t/2926708
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/4f972c96-7da1-4a28-b49d-5987a5e15a8eAthanasios Paraskevopoulos2023-05-28T19:51:07ZWeierstrass Periods after Fricke-Klein
https://community.wolfram.com/groups/-/m/t/2926119
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/097e605c-1698-4fdd-a434-245cc5de9716Brad Klee2023-05-26T20:20:40ZSol LeWitt Conceptual Art
https://community.wolfram.com/groups/-/m/t/2926699
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/141b39e4-1f90-4d21-923e-342ec077374fOliver Seipel2023-05-28T19:19:49ZHow to prove Simson Line Theorem in Descarta2D?
https://community.wolfram.com/groups/-/m/t/2716207
This is what I have created so far
<<Descarta2D`
a := 4
b := 5
c := 8
`pA = Point2D[{a, b}]`
`pB = Point2D[{0, 0}]`
`pC = Point2D[{c, 0}]`
`tABC = Triangle2D[pA, pB, pC]`
`cABC = Circle2D[tABC, Circumscribed2D]`
`pP = Point2D[{7.5, 4}]`
`sBP = Segment2D[{0, 0}, {7.5, 4}]`Ale Alexa2022-12-04T20:05:34ZThe Four Color Theorem and Applications to Maps, Graphs and Vertex Coloring
https://community.wolfram.com/groups/-/m/t/2922067
&[Wolfram Notebook][1]
&[Wolfram Notebook][2]
&[Wolfram Notebook][3]
&[Wolfram Notebook][4]
&[Wolfram Notebook][5]
&[Wolfram Notebook][6]
[1]: https://www.wolframcloud.com/obj/20a4f830-5d71-4e38-a9cf-96e9e626e3c6
[2]: https://www.wolframcloud.com/obj/d4531a55-c129-412c-8731-0569c0e8be34
[3]: https://www.wolframcloud.com/obj/e4d59b34-822b-49c1-8da7-505bc1ddcb78
[4]: https://www.wolframcloud.com/obj/d43fa542-b9e0-4cc3-b71c-a6425df58de1
[5]: https://www.wolframcloud.com/obj/5e91e77f-d9c5-4d31-bb2e-51ec6cd221a5
[6]: https://www.wolframcloud.com/obj/7ef15939-323a-4626-9be3-ea630b1cd77fPeter Burbery2023-05-19T14:59:42Z[EIWL] Solving Example 6.10 of the Stephen Wolfram book
https://community.wolfram.com/groups/-/m/t/914924
Hi all.
I am working my way through the exercises on this page:
https://www.wolfram.com/language/elementary-introduction/06-making-tables.html
However I am stuck on Q. 6.10: Make a list line plot of the first digits of the first 100 squares.
IntegerDigits[Range[100]^2]
results in:
{{1},{4},{9},{1,6},{2,5},{3,6},{4,9},{6,4},{8,1},{1,0,0},{1,2,1},{1,4,4},{1,6,9},{1,9,6},{2,2,5},{2,5,6},{2,8,9},{3,2,4},{3,6,1},{4,0,0},{4,4,1},{4,8,4},{5,2,9},
{5,7,6},{6,2,5},{6,7,6},{7,2,9},{7,8,4},{8,4,1},{9,0,0},{9,6,1},{1,0,2,4},{1,0,8,9},{1,1,5,6},{1,2,2,5},{1,2,9,6},{1,3,6,9},{1,4,4,4},{1,5,2,1},{1,6,0,0},{1,6,8,1},
{1,7,6,4},{1,8,4,9},{1,9,3,6},{2,0,2,5},{2,1,1,6},{2,2,0,9},{2,3,0,4},{2,4,0,1},{2,5,0,0},{2,6,0,1},{2,7,0,4},{2,8,0,9},{2,9,1,6},{3,0,2,5},{3,1,3,6},{3,2,4,9},
{3,3,6,4},{3,4,8,1},{3,6,0,0},{3,7,2,1},{3,8,4,4},{3,9,6,9},{4,0,9,6},{4,2,2,5},{4,3,5,6},{4,4,8,9},{4,6,2,4},{4,7,6,1},{4,9,0,0},{5,0,4,1},{5,1,8,4},{5,3,2,9},
{5,4,7,6},{5,6,2,5},{5,7,7,6},{5,9,2,9},{6,0,8,4},{6,2,4,1},{6,4,0,0},{6,5,6,1},{6,7,2,4},{6,8,8,9},{7,0,5,6},{7,2,2,5},{7,3,9,6},{7,5,6,9},{7,7,4,4},{7,9,2,1},
{8,1,0,0},{8,2,8,1},{8,4,6,4},{8,6,4,9},{8,8,3,6},{9,0,2,5},{9,2,1,6},{9,4,0,9},{9,6,0,4},{9,8,0,1},{1,0,0,0,0}}
Now I would like to count the length of individual elements in the above list ie. {1,1,1,2,2,2,2,2,2,3,3,3....}. But how?
Thanks in advance.
D
EDIT: This is not homework. I am self-learning Mathematica, and will be doing all the exercises in all 47 Chapters, which will probably take me a few weeks to a few months. Hence you may see me asking lots of questions in this forum! :)D P2016-08-28T00:43:53ZCaputo fractional derivative for unknown functions
https://community.wolfram.com/groups/-/m/t/2926407
Hi All,
I wanted to find the Caputo derivative of an unknown function but I could not find its symbolic representation. Since the ordinary derivative of an unknown function f[t] is f'[t] or f''[t]... in Mathematica but the Caputo derivative of an unknown function f[t] is not behaving like that, it should be f^(\alpha)[t], f^(2*\alpha)[t]... In my attached code, you can check it is directly obtained the definition of Caputo derivative. Please guide me on what I am doing wrong, I should use any other definition of the Caputo derivative or what? Please guide me, anyone. I also attached the definition of the Caputo derivative.
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/9ad921de-fb0a-4edc-bd50-0fc7d52bd5a4Muhammad Aamir2023-05-27T14:19:22ZNumberform usage
https://community.wolfram.com/groups/-/m/t/2925626
I am a new user, trying to learn the basics of Mathematica.
I defined x as x = {1, 2, 4, 6, 7, 49.999999}
When I try to use NumberForm to give a specified # of decimal places, it doesn't do what expect (display each result to the specified # of decimals),the function according to the documentation. See attached example 1.
Out[78] shows the input as a column. This is as expected.
I expect Out[82] to have decimal format for all values of x. It doesn't. What am i missing in the usage of NumberForm?
In example 2, only one value in Out[69] is shown with decimal value. Why?
Thx,
LPLouis Poulo2023-05-26T00:07:25ZBriggs-Rauscher Mechanism
https://community.wolfram.com/groups/-/m/t/2926243
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/76a76f9c-9d50-4629-9e0e-4894a4f65c12Housam Binous2023-05-27T09:48:20ZSeveral Mathematica keyboard shortcuts don't work
https://community.wolfram.com/groups/-/m/t/2847412
I have an Estonian keyboard layout and some keyboard shortcuts don't work, e.g. "Inline Free-form Input Ctrl+=" or "Un/Comment Selection Alt+/" (these shortcuts are the ones written in the menu). The computer has Windows 10, Mathematica 13.2.1.0.
To try to insert "Ctrl+=", I press Ctrl+Shift+0 on my keyboard layout (since Shift+0 gives me =, see the layout below), but nothing happens. If I use this command from the Insert menu (by clicking on it) it works fine, or if I set the Windows keyboard layout to US English and push the corresponding US layout keys instead (so some other physical keys on my keyboard), it works (also pushing the same physical keys I used for the US layout while on the Estonian layout they don't work).
To un/comment I try to insert "Alt+/", so I press Alt+Shift+7, but also nothing happens (I removed the shortcut for Format->Style CodeText, because the shortcut for that was also Alt+Shift+7).
However, at the same time some other shortcuts work, i.e. insert "Fraction Ctrl+/" works when I press Ctrl+Shift+7, also Format->Style "Larger Alt+=" works if I press Alt+Shift+0.
Does anyone know why some shortcuts with / or = work and others don't on my keyboard layout?
![Estonian keyboard layout][1]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=KB_Estonian.svg.png&userId=2847295Andy P2023-03-08T10:47:03ZColor accessible Front End appearance in Mathematica
https://community.wolfram.com/groups/-/m/t/2926319
Since this community encourages discussions, I post this in hopes of furthering the occasional interest shown in color accessibility. There were two WSS22 projects on it [[(1)](https://community.wolfram.com/groups/-/m/t/2581021), [(2)](https://community.wolfram.com/groups/-/m/t/2580694)], and there's [old 2017 post](https://community.wolfram.com/groups/-/m/t/1278303) that contains code for analyzing color accessibility that unfortunately relies on internal data that is no longer present in Mathematica.
Some time ago I had a color-blind student, and it made me think about producing color-accessible notebooks for class. Somewhere I found the Okabe-Ito color scheme among other things. I copy-pasted the table below from some web site, long-forgotten I'm sorry to say. In any case, from time to time, such at the beginning of the COVID pandemic, I'd look further into color accessibility. I usually ended somewhat frustrated. There are a number of tools for simulating and measuring color accessibility. Unfortunately they tend to disagree. One is warned how difficult it is and of mistakes commonly made. Web sites tend not to be dated or have a log of when they are updated. Almost everyone says, in effect, "I know what I'm doing. Others might, or might not; so just believe me." But which one do you choose. So I find it difficult to find authoritative and reliable information. I hope it's out there, and I hope someone knows it. I'm sure it's simple once you have a trustworthy source.
I don't know what I'm doing really. I'm sort of a weekend hobbyist. I'm sure someone with background in design and color accessibility could do a much better job much more quickly. I put together a color scheme for the items in the Appearance panel of the Preferences dialog. It's easy to load. It's easy to reset (there's a reset button in the Preferences dialog). Or you could save your current preferences and use them to reset. See below for more.
I based the colors on the Okabe-Ito palette:
$okabeItoData = Internal`PartitionRagged[#, {3, 3, 1, 4}] & /@
Partition[
{"R,G,B (0-255)", , , "R,G,B (0-1)", , , "Hex", "C,M,Y,K (%)", , , ,
0, 0, 0, 0, 0, 0 , "#000000", 0, 0, 0, 100,
230, 159, 0, 0.902, 0.624, 0, "#E69F00" , 0, 50, 100, 0,
86, 180, 233, 0.337, 0.706, 0.914, "#56B4E9", 80, 0, 0, 0,
0, 158, 115, 0, 0.620, 0.451 , "#009E73", 97, 0, 75, 0,
240, 228, 66, 0.941, 0.894, 0.259, "#F0E442", 10, 5, 90, 0,
0, 114, 178, 0, 0.447, 0.698, "#0072B2" , 100, 50, 0, 0,
213, 94, 0, 0.835, 0.369, 0, "#D55E00", 0, 80, 100, 0,
204, 121, 167, 0.8, 0.475, 0.655, "#CC79A7", 10, 70, 0, 0},
11];
$okabeItoColors = RGBColor @@@ $okabeItoData[[2 ;;, 2]]; (* Drop Black *)
$okabeItoColorsDiverging = $okabeItoColors[[{1, 4, 6, 3, 5, 2, 7, 8}]]
{RGBColor[0, 0, 0], RGBColor[0, 0.62`, 0.451`],
RGBColor[0, 0.447`, 0.698`], RGBColor[0.337`, 0.706`, 0.914`],
RGBColor[0.941`, 0.894`, 0.259`], RGBColor[0.902`, 0.624`, 0],
RGBColor[0.835`, 0.369`, 0], RGBColor[0.8`, 0.475`, 0.655`]}
I tweaked some of them as I built the color scheme. I used [Color Oracle](https://colororacle.org) to evaluate a scheme under the different types of colorblindness. As I said above, I don't know how reliable this tool is, but it is semi-easy to use. At some point, my sensibilities get burned out and I think any difference in color is a good difference. Later I'll wonder, why did I think that would be acceptable. There are lots of combinations that could be checked, and I don't have a good plan for systematically evaluating a change. I'm sharing here in case someone wants to pick up the ball and run with it. I don't think I can get a good result by myself.
Deuteranopia (a form of red-green) colorblindness is the most common. So one should avoid red and green meaning different things (see the default debugger highlighting for the worst possible example). Red is used extensively, since it is a traditional warning signal; however, it is not a particularly good color-accessible one. `Magenta` seems better to me, but I don't know how it appears to a colorblind person used to seeing red warnings and dealing with the world 24/7, year-in and year-out, in their normal way.
I substituted the red-brown Okabe-Ito color for the red in many of the Wolfram-Language preferences. Because I'm not red-green colorblind and that seemed a natural choice to. But it might not seem a good choice to a colorblind person. In one case, `"SyntaxErrorStyle"`, I used magenta, just to see and to show it. I rather liked the magenta instead of red, but, as I said, I'm not colorblind.
Here are the colors for reference, including an image of them under the deuteranopia filter of Color Oracle.
Append[$okabeItoColorsDiverging, RGBColor[1, 0.2, 1]]
![enter image description here][1]
Here is a preference set for colors that seem to show differences for all three types of colorblindness, where there are significant differences in the defaults. Many of the default preference colors are are the same or nearly the same.
cvdpreferences = {
AutoStyleOptions -> {
"EmphasizedSyntaxErrorStyle" -> {FontColor -> RGBColor[
0.936263065537499, 0.7788662546730755, 0.42481116960402837`],
Background -> RGBColor[1, 0.86, 0.86]},
"ExcessArgumentStyle" -> {FontColor -> RGBColor[
0.7864194705119402, 0.28537422751201647`, 0.02021820401312276]},
"FunctionLocalVariableStyle" -> {FontColor -> RGBColor[
0.24643320363164722`, 0.5645075150682841, 0.7797360189211872]},
"GlobalToLocalScopeConflictStyle" -> {FontColor -> RGBColor[
0.7864194705119402, 0.28537422751201647`, 0.02021820401312276]},
"GraphicsCompatibilityProblemStyle" -> {FontColor -> RGBColor[
0.7864194705119402, 0.28537422751201647`, 0.02021820401312276]},
"HighlightSyntaxErrors" -> True,
"LocalScopeConflictStyle" -> {FontColor -> RGBColor[
0.7864194705119402, 0.28537422751201647`, 0.02021820401312276]},
"LocalVariableStyle" -> {FontColor -> RGBColor[
0.07412832837415122, 0.5640497444113832, 0.37123674372472726`]},
"MissingArgumentStyle" -> {FontColor -> RGBColor[
0.7864194705119402, 0.28537422751201647`, 0.02021820401312276]},
"MisspelledWordStyle" -> {FontColor -> RGBColor[0.76, 0.33, 0.8]},(*?*)
"NoKernelPresentStyle" -> {FontColor -> RGBColor[0., 0., 0.4]},(*?*)
"OrderOfEvaluationConflictStyle" -> {FontColor -> RGBColor[
0.7864194705119402, 0.28537422751201647`, 0.02021820401312276]},
"PatternVariableStyle" -> {FontColor -> RGBColor[
0.26300450141145953`, 0.5369954985885405, 0.3450064850843061],
FontSlant -> "Italic"},
"StringStyle" -> {FontColor -> GrayLevel[0.4],(*?*)
ShowAutoStyles -> False, ShowSyntaxStyles -> False,
AutoNumberFormatting -> False,
TranslationOptions -> {"Enabled" -> False}},
"StructureOperatorStyle" -> {FontColor -> GrayLevel[0.6]},(*?*)
"SymbolShadowingStyle" -> {FontColor -> RGBColor[
0.7864194705119402, 0.28537422751201647`, 0.02021820401312276]},
"SyntaxErrorStyle" -> {FontColor ->(**)RGBColor[1, 0.2, 1]},
"UndefinedSymbolStyle" -> {FontColor -> RGBColor[
0.04228274967574579, 0.36310368505378804`, 0.637293049515526]},
"UnknownOptionStyle" -> {FontColor -> RGBColor[
0.7864194705119402, 0.28537422751201647`, 0.02021820401312276]},
"UnwantedAssignmentStyle" -> {FontColor -> RGBColor[
0.7520408941786831, 0.7086594949263753, 0.15410086213473717`]}},
CodeAssistOptions -> {
"HeadHighlightStyle" -> {Background -> RGBColor[
0.9600366216525521, 0.9452811474784466, 0.5678950179293507]},
"MatchHighlightStyle" -> {Background -> RGBColor[
0.936263065537499, 0.7788662546730755, 0.42481116960402837`]}},
DebuggerSettings -> {
"BreakpointStyle" -> {FontColor -> RGBColor[
0.7864194705119402, 0.28537422751201647`, 0.02021820401312276]},
"EvaluatorPositionHighlightStyle" -> {Background -> RGBColor[
0.27710383764400703`, 0.6434729533836882, 0.8960097657740139]},
"StackHighlightStyle" -> {FontColor -> RGBColor[
0.27710383764400703`, 0.6434729533836882, 0.8960097657740139]}}
};
![enter image description here][2]
Here's how to set the preferences:
SetOptions[$FrontEnd, cvdpreferences]
If you have made changes to your own preferences, they will show up in `Options[$FrontEnd]`. To get back your own preferences, save them (`myopts = Options[$FrontEnd]`), reset the preferences in the Appearance panel of the Preferences dialog, and then restore your preferences `SetOptions[$FrontEnd, myopts`.
If someone knows whether these options can be controlled through a stylesheet, that would give an alterative method for implementation.
I had thought that maybe by now \[LongDash] maybe soon \[LongDash] support for color accessibility would be built into Mathematica and WL. Highlighting in the Front End is just a piece of it. As you can tell, I offer my color scheme tentatively. If I've done it all wrong, I hope someone will do it all right.
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7349Untitled.png&userId=53587
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=4280Untitled.png&userId=53587Michael Rogers2023-05-27T02:25:30ZNielsen finite product forms using Mathematica
https://community.wolfram.com/groups/-/m/t/2926229
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/09ff3d24-d012-49b6-847a-c6479d62a25dRobert Reynolds2023-05-27T02:24:21Z[WSG23] Daily Study Group: Wolfram for Mathematics Research and Study
https://community.wolfram.com/groups/-/m/t/2914219
A Wolfram U daily study group covering the implementation of Mathematica and Wolfram Language for mathematics topics ranging from function visualization to upcoming calculus functionality begins on May 22, 2023 and runs through June 1. This study group will run on weekdays from 11:00AM–12:00PM Central US time. (We will not meet on Memorial Day, May 29, and Friday sessions will start at 10:30AM for extra review time.)
> [**REGISTER HERE**][1]. I hope to see you there!
This study group is a fantastic way to learn about the amazing mathematical capabilities built into Wolfram Language. We will cover a *very* broad variety of topics, including but not limited to function visualization, linear algebra and graph theory, differential equations and even fascinating topics such as number theory and asymptotics. Several sessions will be led by the Wolfram developers who work on the mathematics functionality that we'll be covering!
While this study group is aimed at mathematics students at roughly the graduate level, **no prior Wolfram Language experience is necessary**—the first day will be dedicated to getting you up to speed with the language itself. As usual, we will have questions, study materials, quizzes along the way to help you master the subject matter and functionality.
![enter image description here][2]
[1]: https://www.bigmarker.com/series/daily-study-group-math-research-wsg40/series_details?utm_bmcr_source=community "REGISTER HERE"
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=WolframUBanner%281%29%281%29.jpg&userId=1711324Arben Kalziqi2023-05-03T23:07:29ZComputation of the Bifurcation Diagram for the Three-Variable Autocatalator
https://community.wolfram.com/groups/-/m/t/2925998
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/331f466f-9901-498d-9fc6-00610c892d78Housam Binous2023-05-26T19:45:33ZIntegration by parts for rookies
https://community.wolfram.com/groups/-/m/t/2925829
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/f7ce6d24-6cc1-4cae-a1a6-286dedc8b355Oliver Seipel2023-05-26T18:44:06ZHow to Use GPT2 Transformer for FeatureExtraction
https://community.wolfram.com/groups/-/m/t/2925480
I've been reading the documentation about ***GPT2 Transformer Trained on WebText Data***.
I noticed that it can perform 2 tasks and one of then is FeatureExtraction.
> lm = NetModel[{"GPT2 Transformer Trained on WebText Data", "Task"
> -> "FeatureExtraction"}]
However, there are no examples on how to use it for Feature Extraction. I will appreciate an example or hints on how to use it for this purpose.Dalila Benachenhou2023-05-26T14:42:50ZHow to Mix Different Fluids in System Modeler
https://community.wolfram.com/groups/-/m/t/2920954
I am trying to mix 2 different fluids in a system. Gas should be injected through a valve into another pipe that contains oil, and the result will have a mixture of oil and gas, just like this image:
![enter image description here][1]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=5-gas-lift-valve.jpg&userId=2920921
However, System modeler keeps giving me errors. How do I do this?Fayez Abu-Ajamieh2023-05-17T13:53:55ZParallelEvualate using very little CPU time.
https://community.wolfram.com/groups/-/m/t/2925419
I want to test if for any prime n > 3, that (n+1)(n-1) is not divisible by 24. I want it to execute it on all cores. I have this code, which is virtually the same as one of the examples in the documentation,
https://reference.wolfram.com/language/ref/ParallelEvaluate.html
under "Neat Examples" which checks if n! + 1 is prime.
Whilst Mathematics is launching multiple kernels, the "top" command on linux shows one of them is using about 75% of the CPU time, and the others about 1%. All kernels except one run for 8 to 10 seconds. The top command on this machine is configured such that percentages are based on the individual cores, not the sum of all cores, so the sum of the CPU times should far exceed 100%.
ParallelEvaluate[$RecursionLimit = 500]
n = 1; primes = {}; SetSharedVariable[n, primes];
PrintTemporary[Dynamic[{n, primes}]];
CheckAbort[
ParallelEvaluate[While[True,
With[{n = n++},
If[Mod[(Prime[n] + 1) (Prime[n] - 1), 24] != 0 ,
AppendTo[primes, n]]]]],
{n, primes}]
Here's the output from top. The load average of the computer is 1.55, which is pretty low. A serial version of the code would run faster. Can anyone suggest a better way to do this, which will make more use of multiple cores?
top - 00:02:11 up 9:49, 1 user, load average: 1.55, 1.48, 1.78
Tasks: 717 total, 4 running, 713 sleeping, 0 stopped, 0 zombie
%Cpu(s): 2.7 us, 0.5 sy, 0.0 ni, 96.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 385596.8 total, 372310.2 free, 8849.1 used, 4437.5 buff/cache
MiB Swap: 2048.0 total, 2048.0 free, 0.0 used. 374307.1 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
40619 drkirkby 20 0 5541304 172432 72212 R 66.3 0.0 3:28.18 WolframKernel
15761 drkirkby 20 0 4811860 904880 225976 S 17.9 0.2 21:24.35 firefox
31080 drkirkby 20 0 3942452 261308 132848 S 15.2 0.1 3:16.16 Mathematica
38667 drkirkby 20 0 2552824 228688 107152 S 12.1 0.1 0:51.26 Isolated Web Co
2481 drkirkby 20 0 4573500 450416 127528 S 7.2 0.1 8:38.70 gnome-shell
2129 root 20 0 24.2g 118088 70232 R 3.7 0.0 5:45.92 Xorg
2171 root -51 0 0 0 0 S 2.6 0.0 2:15.89 irq/165-nvidia
2113 drkirkby 9 -11 2908504 20416 15792 S 1.4 0.0 8:05.07 pulseaudio
41350 drkirkby 20 0 1082404 136948 58796 S 1.0 0.0 0:04.14 WolframKernel
40686 drkirkby 20 0 1082404 136548 58396 S 0.9 0.0 0:04.38 WolframKernel
40687 drkirkby 20 0 1307832 159464 65268 S 0.9 0.0 0:06.14 WolframKernel
40709 drkirkby 20 0 1082400 136612 58460 S 0.9 0.0 0:04.24 WolframKernelDavid Kirkby2023-05-25T23:25:03ZLike what I did for the MRB constant to be done for anything else?
https://community.wolfram.com/groups/-/m/t/2925336
Using Mathematica, I've made a notable contribution to mathematics that I'm verry proud of!
Search "MRB constant."
and see https://community.wolfram.com/groups/-/m/t/366628
Is there anything you would like me to do for you, or maybe your favorite number?
(Besides math tutoring, this is what I love doing!)
If the answer is yes, or even maybe, write me at bmmmburnsatsbcglobal.net, where the @ needs to be put in place of the letters "at."Marvin Ray Burns2023-05-25T14:58:19ZFlipping the x-axis
https://community.wolfram.com/groups/-/m/t/2925183
Hello all! I have problems with a plot. I want to plot exactly this way and also exactly in this order (from maximum to minimum on the x-axis and from minimum to maximum on the y-axis). Mathematica plot both from min to max. How can I do this?
Here are the first table entries:
{{4000., 96.6728}, {3999., 96.6739}, {3998., 96.675}, {3997., 96.674},
{3996., 96.6704}, {3995., 96.6643}, {3994., 96.657}, {3993.,
96.6507}, {3992., 96.648}, {3991., 96.65}, {3990., 96.6557}, {3989.,
96.6627}, {3988., 96.6684}, {3987., 96.6712}, {3986., 96.6712},
{3985., 96.6694}, {3984., 96.668}, {3983., 96.669}, {3982., 96.6726},
{3981., 96.6767}, {3980., 96.6778}, {3979., 96.6743}, {3978.,
96.668}, {3977., 96.6637}, {3976., 96.6653}, {3975., 96.673}, {3974.,
96.6827}, {3973., 96.6891}, {3972., 96.6894}..........}D S2023-05-25T10:18:38Z[R&D] Wolfram R&D LIVE: The Art of Problem Solving in WL '23
https://community.wolfram.com/groups/-/m/t/2925156
*MODERATOR NOTE: This is the notebook used in the livestream "Problem Solving" on Wednesday, May 24 -- a part of Wolfram R&D livestream series announced and scheduled here: https://wolfr.am/RDlive For questions about this livestream, please leave a comment below.*
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/bc7199ce-a83c-48ee-9884-3b512f76802bShenghui Yang2023-05-25T09:58:02Z[WSS22] QuantumToMultiwaySystem to explore quantum entanglement
https://community.wolfram.com/groups/-/m/t/2574866
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/93c75345-c35b-4dba-8fe4-3cde44521b96Mark Merner2022-07-19T22:00:17ZHow can i calculate negativity correctly?
https://community.wolfram.com/groups/-/m/t/2922466
I tried to plot negativity that is defined as follow:
N = Trace(Sqrt(A.A_dagger))-1 (1)
the plot should start from ~0.41 or ~0.82 in r=0.01 (i don't know which one exactly) and decrease versus r. r range is 0 to 0.8
notice that first we must diagonal the matrix (calculating the eigenvalues) then taking square root of the eigenvalues. then we need to sum the eigenvalues using Total function (its like to calculate the trace of the diagonal matrix).
after that we need to do a sum from m = 0 to infinity (i know its not part of the eq (1) but we must do that. for more info look at the `https://arxiv.org/abs/1010.6154` page 5 of the article)
also notice that the matrix is equal to its dagger so p = p-dagger
and notice that other way of calculating negativity is that to diagonal the matrix then use the eq (1)
here is my code
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/f8629d14-0b7a-46ed-aabe-04f993639a84Reza Hamzeh2023-05-20T20:39:47ZProbability of n-planet star in human data
https://community.wolfram.com/groups/-/m/t/2924315
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/874f9ae2-104d-4413-afbe-eed1082a225eAlisa Zaitseva2023-05-23T17:28:33ZSyntax for complex numbers in Wolfram Alpha?
https://community.wolfram.com/groups/-/m/t/2924832
Hello,
i am new to wolfram alpha but i want to try using it more. when i type:
A=1, B=2 trying to let wolfram alpha solve this: it gives out result=3. so all fine
now i try the thing in the picture and it says it cant understand the syntax. what am i doing wrong?
https://www.wolframalpha.com/input?i2d=true&i=S%3DDivide%5BDivide%5BB%2CZ%5D%2BCZ%2CA%2BDivide%5BB%2CZ%5D%2BCZ%2BD%5D+and+A%3DR%2BDivide%5BiwL%2CiwM%5D+and+D%3DA+and+C%3DDivide%5B1%2CiwM%5D+and++B%3DDivide%5B2iwM%5C%2840%29R%2Biw%5C%2840%29L-M%5C%2841%29%5C%2841%29%2BPower%5B%5C%2840%29R%2Biw%5C%2840%29L-M%5C%2841%29%5C%2841%29%2C2%5D%2CiwM%5D+solve+for+SEndrik Bürger2023-05-24T12:04:58ZSolution of a System of Nonlinear Equations using the Fixed Point Method
https://community.wolfram.com/groups/-/m/t/2924475
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/428ce5db-eb02-4557-9c51-bf0c331c1ee4Housam Binous2023-05-24T08:12:54ZHelp with harmonic addition theorem
https://community.wolfram.com/groups/-/m/t/2924392
Hello,
It is well known that the linear combination, or harmonic addition, of sine and cosine waves is equivalent to a single sine (or cosine) wave with a phase shift and scaled amplitude.
I did some online search and found: http://mathworld.wolfram.com/notebooks/Trigonometry/HarmonicAdditionTheorem.nb
Basically the two identities I want to implement as functions are:
a cos(q)+b sin(q)==Sqrt[a^2+b^2] sgn(a) cos(tan^-1(-(b/a))+q)
a cos(q)+b sin(q)==-Sqrt[a^2+b^2] sgn(a) sin(tan^-1(-(b/a))+q-\[Pi]/2)
I used mathematica to verify them (see attached notebook).
I need two functions (one for each identity) that would convert the sum of sine and cos wave to either a single sine or cos wave with a phase shift and scaled amplitude.
I am a Mathematica newbie and any help with the syntax would be much appreciated.
Thanks,ok ok2023-05-24T04:10:22ZA question about WeatherData and missing dates
https://community.wolfram.com/groups/-/m/t/2922659
Dear All,
The year 2019 has 365 days.
The "WeatherData" output shows 357 data for Istanbul city.
How do I use the Datepath command or any other commands to find the missing dates?
I appreciate your time.
Alex
![enter image description here][1]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=4371Untitled.jpg&userId=1822915Alex Teymouri2023-05-21T10:17:12ZFactorials and how many zeroes are at the end
https://community.wolfram.com/groups/-/m/t/2921710
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/a5006ae4-40e4-4fae-a3e2-b8e4c881b112Peter Burbery2023-05-18T14:53:55ZHow to solve a kinematics exercise with a differential equation?
https://community.wolfram.com/groups/-/m/t/2923368
I am wondering how to solve a kinematics exercise with a differential equation. I want to respect other author's copyright and the solution to their exercises, so I won't put the word problem here but if its okay I'll come up with a similar problem and ask for help solving that and then I'll be able to solve the problem from my textbook.
Otherwise, I think this will be taken down.
This is based on Giancoli Physics: Principles with Applications 7th edition, chapter 2 Describing Motion: Kinematics in One Dimension, page 45, problem 53, level III, which means a Challenge problem.
Douglas Giancoli states on page 43 (with Grammarly corrections applied to the quote), "The Problems at the end of each Chapter are ranked I, II, or III according to estimated difficulty, with level I Problems being easiest. Level III is meant as challenges for the best students."
This is a similar problem that I think could be reframed as a differential equation.
A falling stone takes 0.2718 s (I'm choosing a time based on the digits of Euler's number) to travel past a window 2.718 m tall. From what height above the top of the window did the stone fall?
I think this could be modeled as an initial value problem for a second-order differential equation. It also might be a differential algebraic equation or a delay-differential equation that could be solved with DSolve. Once I figure out how to abstract the problem, I can make the computer do the calculations, get the result, and interpret the answer in the context of the problem.
My question is, what question should I ask in Computer-Based Maths step 1?
Computer-Based Maths step 2 is abstract, which I think will be an ODE, and step 3, I think, will be DSolve and step 4 will be writing a conclusion.
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/d1471af9-ce4d-44f1-8f94-0c205a179f83Peter Burbery2023-05-23T00:19:48ZNever ending analytical integrate computation
https://community.wolfram.com/groups/-/m/t/2924221
I am computing a Feynman Diagram, to apply the Renormalization Group to an active field theory. Doing it, I need to integrate with Mathematica a complicated expression, and I would need an analytical result, rather than a numerical one. Using `Integrate` the code has been stuck on "running" for a day and it does not give a result nor an error of any kind.
Does it mean that there is not an exact solution or does it mean something else?
The code with the function I need to integrate is the following (together with the Integrate command):
Integrand = (64 a w Cos[θ]^2 (f^3 κ^2 (w + κ +
2 w κ) λx0^5 +
4 w^3 (1 + w) Λ^6 λx0^5 +
2 w^2 (1 + w) Λ^6 λx0^4 (λx0 -
h λx0) +
f^3 κ^2 λx0^5 (-ht (1 + w) - κ -
w κ + h (1 + κ) + w μy +
w κ μy) +
f^3 κ^2 λx0^5 (-1 + μy) (-ht (2 + w) -
3 κ - 2 w κ + h (2 + 3 κ) + w μy +
2 w κ μy) Cos[θ]^2 +
f^2 κ Λ^2 λx0^5 (2 (-1 +
ht) w^3 - 2 κ (-2 + h + μy) +
w^2 (-15 + 9 ht - 18 κ + h (4 + 6 κ) +
2 μy + 12 κ μy) +
w (-4 + 4 ht +
5 κ (-2 + h + μy))) Cos[θ]^2 +
f^2 κ Λ^2 λx0^4 (2 κ ( λx0 - h λx0) (-2 + h + μy) -
w^2 λx0 (h + 3 μy - 4 h μy -
2 κ (-1 + μy) (-3 + 2 h + μy) +
ht (-4 + 3 h + μy)) +
w λx0 (6 κ + h^2 (2 + κ) -
2 ht (-3 + μy) - 2 μy -
6 κ μy + κ μy^2 +
h (-4 - 4 ht - 6 κ + 4 μy +
4 κ μy))) Cos[θ]^2 -
f^2 (-1 + h) κ Λ^2 λx0^5 (6 κ +
h^2 κ - 6 w κ - 3 w^2 κ +
h w (2 + ht - 3 κ (-1 + μy) - 3 μy) +
w μy - 6 κ μy + 9 w κ μy +
6 w^2 κ μy + κ μy^2 -
3 w κ μy^2 - 3 w^2 κ μy^2 +
ht w (-3 + 2 μy) +
2 h κ (-3 + 2 μy)) Cos[θ]^4 +
f (-1 + h) w Λ^4 λx0^5 (2 (-1 +
ht) w^3 - 8 κ (-1 + μy) +
w (-12 + 10 ht - 27 κ + h (2 + 20 κ) +
7 κ μy) +
w^2 (-18 + 15 ht - 20 κ + h (3 + 8 κ) +
12 κ μy)) Cos[θ]^4 +
f (-1 + h)^2 w Λ^4 λx0^5 (-2 ht w -
2 h (6 κ +
w (-1 + 2 κ)) + κ (-6 (-3 + μy) +
2 w^2 (-1 + μy) + w (3 + μy))) Cos[θ]^4 -
2 (-1 + h)^4 w^2 (4 +
w) Λ^6 λx0^5 Cos[θ]^6 +
2 (-1 + h)^3 w^2 (6 + 11 w +
2 w^2) Λ^6 λx0^5 Cos[θ]^6 -
f (-1 + h)^3 w κ Λ^4 λx0^5 (-12 + 4 h + w (-1 + μy) + 8 μy) Cos[θ]^6 + 2 w^2 Λ^6 (λx0 - h λx0)^5 Cos[θ]^8 - f^2 κ^2 λx0^4 (λx0 - h λx0) (-1 + μy)^2 Cos[θ]^6 (f κ (-1 + μy) - (-1 + h)^2 Λ^2 Cos[θ]^2) - w Λ^4 λx0^5 (-f (1 + w) (-ht w (2 + w) + h (2 w + w^2 - 4 κ) + κ (3 + 2 w (-1 + μy) + μy)) + 2 (-1 + h)^2 w (4 + 3 w) Λ^2 Cos[θ]^2) + 2 w Λ^4 λx0^5 (f (w + w^3 - κ + 2 w κ + w^2 (3 + 4 κ)) + (-1 + h) w (1 + 9 w + 6 w^2) Λ^2 Cos[θ]^2) - f κ λx0^5 (1 - μy) Cos[θ]^6 (f^2 κ (1 - μy) (h + w - ht (1 + w) + κ + w κ - κ μy - w κ μy) +f (-1 + h)^2 Λ^2 (κ + w (-1 + ht + κ (-1 + μy)) - κ μy) Cos[θ]^2 + (-1 + h)^4 w Λ^4 Cos[θ]^4) + f κ λx0^5 (1 - μy) Cos[θ]^4 (f^2 κ (h - ht + 3 h κ + κ (-3 + w (-1 + μy))) (1 -μy) + 2 f (-1 + h)^2 κ Λ^2 (-2 + h + w + μy - w μy) Cos[θ]^2 + 3 (-1 + h)^4 w Λ^4 Cos[θ]^4) + Λ^2 λx0^5 (f^2 κ (-ht w (3 + 4 w + w^2) + κ - 2 w κ - 3 w^2 κ + h (-κ + w^2 (1 + κ) + w (2 + κ)) + w μy + 3 w^2 μy + w^3 μy + w κ μy + 2 w^2 κ μy) + f (-1 + h) w Λ^2 (-ht w (4 + 3 w) + h (3 w^2 + w (4 - 8 κ) - 12 κ) + κ (12 + 4 w^2 (-1 + μy) + w (3 + 5 μy))) Cos[θ]^2 - 6 (-1 + h)^3 w^2 (2 +w) Λ^4 Cos[θ]^4) + Λ^2 λx0^5 (f^2 κ (w + w^3 - κ + 3 w κ + w^2 (5 + 7 κ)) + f w Λ^2 ((-4 + h + 3 ht) w^3 + κ (7 - 4 h - 3 μy) + w (-8 + 4 ht - 17 κ + 4 h (1 + 4 κ) + κ μy) + w^2 (-18 + 9 ht - 22 κ + h (9 + 16 κ) + 6 κ μy)) Cos[θ]^2 + 2 (-1 + h)^2 w^2 (4 + 15 w + 6 w^2) Λ^4 Cos[θ]^4) - (1/λtx0)λx0^5 Cos[θ]^2 (-f^3 κ^2 λtx0 (-h + ht - 3 w + 2 ht w - 3 κ - 5 w κ + w μy + 3 κ μy + 5 w κ μy) + f^2 κ Λ^2 (w^3 (λtx0 - ht λtx0) (-1 + μy) - w^2 λtx0 (15 + h (-9 + μy) - 7 μy + 5 κ (-1 + μy) (-3 + 2 h + μy) + 2 ht (-7 + 4 h + 3 μy)) + κ λtx0 (6 + h^2 - 6 μy + μy^2 + h (-6 + 4 μy)) - w λtx0 (6 + 12 κ + h^2 (-1 + 2 κ) + 3 ht (-3 + μy) - μy - 12 κ μy + 2 κ μy^2 + 2 h (-1 + 3 ht - 6 κ - μy + 4 κ μy))) Cos[θ]^2 - f (-1 + h)^2 w Λ^4 λtx0 (6 w^2 (-1 + ht + κ (-1 + μy)) + 2 κ (1 + 2 h - 3 μy) + w (-8 + 8 ht + κ (-19 + 8 h + 11 μy))) Cos[θ]^4 - 2 (-1 + h)^4 w^2 (4 + 3 w) Λ^6 λtx0 Cos[θ]^6) + λx0^4 Cos[θ]^4 (f^3 κ^2 λx0 (-1 + μy) (-2 h - 3 w + ht (2 + 3 w) - 3 κ - 4 w κ + 3 κ μy + 4 w κ μy) + f^2 κ Λ^2 (λx0 - h λx0) (w^2 (5 - 5 ht - 4 κ (-1 + μy)) (-1 + μy) + 2 κ (-1 + μy) (-2 + h + μy) + w (-3 κ (-1 + μy) (-2 + h + μy) - 2 ht (-3 + h + 2 μy) + 2 (-2 + μy + h μy))) Cos[θ]^2 + f (-1 + h)^3 w Λ^4 λx0 (2 (-1 +
h) κ +
w (-2 + 2 ht +
5 κ (-1 + μy))) Cos[θ]^4 +
2 (-1 + h)^5 w^2 Λ^6 λx0 Cos[θ]^6)) Sin[θ]^2)/(h π λx0^5 (1 + h + 2 w + (-1 + h) Cos[2 θ])^3 ((1 + h) w Λ^2 + f κ (1 + μy) + ((-1 + h) w Λ^2 + f κ (-1 + μy)) Cos[2 θ])^3);
Integrate[Integrand, {θ, 0, π},
Assumptions -> {w > 0, h > 0, h != 1, μy != 1, μy > 0, ht > 0, Λ > 0, κ > 0}]guido cimino2023-05-23T12:38:08ZFrom Maximal Entropy Random Walk to quantum thermodynamics
https://community.wolfram.com/groups/-/m/t/2924355
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Demo.gif&userId=20103
[2]: https://www.wolframcloud.com/obj/59578a38-572d-4c2c-a915-1f7547167e2bJarek Duda2023-05-23T21:00:43ZUse ClickPane for form input
https://community.wolfram.com/groups/-/m/t/2924065
Hello! I want to make a form in which one of the fields is filled with a list of two numbers (a 2D coordinate) via a ClickPane or LocatorPane. Is it possible? I cannot figure it out! It seems from the documentation that I should be able to specify something like a ClickPane as an arbitrary function, but the first problem is that I can't see how to make an arbitrary function return a value to the form. For example, here is an even simpler example using a slider. This works:
form = FormFunction[
FormObject[{"Number" -> <|"Interpreter" -> "Real",
"Control" -> Slider|>}], Print];
form[]
But this doesn't:
form = FormFunction[
FormObject[{"Number" -> <|"Interpreter" -> "Real",
"Control" -> Function[Slider[0, {0, 1}]]|>}], Print];
form[]
The value returned is always 0.
Can anyone show whether it is possible to make custom function that fills a form field?Gareth Russell2023-05-23T19:59:32ZExact GeoPosition from FormFunction
https://community.wolfram.com/groups/-/m/t/1576753
![The form for the user: intuitive and easy to use][1]
# Backstory
When trying to set up a system to collect birdwatching data from the public, I was recently faced with the problem of collecting accurate locations from people filling in the form. The obvious choice is to use **Here**, but the accuracy, especially on laptops was just not enough.
I reached out to Christopher Wolfram and Carlo Barbieri for support and together (large parts of the code contained here is their doing) we were able to create an intuitive and functional solution that let us combine the FormFunction with embedded HTML code and JavaScript accessing the Google Maps API. Many things about the code can be adjusted, like whether you drag the map or the marker and many more, but it has already been extremely useful for my purpose, so I thought I should share with the community.
# The code
First, we need to set up the function we are going to call on that consists of HTML and Javascript embedding the map.<br>
apiKey="Your_API_key";
mapControl[apiKey_, name_, defaultPosition_, defaultZoom_:15]:= Function[EmbeddedHTML@StringTemplate["
<input type=\"hidden\" id=\"mapField\" name=\"`Name`\">
<div id=\"selectionMap\" style=\"width:100%;height:400px;\"></div>
<script>
field = document.getElementById(\"mapField\")
function initMap() {
defaultPosition = {lat: `Latitude`, lng: `Longitude`}
var map = new google.maps.Map(
document.getElementById(\"selectionMap\"),
{zoom: `DefaultZoom`, center: defaultPosition})
var marker = new google.maps.Marker({
position: defaultPosition,
draggable:false,
map: map
})
field.value = marker.position
google.maps.event.addListener(
map,
\"center_changed\",
function() {
marker.setPosition(map.getCenter())
field.value = marker.position
}
)
function showPosition(position) {
coords = {
lat: position.coords.latitude,
lng: position.coords.longitude
}
marker.setPosition(coords)
map.panTo(coords)
field.value = marker.position
}
if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, console.log, {enableHighAccuracy: true});
}
}
</script>
<script async defer src=\"https://maps.googleapis.com/maps/api/js?key=`apiKey`&callback=initMap\">
</script>
"][<|"Name"->name,"Latitude"->defaultPosition[[1,1]],"Longitude"->defaultPosition[[1,2]],"DefaultZoom"->defaultZoom,"apiKey"-> apiKey|>]]
<br>
Then we deploy a form and use the function as the control for one of the inputs.
<br>
CloudDeploy[FormFunction[{"location"-><|
"Label"->"Drag the map so the marker points at your location",
"Interpreter"->"StructuredGeoCoordinates",
"Control"->mapControl[apiKey,"location",Entity["City",{"Champaign","Illinois","UnitedStates"}]["Position"]]|>},
{#location,GeoGraphics[GeoMarker[#location],GeoRange->Quantity[1,"Miles"]]}&],
"https://www.wolframcloud.com/objects/3550411e-7493-4e1f-811e-8a1be25c1f38",
Permissions->"Public"]**strong text**
#The finished product
The resulting section of the form is intuitive and easy to use. It will point at the position given by GPS if the user gives permissions and the default position I set otherwise.
![The form for the user: intuitive and easy to use][2]
![what the form returns is my exact location][3]
You can see for yourself and find out your exact geolocation here:
https://www.wolframcloud.com/objects/3550411e-7493-4e1f-811e-8a1be25c1f38
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=randomscreenshot.JPG&userId=1340981
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=randomscreenshot.JPG&userId=1340981
[3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=returnImage.JPG&userId=1340981Katja Della Libera2018-12-23T19:12:09ZThe managers of round table puzzle
https://community.wolfram.com/groups/-/m/t/2924025
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=roundtable.png&userId=23928
[2]: https://www.wolframcloud.com/obj/4eee3827-f7e4-4728-9d6e-e60146af17adShenghui Yang2023-05-23T12:26:39ZResolved: Given a symbol, how do I "strip" off the context prefix?
https://community.wolfram.com/groups/-/m/t/2922877
The following issue is now resolved -- with thanks going to [@Eric Rimbey][at0] for pointing out my mis-use of the form `Needs["context" -> "alias"]` prevented my paclet symbols from being loaded into $Context. Attached is the working example where using `Needs["context"]` solves my issue.
The original question follows.
---
In my paclet, I have a function that extracts relevant symbols from an equation to return a sorted symbols list. But my implementation strategy fails when anyone calls my paclet function from a different namespace context. Is there a means of creating a function were I can add a blank sequence for the context? Or, is there a more generalized strategy for handing symbols between different contexts?
Implementation:
pSort[ M ] = 1;
pSort[ w[id_] ] := 100 + id;
pSort[ A[id_] ] := 200 + id;
extractSymbols[ equation_ ] :=
Block[{varsAndCosVars, deDupedAndAll},
varsAndCosVars = (Variables @ equation) /. (Cos[vars_] :> Variables @ vars);
deDupedAndAll =
DeleteCases[DeleteDuplicates[Flatten[varsAndCosVars]], t]];
Test:
testEq1 = A[2]*Cos[w[2]*t] + A[1]*Cos[w[1]*t] + M;
Sort[extractSymbols @ testEq1, pSort[#1] < pSort[#2] &]
Expected Result:
{M, w[1], w[2], A[1], A[2]}
Problem:
While the above does work in the paclet context space, it fails when extractSymbols is invoked from another context where the Symbols in the equation are unique to caller's context space.
[at0]: https://community.wolfram.com/web/eric3A Chase Turner2023-05-21T21:59:16ZWei-Prater Mechanism: three-species reaction mixture paths
https://community.wolfram.com/groups/-/m/t/2924103
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/2ddd0800-1c76-40b6-9df1-8e3666b8899aHousam Binous2023-05-23T09:15:51ZSave computation output permanently
https://community.wolfram.com/groups/-/m/t/2923806
I'm doing some computations that output very long lists. I would like these outputs to persist between sessions even if I quit the kernel and Mathematica. How can this be achieved? I tried to save the output to the notebook, and it seems to succeed but then when I try to use the variable I store the list into, it restarts the evaluation.Alex Bailey2023-05-22T19:44:26Z