Community RSS Feed
https://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions in tag Mathematics sorted by activeHow to customize complex solution regions for NDSolve like the example in Mathematica？
https://community.wolfram.com/groups/-/m/t/3231777
![The example of mathematica for solving PDE on a irregular region][1]
Hello, everyone!
I have came across an interesting example of solving PDE on a customize complex solution regions like the alphabet region of "Wolfram" in the Official Example (see the picture or the website https://www.wolfram.com/mathematica/new-in-10/symbolic-geometry/solve-partial-differential-equations-over-regions.html ）
.
I am wondering that how can I define this kind of region, since I want to try this example using different alphabet like "EIAS"? I cannot find any functions or codes to realize this example.
I am using Mathematica 14 now.
Thanks very much.
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=NDsolve.png&userId=3231744HAO XU2024-07-22T09:28:54ZWhy the length of this list is 1 but not 3?
https://community.wolfram.com/groups/-/m/t/3232514
Hello, I made a program that creats a certain list starting from an empty set.
Can someone please tell me why Mathematica telling me that the length is 1 and not 3
j = {{{0, 0, 4}, {0, 2, 0}, {1, 0, 0}, {0, 0, 2}}, {{0, 0,
4}, {0, 2, 0}, {1, 0, 0}, {0, 1, 0}}, {{0, 0, 4}, {0, 2, 0}, {1,
0, 0}, {0, 1, 2}}}
First I created
\[Alpha] = {0, 0, 4};
\[Beta] = {0, 2, 0};
\[Gamma] = {1, 0, 0};
id = {0, 0, 0};
a = {0, 0, 2};
b = {0, 1, 0};
G = {0, 0, 1};
A = {\[Alpha], \[Beta], \[Gamma]};
B = {a, b, a + b, a + \[Gamma], a + \[Gamma], a + b + \[Gamma]};
So for me j is just
j = {{ \[Alpha], \[Beta] , \[Gamma], a}, { \[Alpha], \[Beta] , \[Gamma], b}, { \[Alpha], \[Beta] , \[Gamma], a+b}}Issam EL MARIAMI2024-07-22T21:30:18Z[WSRP24] Monoids, string-rewriting, confluence, and the Knuth-Bendix Algorithm
https://community.wolfram.com/groups/-/m/t/3217387
![Monoids][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot_2024-07-11_at_7.53.02_PM.png&userId=3183683
[2]: https://www.wolframcloud.com/obj/02972173-380e-4d9b-a1a9-f4436db264f2Vivaan Daga2024-07-12T00:02:51Z[WSRP24] HyperPlot: on the generation of temporally coherent hypergraphs
https://community.wolfram.com/groups/-/m/t/3216034
![Fully Rendered Wolfram Physics Project Graph][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=thumbnail1.png&userId=3212154
[2]: https://www.wolframcloud.com/obj/eeff2ec6-f78a-4e72-aa71-0093a84ab11bGregory Roudenko2024-07-11T19:53:23Z[WSRP24] On chaos in aggregation systems
https://community.wolfram.com/groups/-/m/t/3215676
![A small perturbance in initial conditions results in exponential divergence over time.][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2024-07-11at3.16.44%E2%80%AFPM.png&userId=3214847
[2]: https://www.wolframcloud.com/obj/84c5bb1b-d04b-4560-818e-40a9fc5d00a9Yufan Wang2024-07-11T19:30:07Z[WSRP24] Polypool: explorations into infinitely bouncing cueballs in geometric shapes
https://community.wolfram.com/groups/-/m/t/3215621
![Animated raycast in a random polygon][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=anim-paths.gif&userId=3214371
[2]: https://www.wolframcloud.com/obj/79afd8c5-7b99-4848-936c-ec86be28fcffBertie Bennett2024-07-11T19:17:28ZHow can I add a plot label inside the plot?
https://community.wolfram.com/groups/-/m/t/3213403
I solve a nonlinear ODE system in Mathematica. But the labels of the plot are showed outside of the plot.
My notebook &[Wolfram Notebook][1]
1. I want labels inside the plot
2. Also labels are displayed like 30 ° not 30 Degree.
3. How to zoom particular are in this plot like the following ![enter image description here][2]
[1]: https://www.wolframcloud.com/obj/bcc43ca0-ea81-4826-8ef8-85ace1ef902f
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Example.jpg&userId=3182475J Prakash2024-07-11T09:59:02ZWhy Simplify[Arg[z]+Arg[Conjugate[z]], Element[z,Complexes]&& Im[z] !=0] does not evaluate to 0?
https://community.wolfram.com/groups/-/m/t/3230384
Simplify[Arg[z] + Arg[Conjugate[z]], Element[z,Complexes]&&Im[z]!=0]
does not evaluate although it clearly equals 0 mathematically.
&[Wolfram Notebook][1]
In an attempt to understand this highly undesirable behavior I took into account what the documentation says: 'Arg[z] is left unevaluated if z is not a numeric quantity.' I discarted this as an explanation since the steps to be done to reach the result 0 are not *evaluation* in the sense of
replacing Arg[z] by some 'result' but transformations of the expression Arg[z] + Arg[Conjugate[z]] making use of the information that z is a complex variable. This is what I understood from the
Chapters 3.3.8 - 3.3.10 of 'Mathematica-V5-Book.pdf'. In this honorable old source the intention was to simplify all expressions containing real and complex variables in the way an educated mathematician. would choose. I imagine that by some code revision the general evaluation loop lost some transformation steps that deal with complex sub-expressions containing Arg and Abs - steps that in earlier versions were present. This would say that we deal with a veritable bug in the Wolfram Language which should be easy to repair, but which should become repaired ASAP.
[1]: https://www.wolframcloud.com/obj/69e3ea3d-a8f3-408a-a946-bbf40544e60cUlrich Mutze2024-07-20T18:04:27ZIs there a simple conversion of periodic decimal numbers into fractions
https://community.wolfram.com/groups/-/m/t/3231121
Hello
I am missing a simple conversion of periodic decimal numbers into fractions. Rationalize only works in a few cases. Do you really have to write a function yourself that performs this elementary conversion? In Julia, for example, there is something like 0.2(3) for the fraction 7/30. The period is in the round brackets.
Have I overlooked something convenient? Many thanks for any hints.
AlbertAlbert Gaechter2024-07-21T12:33:57ZLimit of algebraic polynomial roots: playing around with randomness and algebraic numbers
https://community.wolfram.com/groups/-/m/t/2048213
![Limit of algebraic polynomial roots: playing around with randomness and algebraic numbers][1]
Hey everyone, Vitaliy suggested I post this. Explanation and code included!
The basic idea is twofold:
1. For most polynomials $P(x)$ and the series of polynomials $Q_ n(x)=x^n+P(x)$, if $n\to\infty$ then $Q_n(x)=0$ will have some solutions approaching the unit circle.
2. The structure of the roots of $Q_n(x)=x^n-1$ has the same structure as the set of rational numbers in $[0,1]$, since its solutions are $x=e^{2\pi i \frac{a}{n}}$.
So, you make some polynomial in x called $P(x,\theta)$ and animate over theta. Better yet, add a random polynomial of finite degree to start! Circle's sizes are decided by the leading coefficient of the polynomial, $n$.
This is another one I made without any randomness. I don't have the source code/specific polynomial that I used, but it looks like a cubic to me. Also it looks like I didn't set "AnimationRepetitions"->Infinity on this one, so you'll have to refresh if you don't see it animating. Keep an eye out for Euclid's orchard!
![limit circle][2]
### **CODE**
coef[n_, k_] := coef[n, k] = (RandomReal[{-1, 1}] + RandomReal[{-1, 1}] I);
nframes = 240;
solve[theta_, n_] := NSolve[
Sum[coef[n, k] z^k, {k, 1, n}] + 0.2 E^(I theta) +
0.9 E^(I 2 theta) z^3 If[n >= 3, 1, 0] +
0.9 E^(I 3 theta) z^6 If[n >= 6, 1, 0] == 0,
z];
disks[theta_, n_] := Disk @@@ Flatten[Table[
{{Re[z], Im[z]}, Max[0.3/n, 0.004]} /. solve[theta, n],
{n, 4, 120}], 1];
Export["algebraicAnimation.gif", Table[
Graphics[{Black, disks[theta, n]}, PlotRange -> 1.3],
{theta, 0, 2 Pi (1 - 1/nframes), 2 Pi/nframes}],
"DisplayDurations" -> 1/60, "AnimationRepetitions" -> Infinity]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=image2.gif&userId=57495
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=image.gif&userId=57495David Moore2020-07-31T01:52:14ZHow to correct this code so that it can output the correct results?
https://community.wolfram.com/groups/-/m/t/3227384
A function is to be constructed that, given an input of a positive integer value m, automatically enumerates all possible cases. Starting with an arithmetic sequence of length 4*m + 2, two terms are removed leaving 4m terms, which are then evenly divided into m groups, each consisting of 4 numbers. It is required that the 4 numbers in each group form their own arithmetic sequence. The function should generate all combinations of the two removed terms and the corresponding m groups of four numbers forming arithmetic sequences.
To clarify the problem statement further, let's break down the requirements:
1. An arithmetic sequence of length 4*m + 2 is created.
2. Two terms from this sequence are removed.
3. The remaining 4m terms are divided into m groups, each containing exactly 4 terms.
4. Each of these groups must also be an arithmetic sequence.
5. The function should output all possible combinations of the two removed terms and the resulting groups of four numbers that form arithmetic sequences.
![enter image description here][1]
Finally, represent each outcome using the grid diagram shown above.
f[m_] := Module[{S, graph}, S = Range[4 m + 2];
graph =
RelationGraph[DisjointQ,
Select[Subsets[S, {4}], Equal @@ Differences@# &]];
GroupBy[FindClique[graph, Length /@ FindClique[graph], All],
Complement[S, Join @@ #] &]]
grid[m_] :=
Grid[MapIndexed[{#2[[1]], Multicolumn[#, 2, Spacings -> 1]} &,
Map[Function[x,
TextGrid[
Range[4 m + 2] /.
a -> Alternatives @@
Thread[a : Complement[Range[4 m + 2], Join @@ x] :>
Highlighted[a, FrameMargins -> 0]], Frame -> All,
FrameStyle -> Gray,
Background -> {None, None,
Join @@ MapIndexed[
Thread[Thread[{1, #}] ->
Lighter[Hue[(Tr@#2 - 1)/Length@x], 0.85]] &, x]}]],
Values@f[m], {2}]], Alignment -> Left, Spacings -> {Automatic, 1}]
The above code is not producing results correctly. How can it be corrected or modified to achieve the correct output?
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=JpD9cdC2.jpg&userId=1828799Lee Tao2024-07-20T13:34:34ZMathematical Games: Turing machines
https://community.wolfram.com/groups/-/m/t/3227158
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=5748HeroImage.png&userId=20103
[2]: https://www.wolframcloud.com/obj/1d21d10c-ff31-4e75-a064-7a4ad7b0e449Ed Pegg2024-07-19T20:06:43ZRobust self-testing of Bell inequalities tilted for maximal loophole-free nonlocality
https://community.wolfram.com/groups/-/m/t/3227123
![Summary of result for not equal efficient detectors. ) The Schmidt decomposition of the optimal quantum state. Robust self-testing of Bell inequalities tilted for maximal loophole-free nonlocality][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=9508HeroImage.png&userId=20103
[2]: https://www.wolframcloud.com/obj/5a793348-239e-447e-bc34-32d6ac7fe959Giovanni Scala2024-07-19T18:10:02Z[WSRP24] Adaptive evolution of 1D cellular automata to maximize blocks of the same color
https://community.wolfram.com/groups/-/m/t/3215774
![colorful cellular automata][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=WhatsAppImage2024-07-11at15.08.57.jpeg&userId=3214487
[2]: https://www.wolframcloud.com/obj/fc0d7b5d-041f-4a77-8f2d-daa1260f79e8Ahana Dalmia2024-07-11T19:13:59Z[WSRP24] Generating musical notes based on the trajectory of bouncing balls
https://community.wolfram.com/groups/-/m/t/3215610
![Image of a simulation with three bouncing balls that generate sound][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=WSRPprojectimage.png&userId=3215052
[2]: https://www.wolframcloud.com/obj/5d7ddd59-8212-47ae-933b-40cef2e02249Ian Gu2024-07-11T19:10:38Z[WSRP24] Breaking the symmetry of harmonic oscillators: an analysis
https://community.wolfram.com/groups/-/m/t/3217743
![Harmonic Oscillators][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=f2126272-85d4-4018-802b-955e4799a9b3.png&userId=3217170
[2]: https://www.wolframcloud.com/obj/ebb6537d-aa08-4cac-bcb2-facfdc6c4ff9Aisha Benzine2024-07-12T00:06:58ZNumerically solved PDE of Ornstein–Uhlenbeck process on simplex violates conservation of probability
https://community.wolfram.com/groups/-/m/t/3214694
Thanks for your consideration.
I'm working to create a solution of an Ornstein-Uhlenbeck process with a force that takes mass towards the centre of a Simplex. I'm assuming absorbing boundaries.
The Mathematica code below quickly provides a solution. However, the probability mass within the domain grows significantly early, but it should only ever diminish, due to mass being absorbed.
I don't think the error lies in my formulation of the forward Kolmogorov (Fokker-Plank) equation.
If it doesn't lie there, I suppose it could lie in the numerical approximation, with errors growing? I greatly appreciate any insight into this problem.
![enter image description here][1]
![enter image description here][2]
ClearAll["Global`*"]
\[Eta] = 5.; (*side length*)
xopt = {\[Eta]/2, \[Eta]/(2 Sqrt[3])}; (*centroid*)
\[Kappa] = .75; (*rate of reversion to centroid,diffusion constant=1*)
Tmax = 5.; (*length of time*)
\[CapitalOmega] =
Polygon[Rationalize[{{0, 0}, {\[Eta],
0}, {\[Eta]/2, (\[Eta] Sqrt[3])/2}},
0]]; (*domain is equilateral triangle*)
bC = Rationalize[DirichletCondition[P[x1, x2, t] == 0, True],
0]; (*absobing boundary condition*)
iC = Rationalize[
P[x1, x2, 0] ==
Piecewise[{{1/((Sqrt[3] \[Eta]^2)/4),
RegionMember[\[CapitalOmega], {x1, x2}]}}, 0],
0]; (*uniform initial condition*)
(*forward Kolmogorov equation*)
fwrdKol =
Rationalize[
D[P[x1, x2, t],
t] == -D[\[Kappa] (xopt[[1]] - x1)*P[x1, x2, t], {x1, 1}] -
D[\[Kappa] (xopt[[2]] - x2)*P[x1, x2, t], {x2, 1}] +
1/2 D[P[x1, x2, t], {x1, 2}] + 1/2 D[P[x1, x2, t], {x2, 2}], 0];
(*numerical solution*)
Psol = NDSolveValue[{fwrdKol, iC, bC},
P, {x1, x2} \[Element] \[CapitalOmega], {t, 0, Tmax}];
(*visualise solution at a t=Tmax/2*)
ContourPlot[Psol[x1, x2, Tmax/2], {x1, x2} \[Element] \[CapitalOmega]]
(*probability mass within domain*)
domP[t_] :=
NIntegrate[
Rationalize[Psol[x1, x2, t],
0], {x1, x2} \[Element] \[CapitalOmega], AccuracyGoal -> 4]
(*visualise*)
Plot[domP[t], {t, 0, 5}, PlotTheme -> "Scientific", PlotRange -> All,
FrameLabel -> {"t", "Prob. Mass Domain"}]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=timevmass.png&userId=3214634
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=simplex.png&userId=3214634Cameron Turner2024-07-11T16:45:27Z[WSRP24] Analyzing parameters of Collatz-like functions to maximize constantness
https://community.wolfram.com/groups/-/m/t/3215301
![Example Collatz function][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshotfrom2024-07-1114-10-15.png&userId=3212051
[2]: https://www.wolframcloud.com/obj/56ac69f1-a8fc-48fd-a51f-82d71280f2ebRyan Wu2024-07-11T18:27:50Z[WSRP24] Exploring holomorphic dynamics with multiway systems
https://community.wolfram.com/groups/-/m/t/3215155
![Title Image][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=title_pic.png&userId=3215107
[2]: https://www.wolframcloud.com/obj/d06bc037-29f8-435b-8faa-263971b3b7a0Sambhu Ganesan2024-07-11T18:23:10Z