Community RSS Feed
https://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions from all groups sorted by activeHow do I solve this intregral?
https://community.wolfram.com/groups/-/m/t/2818622
Integrate[1/(1-a * cos(p)),{p,0,2*pi}]
The answer is: 2*pi/sqrt(1-a^2) valid for a^2<1
But I get the following error:
$RecursionLimit
:Recursion depth of 1024 exceeded.
Out[1]=
TerminatedEvaluation[RecursionLimit]Daniel McGregor2023-01-28T01:50:57ZUsing Prefix trees for Markov chain text generation
https://community.wolfram.com/groups/-/m/t/2819012
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/0a51f37f-3a57-46c8-890b-880cb9d31d3cAnton Antonov2023-01-28T18:34:02Zparabolic coordinates (surfaces and coordinate lines)
https://community.wolfram.com/groups/-/m/t/2818910
How to plot the parabolic coordinates,
{x=u v Cos[\[Theta]], y=u v Sin[\[Theta]], z=1/2 (u^2 - v^2)},
{u \[GreaterSlantEqual] 0, v \[GreaterSlantEqual] 0, 0 \
\[LessSlantEqual] \[Theta] < 2 \[Pi]},
as rotation paraboloid. Tried ContourPlot3D, but failed.Bernd Wichmann2023-01-28T16:00:45ZTwo-level Rabi Problem-numerical solution
https://community.wolfram.com/groups/-/m/t/2818584
Hello everyone! I want to numberically simulate the Rabi problem. It's basically to solve the following equations:
![the equations Rabi problem ][1]
my code goes well when \[CapitalDelta]= 10^-4, \
\[CapitalGamma] = 10^4, but breaks down when the order difference
goes higher. How to fix it?
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE_20230127_205446.png&userId=2818537
[2]: https://www.wolframcloud.com/obj/2dffb525-23d3-4ffd-bd4a-3dbf932f4a16Wenxuan Xie2023-01-28T01:59:19ZIncreasing the speed of a code with Select
https://community.wolfram.com/groups/-/m/t/2811276
I've the following list, and I want to find all the combinations of
its sub-lists that meet specific conditions, as represented below:
This is the original list:
In[77]:= pk={{2, 3, 1}, {6, 3, 2}, {18, 3, 3}, {4, 5, 1}, {20, 5, 2}, {6, 7,
1}, {10, 11, 1}, {12, 13, 1}, {16, 17, 1}, {18, 19, 1}};
I want to find all the combinations of sub-lists with the sum of
whose first elements equal to the following value:
n=22;
Create the combinations with all possible lengths:
sub=Subsets[pk,{2,Length[pk]}];
This is the result list, which in addition meets the following condition:
All the second elements in a specific sub-list should be different.
lst=Select[ sub, (#[[All,1]]//Total)==n && (#[[All,2]]//Length)==(Union[ #[[All,2]] ]//Length) & ]
Out[80]= {{{2, 3, 1}, {20, 5, 2}}, {{6, 3, 2}, {16, 17, 1}}, {{18, 3,
3}, {4, 5, 1}}, {{4, 5, 1}, {18, 19, 1}}, {{6, 7, 1}, {16, 17,
1}}, {{10, 11, 1}, {12, 13, 1}}, {{2, 3, 1}, {4, 5, 1}, {16, 17,
1}}, {{6, 3, 2}, {4, 5, 1}, {12, 13, 1}}, {{6, 3, 2}, {6, 7,
1}, {10, 11, 1}}, {{4, 5, 1}, {6, 7, 1}, {12, 13, 1}}, {{2, 3,
1}, {4, 5, 1}, {6, 7, 1}, {10, 11, 1}}}
Here's my difficulty: when the initial list **pk** is longer than 20, the above
algorithm will be very time-consuming. So, I must seek a more
efficient method to solve this problem. Any tips will be appreciated.
Regards,
ZhaoHongyi Zhao2023-01-25T09:21:07ZPlot range prevents placement of graphic elements
https://community.wolfram.com/groups/-/m/t/2815498
The plot range prevents graphics elements from being placed outside the plot range. Example: Sine should only be plotted between -Pi and +Pi. But I want to place an arrow from 2Pi to 3Pi.Bernd Wichmann2023-01-26T14:26:25ZOptimize search for rational numbers on unit circle?
https://community.wolfram.com/groups/-/m/t/2763509
*Crossposted: https://mathematica.stackexchange.com/q/278250/13 *
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=RealRational_560.jpg&userId=11733
[2]: https://www.wolframcloud.com/obj/4dd2dfe1-b258-4a55-a8c4-39f6b4f0cfe9Vitaliy Kaurov2023-01-06T18:30:28ZOn the use of Compile
https://community.wolfram.com/groups/-/m/t/2818526
I am not clear on which Wolfram language functions are actually 'compiled'. It would be nice if a list of 'Compile-compatible' functions was available as it would allow determining, a priori, whether to invest the time in rewriting the code (in a form suitable to Compile). Such a list existed long time ago, but I am not able to find it any longer.
On the same topic, I seem to remember that there is a way to take an existing piece of code and process it without modifications. Am I mistaken? If not, how does that work?Fulvio Spagna2023-01-28T00:00:09Z[WSG23] Daily Study Group: Wolfram Language Basics
https://community.wolfram.com/groups/-/m/t/2774101
A Wolfram U daily study group covering the implementation of Wolfram Language for tasks ranging from basic programming to video analysis begins on January 17, 2023 and runs through February 3. This study group will run on weekdays from 11:00AM–12:00PM Central US time.
This study group is an incredible way either to start learning Wolfram Language or to explore new functionality you haven't yet used. We will cover a very broad variety of topics, including but not limited to image and sound analysis, symbolics and numerics, function visualization and even cloud computation and deployment. We will even cover useful tips and tricks to help you work efficiently with notebooks!
![enter image description here][1]
**No prior Wolfram Language experience is necessary.** As usual, we will have questions, study materials, quizzes along the way to help you master the subject matter.
You can [**REGISTER HERE**][2]. I hope to see you there!
![enter image description here][3]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=meechstogram.png&userId=1711324
[2]: https://www.bigmarker.com/series/daily-study-group-wolfram-language-basics-wsg34/series_details?utm_bmcr_source=community
[3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=WolframUBanner%281%29%281%29.jpeg&userId=1711324Arben Kalziqi2023-01-11T04:29:36ZOverflow problem implementing Euler's method
https://community.wolfram.com/groups/-/m/t/2817707
I tried to solve the following problem by the recursive method using the following code of the improved Euler's method, but it returns me a message ''Overflow occurred in computation''
$$X'=Z+(Y-\alpha)X$$
$$Y'=1-\beta Y-X^2$$
$$Z'=-X-\gamma Z$$
with initial conditions $(X(0),Y(0),Z(0)=(1,2,3)$.
Where
X: interest rate
Υ:investment demand
Z: price index
$\alpha$: savings,
$\beta$: cost per investment,
$\gamma$: the absolute value of the elasticity of demand
I tried to solve by the recursive method using the following code of the improved Euler's method
Q[a_, b_, h_, N_] := (u[0] = a; v[0] = b;
Do[{u[n + 1] =
u[n] + h*
F[u[n] + (h/2)*F[u[n], v[n]],
v[n] + (h/2)*
G[u[n], v[
n]]], \
v[n + 1] =
v[n] + h*
G[u[n] + (h/2)*F[u[n], v[n]], v[n] + (h/2)*G[u[n], v[n]]]}, {n,
0, N}])
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/661c3ef2-4fe0-47d5-9d2e-85da3a0144ccAthanasios Paraskevopoulos2023-01-27T10:36:59ZMy first lecture, and am using Mathematica
https://community.wolfram.com/groups/-/m/t/2801992
I'm so proud to be giving my first lecture on the MRB constant at IUPUI on Tuesday, Jan 24, 2023.
Any advice?
I've **attached** a rough draft of my presentation and added images of it in a notebook below.
Just the printed text follows the images (text embedded).
&[Wolfram Notebook][1]
Just the printed text:
----------------------
original thoughts, being passionate
precious thoughts, humble
I’m known for discovering, or rather, inventing, an attractive quantity that has been read in Wikipedia two
million times.
Does that, then, a mathematician make?
Not entirely, merely insane.
It’s 1994, and as you wouldn’t treat a dog, the absence of invention and poverty of purpose shackles
my hand to the remote control. Here I lie, spellbound. Sounds and images cycle before me. Faster
and faster the stations run their course at an exponentially increasing rate. As a condemned prisoner
awaits the throw of the death switch, my mind entreats, haste the time when sleep silences reason.
Then, as sudden as a coronary, my aching heart replies, “Is this all that there is in life, one miserable
TV show after another, bed, work, one miserable TV show? Of what good, to the world, is this mind?
The deceased care not, have no abated hope grieve not and need no destiny… I DO!!”
“No more!” Frantically wails my dying heart.
Then as strange as it might seem, I begin to write out the powers of two. 2*2=4… 2*2*2=8… et
cetera.” As if I totally lost my wandering mind and found a working one:
From 1*1=1 I got 1^(1/1)= 1^(2/1^2)
From (one squared equals one) I got the (first root of one) equals the (one squared) root of (one
squared).
From 2*2=4 I got 4^(1/4)= 2^(2/2^2)
From (two squared equals four) I got the (fourth root of four) equals the (two squared) root of (two
squared).
From 3*3=9 I got 9^(1/9)=3^(2/3^2)
From (three squared equals nine) I got the (nineth root of nine) equals the (three squared) root of
(three squared).
So, in general,
From n*n=n^2 I got (n^2)^(1/n^2)=n^(2/(2^2)^2)
From (n times n equals n^2) I got the (n^2 root of n^2) equals the (n squared) root of (n squared)
which is just an echo. Thus, I went from squares to roots.
Trying to form an original statement, I asked what If I would add them and all other principal nth roots of n
together in an alternating series and call it the root constant?
What was 1-sqrt(2)?,1-sqrt(2)+3^(1/3)?, 1-sqrt(2)+3^(1/3)-4^(1/4)? Still curious, I tried to summarize
what I was doing and considered the sum's additive inverse and asked “What if I go until the 10th
root of 10?” Got 0.3…. “Until the hundredth root of a hundred?” Got 0.2…. “Until the thousandth root
of a thousand?” Got 0.1... “Until the previous odd number?” I got exactly one less.
I did it: I invented a new mathematical constant, so I told everybody. I didn’t care how much they
knew. They must know it!
My peers all said I was crazy. But without missing a beat, I went on and started writing mathematicians.
Without asking for my permission, they simply began publishing the Marvin Ray Burns constant (MRB
constant). (WOW!) I haven’t come back to earth since!
I found MRB constant (CMRB) by adding Grandi’s series to the following divergent sum,
can be proven to be convergent through simple calculus.
Proof of B
The following image is from Abel–Plana formula - Wikipedia, where there is also a proof
In the yellow highlighted areas, the Abel-Plana formula works for CMRB and other Abel-Plan formula
integrable series.
https://www.wolframcloud.com/obj/bmmmburns/Published/Abel-Plana.nb?
n digits prototype of MRB constant sum converges after about 10^(n+1)
iterations. However:
[Read slowly] Integrating over every 75i yields 100 addition digits of M2=
[1]: https://www.wolframcloud.com/obj/b8190d56-4f60-42bc-8f2b-9c87fb6a362fMarvin Ray Burns2023-01-22T14:09:26ZSpurious format change of highlighted statement (Print)
https://community.wolfram.com/groups/-/m/t/2815460
Hello,
A simple statement (Print) that I had highlighted in yellow (i.e., changed the background color) was changed into the garble below, for an unknown reason. In words, the highlighting was converted to a text-based description of the highlighting. I have been working on this notebook for days and it happened only now.
Suggestions for how to undo and avoid it are most welcome.
Best regards,
L J A Nilsson
Print["\!\(\*StyleBox[\"Warning\",FontColor->RGBColor[1, 0, 0]]\)\!\(\
\*StyleBox[\":\",FontColor->RGBColor[1, 0, 0]]\)\!\(\*StyleBox[\" \
\",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\"Number\",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\" \",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\"of\",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\" \",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\"columns\",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\" \",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\"in\",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\" \",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\"data\",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\" \",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\"file\",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\" \",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\"not\",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\" \",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\"equal\",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\" \",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\"to\",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\" \",FontColor->RGBColor[1, 0, \
0]]\)\!\(\*StyleBox[\"NumberOfDefinedColumns\",FontColor->RGBColor[1, \
0, 0]]\)\!\(\*StyleBox[\"!!\",FontColor->RGBColor[1, 0, 0]]\)"]]L J A Nilsson2023-01-26T13:44:33ZAccessing Microsoft OneNote documents/records into a Mathematica Notebook
https://community.wolfram.com/groups/-/m/t/2817881
Hi;
Having problems selecting the desired document/record from a Microsoft OneNote file into a Mathematica notebook using the SystemOpen[] function - see attachments.
Thanks,
Mitch Sandlin
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/02ca4a65-ae63-44ed-928c-706e8e50ebdbMitchell Sandlin2023-01-27T20:24:04ZAligning a rotated plot with a normal plot
https://community.wolfram.com/groups/-/m/t/2817437
Hi,
I am working on a problem where an electron is subject to a well potential, so I want to be able to have one plot that shows the Energy as a function of x, and another plot beside it that shows transmission and reflection as a function of Energy. I want to line it up like one of my friends has in python (attached).
When I try to rotate a plot in Mathematica, I have had nothing but issues. The closest I have been able to get is using Graphics Row with set image sizes and aspect ratios, but the plots are not at all aligned and this cuts off the axes. I also have not been able to rotate any of the axes ticks on the rotated graph.
Any help you could give me would be much appreciated, thanks!
A minimum working example notebook of my code is attached.
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/6bcaff5f-df75-41ec-80ea-e62f2bbe34d6Kim Owen2023-01-27T03:39:19Z[WELP22] Characterization of Multiway Sequential Cellular Automata
https://community.wolfram.com/groups/-/m/t/2818268
![multiway ca][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=multiway.jpeg&userId=911151
[2]: https://www.wolframcloud.com/obj/981d4774-66a0-4a10-a43e-dd1d36c7c35fWolfram Emerging Leaders Program2023-01-27T18:12:10Z[WELP22] Sub-axiomatic foundations of group theory in SK combinators
https://community.wolfram.com/groups/-/m/t/2818259
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2023-01-27at12.02.03PM.png&userId=911151
[2]: https://www.wolframcloud.com/obj/0579c9ee-9189-4f32-9677-82cce1f65e05Wolfram Emerging Leaders Program2023-01-27T18:06:04Z[WELP22] Modeling ionic currents in cells
https://community.wolfram.com/groups/-/m/t/2818249
![molecule][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=molecule.jpeg&userId=911151
[2]: https://www.wolframcloud.com/obj/edfbb4cb-2dca-4916-aa23-29cf3c6db1cfWolfram Emerging Leaders Program2023-01-27T17:59:09Z[WELP22] Linking changes in stock prices to company events
https://community.wolfram.com/groups/-/m/t/2818081
![stock prices graph][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=stocks.jpeg&userId=911151
[2]: https://www.wolframcloud.com/obj/8992a377-2cce-464c-a8a6-9408a539f2c6Wolfram Emerging Leaders Program2023-01-27T17:00:32Z[WELP22] Simulating media's effects on inflation in a simple economy
https://community.wolfram.com/groups/-/m/t/2818067
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=IMG_5050.jpg&userId=911151
[2]: https://www.wolframcloud.com/obj/969a23b8-7cd2-49ee-acf6-0cf0e6b3b614Wolfram Emerging Leaders Program2023-01-27T16:42:36Z[WELP22] Emotion detection in audio
https://community.wolfram.com/groups/-/m/t/2818058
![classifier ][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2023-01-27at10.31.22AM.png&userId=911151
[2]: https://www.wolframcloud.com/obj/a266d746-090f-445a-a10f-7113b3e76767Wolfram Emerging Leaders Program2023-01-27T16:33:55Z[WELP22] Solving and visualizing word problems
https://community.wolfram.com/groups/-/m/t/2818047
![word problem visulization][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2023-01-27at10.16.43AM.png&userId=911151
[2]: https://www.wolframcloud.com/obj/c1d8840f-8149-4e94-9bf9-6357279e7519Wolfram Emerging Leaders Program2023-01-27T16:24:03ZVideo feedback synthesis
https://community.wolfram.com/groups/-/m/t/2816083
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Videofeedback.png&userId=20103
[2]: https://www.wolframcloud.com/obj/103a8595-e79a-495b-9c80-e7bde1f6ac0aPhileas Dazeley-Gaist2023-01-26T21:05:53ZDisplacements, velocities and animation of a RCCC spatial mechanism
https://community.wolfram.com/groups/-/m/t/2816399
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=RCCCSpatialMechanism2.gif&userId=20103
[2]: https://www.wolframcloud.com/obj/e8e5a0ce-b415-4f62-b506-362064041cd1David Balandra2023-01-27T08:55:10ZLinkObject errors on Windows 10 but not Windows 11, Version 13.2.0
https://community.wolfram.com/groups/-/m/t/2808925
On Windows 10, I get LinkObject errors related to "XML.exe" when using natural language or WolframAlpha input from standard notebooks.
There is no problem on Windows 11.
(WolframAlpha works from the website and from the Windows application).
See the attached notebook "230124 LinkObject Errors.nb", last run on Windows 10.
At the end of the notebook there are screenshots taken from Windows 10 and Windows 11.
I submitted the same question to Wolfram support, but maybe someone here already knows a solution.
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/f617b237-69d7-47cd-a4e9-a91fec839219Werner Geiger2023-01-24T18:10:18ZHow to find all options used for a function?
https://community.wolfram.com/groups/-/m/t/2815426
If I have a custom function with optional values, how can I find **all the options used for a particular call**?
If I write:
ClearAll[f];
Options[f]={opt1->42,opt2->""};
f[x_,options:OptionsPattern[]]:=Module[{},
Row[{"x = ",x,", options: ",options}]
];
f[4711,opt2->"this is opt2"]
(* ==> x = 4711, options: opt2->this is opt2 *)
... I only get the options that were actually used by the caller.
To get all options, I have only found the following solution:
ClearAll[f];
Options[f]={opt1->42,opt2->""};
f[x_,options:OptionsPattern[]]:=Module[{allOptions},
allOptions=First[#]->OptionValue[First[#]]&/@Options[f];
Row[{"x = ",x,", All options: ",allOptions,", Caller options: ",options}]
];
f[4711,opt2->"this is opt2"]
(* ==> x = 4711, All options: {opt1->42,opt2->this is opt2}, Caller options: opt2->this is opt2 *)
This works, but it is not very elegant. Is there a better way?Werner Geiger2023-01-26T11:27:11ZImproved Eulers Method Problem
https://community.wolfram.com/groups/-/m/t/2815256
It is given the following problem:
$$X'=Z+(Y-\alpha)X$$
$$Y'=1-\beta Y-X^2$$
$$Z'=-X-\gamma Z$$
with initial conditions $(X(0),Y(0),Z(0)=(1,2,3)$.
Where
X: interest rate
Υ:investment demand
Z: price index
$\alpha$: savings,
$\beta$: cost per investment,
$\gamma$: the absolute value of the elasticity of demand
```
\[Alpha]=0.9;
\[Beta]=0.2;
\[Gamma]=1.2;
f[x_,y_,z_]:=z+(y-\[Alpha])*x
g[x_,y_,z_]:=1-\[Beta]*y-x^2
h[x_,y_,z_]:=-x-\[Gamma]*z
```
I know how to define a system with two functions so I could use these
- Method A: accuracy of order h
S[a_, b_, h_, N_] := (u[0] = a; u[1] = a + h*b;
Do[u[n + 1] =
2 u[n] - u[n - 1] + h*h*f[n*h, u[n], (u[n] - u[n - 1])/h], {n, 1,
N}])
- Method B: accuracy of order h^2
Q[a_, b_, h_, N_] := (u[0] = a; v[0] = b;
Do[{u[n + 1] =
u[n] + h*
F[u[n] + (h/2)*F[u[n], v[n]],
v[n] + (h/2)*
G[u[n], v[
n]]], \
v[n + 1] =
v[n] + h*
G[u[n] + (h/2)*F[u[n], v[n]], v[n] + (h/2)*G[u[n], v[n]]]}, {n,
0, N}])Athanasios Paraskevopoulos2023-01-26T12:03:14ZIntroduction to numerical methods: discretization of the continuous
https://community.wolfram.com/groups/-/m/t/2816615
I am going to solve some exercises with the Classic Euler's Method and the Improved Euler's method for first-order equations.
The following exercise set is from the book [Mathematica and Applications for Mathematicians, Physicists, and Engineers ][1] by Stephanos Trachanas.
&[Wolfram Notebook][2]
[1]: https://www.cup.gr/book/mathematica-ke-efarmoges/
[2]: https://www.wolframcloud.com/obj/8596eaf1-34d5-4114-9ac4-42faf8c6db91Athanasios Paraskevopoulos2023-01-26T22:00:13ZFree-form input translation to code on cloud-based Mathematica
https://community.wolfram.com/groups/-/m/t/2816056
Hi,
When I use free-form input on my desktop copy of Mathematica, I get a copy of the Mathematica code that it interprets my free-form input as in addition to the output for that code:
![enter image description here][1]
However, on the Wolfram Cloud Mathematica, I only get the final output:
![enter image description here][2]
Is there a way to get the code (e.g., "Plot[x^2, {x,-1.2,1.2}]" from above) on the cloud-based version?
Thanks,
Dan
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2023-01-26at2.05.46PM.png&userId=2816040
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=image002.png&userId=2816040Daniel Visscher2023-01-26T19:10:43ZStudy Aid: Random Second order Differential Equation IVP
https://community.wolfram.com/groups/-/m/t/2815794
While preparing for a Calculus final I grew frustrated with having to find practice problems so I quickly threw this Notebook together.
It generates a random initial value problem for a homogenous linear second order differential equation with constant coefficients and walks through the general strategy for solving such a problem.
The idea is to solve the generated equation by hand and then compare your results as you go along.
I plan to expand the Notebook to handle some typical Inhomogeneities in the near future.
Any and all feedback or suggestions are welcomed and appreciated.
Hope this can be useful to someone in a similar situation to mine.
Good luck !
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/a81846c0-ff51-4cff-8f5e-c57643a36d2cManuel Telleria2023-01-26T19:23:31ZGenerating Art Images from Text
https://community.wolfram.com/groups/-/m/t/2813163
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/279ab60a-024d-44cf-8e6d-77ed9f94fbc6Arnoud Buzing2023-01-25T21:57:18ZSkipped instances using Dynamic
https://community.wolfram.com/groups/-/m/t/2812971
When I execute the following sample code
using a large Map operation and many Graphics3D objects,
the end result (i=20) is shown without showing
the intermediate results (i=1,i=2,..., i=19).
I want to show each and every step. Can someone help?
Dynamic[a]
For[i = 1, i <= 20, i++,
b = RandomReal[{-1, 1}, {10000, 3}];
TextStr = {Text["i=" <> ToString[i], {0, 0, 5}]};
b3g = Map[Sphere[#, 1] &, b];
a = Graphics3D[{TextStr, b3g},
PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}];
]
As a comparison, the sample code below without a large Map operation
and with little Graphics3D objects, each and every individual step is visible.
Dynamic[c]
For[i = 1, i <= 20, i++,
d = RandomReal[{-1, 1}, {10000000, 3}];
TextStr = {Text["i=" <> ToString[i], {0, 0, 5}]};
c = Graphics3D[{TextStr, Sphere[d[[1]], 1]},
PlotRange -> {{-5, 5}, {-5, 5}, {-5, 5}}];
]John Lee2023-01-25T22:28:22ZAn issue of Limit with Bessel function
https://community.wolfram.com/groups/-/m/t/2813749
I have encountered a problem with Limit function.
![enter image description here][1]
As you can see from the graph, this function is finite in x->+0.
However,
Table[
Limit[
FullSimplify[D[BesselI[2, 1/x]/BesselI[1, 1/x], {x, n}]]
, x -> 0
, Direction -> "FromAbove"
]
, {n, 1, 6}
]
returns
{-(3/2), 3/4, 9/4, 189/16, \[Infinity], 85455/64}
It is obvious that the limit will not be infinite,
but Mathematica returns infinity in n=5.
For reference, the true values can be calculated by the following program.
(I have not proven that, but probably correct.)
alpha[k_,
nu_] := (-1)^k/(k! 8^k) Product[4 nu^2 - (2 i - 1)^2, {i, 1, k}];
alpha[0, nu_] := 1;
delta[k_, nu_, mu_] :=
alpha[k, mu] - Sum[delta[m, nu, mu] alpha[k - m, nu], {m, 0, k - 1}];
delta[0, nu_, mu_] := 1;
du[k_] := k! delta[k, 1, 2];
du /@ Range[6]
and we will get:
{-(3/2), 3/4, 9/4, 189/16, 405/4, 85455/64}
Is this behavior a bug of Mathematica?
Sorry if there is something wrong with my English.
Regars,
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=besselgraph.png&userId=2813254aki hiro2023-01-26T04:10:16Z⭐ [R&DL] Wolfram R&D Developers on LIVE Stream
https://community.wolfram.com/groups/-/m/t/2593151
**Join us for the unique Wolfram R&D livestreams on [Twitch][1] and [YouTube][2] led by our developers! Share this with your friends and colleagues:** https://wolfr.am/RDlive
You will see **LIVE** stream indicators on these channels on the dates listed below. The live streams provide tutorials and behind the scenes look at Mathematica and the Wolfram Language directly from developers.
Join our livestreams every Wednesday at 11 AM CST and interact with developers who work on data science, machine learning, image processing, visualization, geometry, and other areas.
----------
⭕ **UPCOMING** EVENTS
- Feb 1 - PDE Modeling by Oliver Ruebenkoenig
- Feb 8 - Video in the Wolfram Language and Mathematica by [Carlo Giacometti][33]
- Feb 15 - Everything to know about Mellin-Barnes Integrals - Part I by [Oleg Marichev][34]
- Feb 22 - Latest features in System Modeler by [Jan Brugard][35]
----------
✅ **PAST** EVENTS
- Jan. 25th -- [Ask Integration Questions to Oleg Marichev][31]
- Jan. 18th -- [My Developer Tools][30]
- Jan. 11th -- [Principles of Dynamic Interfaces][29]
- Dec. 14th -- [Wolfram Resource System: Repositories & Archives][28]
- Dec. 7th -- [Inner Workings of ImageStitch: Image Registration, Projection and Blending][27]
- Nov. 30th -- [Q&A for Calculus and Algebra][26]
- Nov. 23rd -- [xAct: Efficient Tensor Computer Algebra][7]
- Nov. 16th -- [Latest in Machine Learning][8]
- Nov. 9th -- [Computational Geology][9]
- Nov. 2nd -- [Behind the Scenes at the Wolfram Technology Conference 2022][10]
- Oct 26th -- [Group Theory Package (GTPack) and Symmetry Principles in Condensed Matter][11]
- Oct 12th -- [Tree Representation for XML, JSON and Symbolic Expressions][12]
- Oct. 5th -- [A Computational Exploration of Alcoholic Beverages][13]
- Sept. 28th -- [Q&A with Visualization & Graphics Developers][14]
- Sept. 14th -- [Paclet Development][15]
- Sept. 7th -- [Overview of Chemistry][16]
- Aug. 24th -- [Dive into Visualization][17]
- Aug. 17th -- [Latest in Graphics & Shaders][18]
- Aug. 10th -- [What's new in Calculus & Algebra][19]
> **What are your interests? Leave a comment here on this post to share your favorite topic suggestions for our livestreams.**
Follow us on out live broadcasting channels [Twitch][20] and [YouTube][21] and for the up-to-date announcements on our social media: [Facebook][22] and [Twitter][23].
[![enter image description here][24]][25]
[1]: https://www.twitch.tv/wolfram
[2]: https://www.youtube.com/channel/UCJekgf6k62CQHdENWf2NgAQ
[3]: https://community.wolfram.com/web/markusa
[4]: https://community.wolfram.com/web/bobs
[5]: https://community.wolfram.com/web/lou
[6]: https://community.wolfram.com/web/brettc
[7]: https://community.wolfram.com/groups/-/m/t/2713818
[8]: https://community.wolfram.com/groups/-/m/t/2705779
[9]: https://community.wolfram.com/groups/-/m/t/2701172
[10]: https://youtu.be/UrM-OBu3H9o
[11]: https://community.wolfram.com/groups/-/m/t/2678940
[12]: https://community.wolfram.com/groups/-/m/t/2649407
[13]: https://community.wolfram.com/groups/-/m/t/2635049
[14]: https://community.wolfram.com/groups/-/m/t/2618033
[15]: https://community.wolfram.com/groups/-/m/t/2616863
[16]: https://community.wolfram.com/groups/-/m/t/2613617
[17]: https://community.wolfram.com/groups/-/m/t/2605432
[18]: https://community.wolfram.com/groups/-/m/t/2600997
[19]: https://community.wolfram.com/groups/-/m/t/2596451
[20]: https://www.twitch.tv/wolfram
[21]: https://www.youtube.com/channel/UCJekgf6k62CQHdENWf2NgAQ
[22]: https://www.facebook.com/wolframresearch
[23]: https://twitter.com/WolframResearch
[24]: https://community.wolfram.com//c/portal/getImageAttachment?filename=RDAnno_image.png&userId=20103
[25]: https://www.wolfram.com/mathematica/core-areas/
[26]: https://youtu.be/r7Hjdr_D7c4
[27]: https://youtu.be/pYHAz-NatXI
[28]: https://youtu.be/roCkXVkDuLA
[29]: https://community.wolfram.com/groups/-/m/t/2777853
[30]: https://youtu.be/istKGqpDUsw
[31]: https://www.youtube.com/watch?v=wxz_3jqcE_s
[33]: https://community.wolfram.com/web/carlogico
[34]: https://community.wolfram.com/web/oleg1
[35]: https://community.wolfram.com/web/janbCharles Pooh2022-08-05T21:37:19ZHow to shade a portion of a DateListPlot?
https://community.wolfram.com/groups/-/m/t/2812918
I have a databin of heart rates that I can use with `DateListPlot`. Now, say I want to highlight a specific time range in the plot (12 noon to 1 PM) by shading the area of the plot from 12 noon to 1 PM.
Question is, how do I do that shading?
```
DateListPlot[Databin["xxxxxxxxx", {Yesterday, Today}],
"PlotTheme" -> "Detailed", "ImageSize" -> "Large"]
```Steven Buehler2023-01-25T21:37:03ZHow to separate, in a list, symbols and numbers?
https://community.wolfram.com/groups/-/m/t/2815658
Hello
ex= 2.5 x/(y*z)
How to proceed to separate the symbol and the number of the expression above in a list of the type:
{2.5,x(y/z)}
Sincerely,
Sinvalsinval santos2023-01-26T11:51:58ZModify keyboard shortcuts?
https://community.wolfram.com/groups/-/m/t/1682551
Hello,
I am a new user and am trying to learn how to modify keyboard shortcuts.
I am using OSX 10.14 and Mathematica 12.0.
Say the default file is /Applications/Mathematica.app/Contents/SystemFiles/FrontEnd/TextResources/Macintosh/KeyEventTranslations.tr
and the user file is /Users/matt/Library/Mathematica/SystemFiles/FrontEnd/TextResources/Macintosh/KeyEventTranslations.tr
My understanding is I should copy the default file to the user file and then make my changes in the user file. However, whether I make changes in either the default file or the user file, these changes never take effect. For example in *both* files I commented the following line:
```
(* Item[KeyEvent["2", Modifiers -> {Control}], "Radical"], *)
```
And I added something which I copied directly from [this stack post](https://mathematica.stackexchange.com/questions/130790/how-to-clear-all-output-cells-and-run-all-input-cells)
```
Item[KeyEvent["w", Modifiers -> {Control, Shift}],
FrontEnd`FrontEndExecute[{
FrontEnd`FrontEndToken["SelectGeneratedCells"],
FrontEnd`FrontEndToken["Clear"]
}]]
```
However, even after restarting Mathematica, Control-2 still inputs the radical and Control-Shift-W still does nothing.Matt Groth2019-05-13T19:21:03ZHow to 'passcode lock' sections of a notebook?
https://community.wolfram.com/groups/-/m/t/2812815
I use notebooks a lot in teaching, and when the students are interacting with them, I will often have closed-up cell groupings with hints, or answers, to problems I had them first try to work out themselves. It will all be under a subsection or subsubsection heading cell called something like "Hints", and above that I put "Don't open this until you have tried to solve it yourself!"
In live classes, I would like to go a step farther and 'lock' these sections so that I can control when the students open them (so we can do each step of an exercise without them seeing later material which would give the game away). Given all the scope for programmatic notebook manipulation, I'm sure there must be a way to have, say a text input box that responds to a passcode and opens the next closed-up cell grouping. But this is not my forte, so I'm seeking suggestions!Gareth Russell2023-01-25T17:02:26ZHow can I obtain support files required to run a built-in tutorial?
https://community.wolfram.com/groups/-/m/t/2813150
I have installed Mathematica+Documentation (v13.2) on a MacBook Pro in order to explore what appear to be excellent example tutorials on acoustics. In particular, I wanted to experiment with the following built-in example:
PDEModels/tutorial/Acoustics/ModelCollection/RoomEigenfrequencies
I am able to load the notebook, and am able to evaluate some of the initial cells. When I evaluate the first cell, I get the following message:
> Do you want to automatically evaluate all the initialization cells in
> the notebook "RoomEigenfrequencies.nb"?
I click Yes, but encounter an issue when I reach the following cell/code:
furnitureBmesh = Import[FileNameJoin[{
ParentDirectory[
NotebookDirectory[], 6], "SupportFiles", "furniture.stl"}],
"ElementMesh"];
furnitureMesh = ToElementMesh[furnitureBmesh];
RegionPlot3D[furnitureMesh, Sequence[
PlotTheme -> "Detailed", PlotLegends -> None,
AxesLabel -> {"x", "y", "z"}, PlotStyle -> Directive[LightGray],
Mesh -> None, ImageSize -> Medium]]
Evaluating this cell results in the following error message:
> Import::nffil: File
> /Library/Wolfram/Documentation/13.2/en-us/Documentation/SupportFiles/furniture.stl
> not found during Import.
The code above references contents of a directory "SupportFiles" which is specified as a relative path with respect to the tutorial notebook. Checking on my hard drive, the directory "SupportFiles" does not seem to exist (either at the specified relative path or anywhere else in Mathematica-related directories).
I do not know if this is an idiosyncrasy related to this specific tutorial file (which might contain stale references), or if I am missing the directory "SupportFiles" that should have been created when I installed Mathematica.
Any guidance on this question will be appreciated!
RickRichard Hoge2023-01-25T21:54:13ZHow to setup and organize larger paclets as of v13+
https://community.wolfram.com/groups/-/m/t/2708220
## Motivation ##
A typical advice given for writing larger software packages (cf. [here](https://reference.wolfram.com/language/tutorial/BuildingLargeSoftwareSystemsInTheWolframLanguage.html)) is to split your code into smaller components, which are easier to maintain and which are easier to delegate within a team of developers. Nowadays, we are also encouraged to make use of `Paclets` that nicely weave themselves into the installed system (cf. [Paclets Overview](https://reference.wolfram.com/language/tutorial/Paclets.html)). As (hopefully) the number of published paclets in the [Paclet Repository](https://resources.wolframcloud.com/PacletRepository/) grows, naming conflicts will become much more likely than before. That challenge was—according to my understanding—met with the introduction of `PublisherID`s and constructs like ```Needs["context`"-> "alias`"]``` to avoid `$ContextPath` collisions (cf. [Todd Gayley's WTC presentation](https://www.youtube.com/watch?v=tTM8mKPihr0))
In short, we want to:
- organize **larger paclets with a number of sub-packages** that typically have interdependencies (often there is core functionality, that is used by more specialised packages)
- to have a **choice when loading a paclet** of either using ```Needs["PublisherID`PacletName`"]```, putting contexts on the `$ContextPath`, or using ```Needs["PublisherID`PacletName`" -> "alias`"]``` as is recommended these days
## How to do this properly? ##
In the examples I found on GitHub for the `PacletCICD` paclet (e.g., [here](https://github.com/WolframResearch/PacletCICD-Examples-Sample/tree/703cd44d0489c74dcb537cf9b0c8ccc4482cee7a), [here](https://github.com/WolframResearch/PacletCICD-Examples-FewIssues/tree/0bda24a7102da8263f612d6f985d19e8aaa15691/Kernel), and [here](https://github.com/WolframResearch/PacletCICD-Examples-AdvancedSample/tree/375c291023e0f7c6aa9016f2e967fd7a03a72e1f)), there were no interdependencies, e.g., `AddTwo` does not call `AddOne` in the examples. Also, comparable to the deprecated use of an `init.m` file, `Get` is used to load sub-packages putting these contexts on `ContextPath` forfeiting the use of `$ContextAliases`?
Other examples, e.g., those given in the documentation or in the [guidelines for creating paclets](https://resources.wolframcloud.com/PacletRepository/creating-paclets) to be published, unfortunately are rather simple and do not touch multiple sub-packages with interdependencies.
## A first solution and open questions ##
After some experimentation, I came up with the following solution, which I would like to discuss here.
### Paclet Structure ###
Let's assume that our paclet structure on file looks like this:
PublisherID__PacletName/
Kernel/
Core.wl
Special.wl
PacletName.wl
PacletInfo.wl
Where `Special.wl` contains expressions that call upon public expressions contained in `Core.wl`.
#### PacletInfo.wl ####
The `PacletInfo` can be kept _as is_ after using ```Needs["PacletTools`"]``` and `CreatePaclet["PublisherID/PacletName", $HomeDirectory ]`.
PacletObject[
<|
...
"Extensions" ->
{
"Kernel",
"Root" -> "Kernel",
"Context" ->
{
{ "PublisherID`PacletName`" , "PacletName.wl" },
{ "PublisherID`PacletName`Core`", "Core.wl" },
{ "PublisherID`PacletName`Special`", "Special.wl" }
}
},
...
|>
]
#### PacletName.wl ####
The main file loaded when we do ```Needs["PublisherID`PacletName`"]``` later on, will just make that sure the other packages contained in the paclet are loaded and that the public symbols are known. As we keep away from the context path, we will introduce aliases for the full-name references in the ```Private` `` context of that package:
BeginPackage["PublisherID`PacletName`"]
(* load sub-packages for full-name reference only *)
(* evaluate Needs[ ] only when not run by Workbench/Eclipse *)
With[ { mainContext = "PublisherID`PacletName`" },
If[ Not @ MemberQ[ $Packages, "MEET`" ],
(* load sub-contexts *)
Needs[ mainContext <> "Core`" -> None ];
Needs[ mainContext <> "Special`" -> None ]
]
]
(* introduce public symbols of the paclet *)
coreFunc::usage = " ... "
specialFunc::usage = " ... "
Begin["`Private`"]
(* define aliases to reference implementation *)
coreFunc = PublisherID`PacletName`Core`Private`coreFunc
specialFunc = PublisherID`PacletName`Special`Private`specialFunc
End[]
EndPackage[]
#### Core.wl ####
BeginPackage["PublisherID`PacletName`Core`"]
(* Exported symbols added here with SymbolName::usage *)
Begin["`Private`"]
(* Implementation of the package *)
coreFunc[ k_Integer ] := 2 * k (* simple example *)
End[]
EndPackage[]
#### Special.wl ####
BeginPackage["PublisherID`PacletName`Special`"]
(* Exported symbols added here with SymbolName::usage *)
Begin["`Private`"]
(* Implementation of the package *)
specialFunc[ arg_Integer ] := PublisherID`PacletName`coreFunc @ arg
End[]
EndPackage[]
#### Using the installed paclet ###
With the implementation described above, we can use the deployed and installed paclet either doing:
Needs["PublisherID`PacletName`"]
coreFunc[4]
specialFunc[4]
(* 8 8 *)
or
Needs["PublisherID`PacletName`" -> "p`" ]
p`coreFunc[4]
p`specialFunc[4]
(* 8 8 *)
**Note**: During development of a paclet, we would need to do the following, before the paclet is loaded using `Needs[]`:
PacletDirectoryLoad[ paclet_directory ]
PacletDataRebuild[]
Needs[ ... ]
#### Open Questions ####
1. Is what I described here the "proper" way to do this and if not, what is "best practice"?
2. Is there a way to avoid the need of full-name references in a DRY (do not repeat yourself) kind of fashion?
3. Is there something comparable to `ParallelNeeds` or do we have to `DistributeContexts` to support parallelization?
----------
### REVISIONS ###
I would like to keep this up to date, so that any improvement to THIS way of setting up larger paclets will be included in this post.
#### Context information should be provided for all sub-contexts as well ####
As Jason pointed out below, it seems that `PacletInfo.wl` should inform about *all* contexts. I have added this information now in the explicit form ```{ "context`", filename }``` should the filename be obtainable by simply adding `.wl` or `.m` it may suffice to simply provide a list of contexts.
#### Usage messages need to be introduced in the PacletName` context
We need to have usage messages in the context `` PublisherID`PacletName` `` or they will not be shown. Since we are using full-name references we can immediately refer to `` `Private` `` context in `` PublisherID`PacletName`Private` `` <s>or to refer to the public context of a sub-package, so that the symbol needs to be made public there</s>.
#### Sub-packages do not need to load main context with Needs[ ]
Since the main package will load all sub-packages to allow full-name reference to implementations, there is no need to use `Needs[ ]` in the sub-packages.
#### Evaluate Needs[ ] only when not run by Workbench/Eclipse ####
The current plugin for Eclipse will automatically load the files in the `Kernel/` directory (maybe this observation can be commented upon by WRI?) and thus the `Needs[ ]` statements for loading sub-packages should only be evaluated if the context ``Meet` `` is not listed among `$Packages`. Then everything works out nicely in Workbench/Eclipse. ;-)Guido Wolf Reichert2022-11-22T16:47:59ZModeling the Rolling Shutter Effect
https://community.wolfram.com/groups/-/m/t/2809149
![enter image description here][1]
Some years back, I saw a pair of excellent blog posts on The Rolling Shutter Effect ([here][2] and [here][3]). The Rolling Shutter Effect is a form of distortion that can appear in photographs taken on a phone, since phone cameras typically capture frames by scanning across a scene horizontally/vertically over a period of time instead of capturing the entire scene at the same instant. When the subject of the photograph is static or slow-moving, this method of recording an image does not cause a problem. But for a fast-moving object such as an airplane propeller, a rolling shutter can produce fascinating forms of distortion. For example, here's an image of an airplane propeller captured by a Pixel 3:
![Rolling Shutter Effect on Airplane Propeller][4]
Source: [Wikipedia][5]
In order to model the effect, I started with a plot of an "airplane propeller." I used the polar equation r = 3 cos(5θ):
![enter image description here][6]
Now we can make the make the propeller spin by writing r = 3 cos(5(θ+time)) for some fixed value "time":
![spinning propeller][7]
Next, let's get the rolling shutter into the mix. We'll start with a horizontal line at y = 3 that moves down as time progresses. This can be written as y= 3 - time. We will also adjust our propeller equation to be r = 3 cos(5(θ+time/s)). The newly introduced s is a factor that is meant to represent the fact that the rate at which the shutter moves may differ from the rate at which the propeller rotates. We are putting the s with the propeller since we are treating the speed of our rolling shutter as a constant while the speed of the propeller may vary:
![propeller with shutter][8]
In order to simulate The Rolling Shutter Effect, it will be helpful to switch to a Cartesian plot instead of a polar plot. First rewrite r = 3 cos(5(θ+time/s)) as 1 = ((3 cos(5θ))/r). Then substitute in r = Sqrt[x^2+y^2] and θ = arctan(x,y) to get 1 = ((3 cos(5(arctan(x,y)+time/s)))/Sqrt[x^2+y^2]) . We can plot this using a contour plot:
![contour plot][9]
Finally, we need to find the "distorted" plot that is left behind after the shutter passes. We are looking for the locus of points intersecting the shutter y = 3 - time. Solving for time gives us time = 3 - y. Further, in polar coordinates, y = r sin(θ), so time = 3-r sin(θ). In rectangular coordinates, we also substitute in r = Sqrt[x^2+y^2] and θ = arctan(x,y). Let's substitute all of this into our contour plot from above, (3 cos(5 (arctan(x,y)+time/s)))/Sqrt[x^2+y^2]=1:
(3 cos(5 (arctan(x,y)+(3 - Sqrt[x^2+y^2] sin(arctan(x,y)))/s)))/Sqrt[x^2+y^2]=1
This looks like a mess, but let's plot an example for s = 0.8 to see if the result appears reasonable:
![example of distorted output][10]
This looks exactly like the type of plot we expect. Let's put it all together to see. Here's the code with some better styling and some optimization to make sure that the Manipulate precomputes the distorted image:
Manipulate[
Graphics[{Dynamic@
First@ContourPlot[(
3 Cos[5 (
ArcTan[x, y] + (3 - Sqrt[x^2 + y^2] Sin[ArcTan[x, y]])/
s)])/Sqrt[x^2 + y^2] == 1, {x, -5, 5}, {y, -5, 5},
PlotPoints -> 50, ContourStyle -> Green,
PlotRange -> {{-3, 3}, {-3, 3}}],
Dynamic@First@Graphics[{Black, Rectangle[{-3, 3 - time}, {3, -3}]}],
Dynamic@
First@ParametricPlot[
3 Cos[5 (\[Theta] + time/s)] {Cos[\[Theta]],
Sin[\[Theta]]}, {\[Theta], 0, Pi}, PlotStyle -> Red,
RegionFunction -> Function[{x, y, \[Theta]}, y < 3 - time]],
Dynamic@First@Graphics[Line[{{-3, 3 - time}, {3, 3 - time}}]]},
Axes -> False, PlotRange -> {{-3, 3}, {-3, 3}},
Background -> Black], {time, 0, 6}, {{s, 0.8}, 0.3, 4},
ControlPlacement -> Top]
And the final animation:
![animation with rolling shutter][11]
Sliding the s-slider to the left speeds up the propeller relative to the speed of the rolling shutter, thus increasing the intensity of the effect:
![enter image description here][12]
Sliding the s-slider to the right slows down the propeller, which decreases the amount of distortion:
![enter image description here][13]
## Download Notebook
I've included my original notebook if you'd like to play with the code yourself.
&[Wolfram Notebook][14]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=f26bf3cf-38e1-44fa-9451-ed1b10e4a2a3.gif&userId=20103
[2]: https://danielwalsh.tumblr.com/post/54400376441/playing-detective-with-rolling-shutter-photos
[3]: https://jasmcole.com/2014/10/12/rolling-shutters/
[4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Propellor_with_rolling-shutter_artifact.jpg&userId=855128
[5]: https://en.wikipedia.org/wiki/Rolling_shutter#/media/File:Propellor_with_rolling-shutter_artifact.jpg
[6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=37761.PNG&userId=855128
[7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=2.gif&userId=855128
[8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=3.gif&userId=855128
[9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=4.gif&userId=855128
[10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=5.PNG&userId=855128
[11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=6.gif&userId=855128
[12]: https://community.wolfram.com//c/portal/getImageAttachment?filename=7.gif&userId=855128
[13]: https://community.wolfram.com//c/portal/getImageAttachment?filename=8.gif&userId=855128
[14]: https://www.wolframcloud.com/obj/fa2e2fe9-1be9-4d74-9270-11f253a248f5Christopher Grattoni2023-01-24T22:13:29ZImaging a rotating disk with a rolling shutter
https://community.wolfram.com/groups/-/m/t/2542490
![enter image description here][1]
The excellent [community contribution][2] by [@Greg Hurst][at0] and a Wikipedia [animation][3], Inspired me to look further into this "rolling shutter effect on rotating objects".
When we capture a video of a rotating disk with a rolling shutter, we have two independent movements: the colored disk rotating at *rps revolutions per second* and the shutter line sweeping one frame at *fps frames per second*. The ratio rps/fps is the driver of the rolling shutter effect (or the disk rps alone if we normalize the shutter fps to 1 frame per second). In order to best demonstrate this effect, ratios of rps/fps are taken to be in the range 1.5-2.5
This is a colored disk of m pixels wide, rotated over an angle theta.
colors = {RGBColor[1, 0, 1], RGBColor[0.988, 0.73, 0.0195], RGBColor[
0.266, 0.516, 0.9576], RGBColor[0.207, 0.652, 0.324], RGBColor[
0, 0, 1], RGBColor[1, 0, 0]};
colorDisk[theta_, m_, cols_] :=
ImageResize[
Image[Graphics[
MapThread[{#3,
Disk[{0, 0}, 1, {#1, #2} + theta]} &, {Pi Range[0, 5, 1]/3,
Pi Range[1, 6]/3, colors}]]], m]
A video of the rotating disk consists of a series of frames. Each frame is captured during one passage of the shutter line. The function *angularPosition* links the angular progress of the disk to the frame number (frm) and the row number at the position of the shutter line:
angularPosition[frm_, row_, rps_,
m_] := -2 Pi (-1 + (-1 + frm) m + row) rps/m
Th function *diskFrameImage* computes the result of the shutter line swiping a colored disk (of size m, rotating at rps revolutions per second) at frame number frm and up to row number toRow:
diskFrameImage[frm_, toRow_, rps_, m_, cols_] :=
ImageAssemble[
Transpose@{ParallelTable[
ImageTake[
colorDisk[angularPosition[frm, r, rps, m], m, colors], {r}], {r,
toRow}]}]
This is the first frame of a video of a disk rotating at a speed ratio rps/fps of 1 :
With[{m = 200, frm = 1, rps = 1},
diskFrameImage[frm, m, rps, m, colors]]
![enter image description here][4]
This shows the influence of the disk rps/fps ratio on the appearance of the first frame captured:
With[{m = 200, frm = 1},
Grid[{{"rps=0.512", "rps=1.512", "rps=2.512"},
diskFrameImage[frm, m, #, m, colors] & /@ {.512, 1.512, 2.512}}]]
![enter image description here][5]
Below is a GIF showing the capture of the first frame of a disk rotating at rps/fps 1. The code is used to generate all of the following GIFs.
With[{m = 200, frm = 1, rps = 1.},
Animate[
Grid[{{
ImageCompose[
colorDisk[angularPosition[frm, row, rps, m], m, colors],
Graphics[Line[{{-m, 0}, {m, 0}}]], Scaled[{.5, (m - row)/m}]],
ImageCompose[diskFrameImage[frm, row, rps, m, colors],
Graphics[Line[{{-m, 0}, {m, 0}}]], Scaled[{.5, .01}]]}},
Alignment -> Top], {row, 1, m}]]
![enter image description here][6]
Below are 4 examples showing the capture of the first frame of a video of a rotating disk with a roller shutter at 1fs. The disk rotates at 0.5 rps (top left), 1.0 rps (top right), 1.5 rps (bottom left) and 2.0 rps (bottom right). As the disk rotates faster relative to the shutter, the captured image becomes more complex.
![enter image description here][7]
![enter image description here][8]
The subsequent frames are captured the same way. Below are the first 5 frames of a video of a disk rotating at 1.5123 rps:
![enter image description here][9]
There ought to be a lot more images that result from the transformation of a rotation into a capture with a rolling shutter. I hope this contribution can inspire more community members.
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=combirotodisk15and2.gif&userId=20103
[2]: https://community.wolfram.com/groups/-/m/t/2489445
[3]: https://upload.wikimedia.org/wikipedia/commons/1/15/Rolling_shutter_effect_animation.gif
[4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=8345locusfulldiskrps1.png&userId=68637
[5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=9528colordiskrpscompare.png&userId=68637
[6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=newrotodiskfrm1rps05small.gif&userId=68637
[7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=combirotodisk05and10.gif&userId=68637
[8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=combirotodisk15and2.gif&userId=68637
[9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=allframesvideofinal.gif&userId=68637
[at0]: https://community.wolfram.com/web/ghurstErik Mahieu2022-06-02T12:22:57ZRolling Shutter III
https://community.wolfram.com/groups/-/m/t/2543358
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=RollingShutter.png&userId=32203
[2]: https://www.wolframcloud.com/obj/1e1707bd-173c-44cc-9c44-a39437aad23eHenrik Schachner2022-06-04T00:02:21ZAirplane propellers imaged with a rolling shutter
https://community.wolfram.com/groups/-/m/t/2489445
![enter image description here][1]
Most cell phone cameras capture an image using a [rolling shutter](https://en.wikipedia.org/wiki/Rolling_shutter). This means an image is not captured all at once but rather is captured with a scrolling line, either horizontally or vertically.
This scrolling is fast and in most situations is not noticeable. But for a scene with motion rivaling the camera's scroll speed, things will look distorted. A fast moving car might look sheared, squished, or stretched, and a spinning propeller looks quite strange.
To see how the strange pattern in the above image appears, let's start off by idealizing a propeller as a [trifolium](https://mathworld.wolfram.com/Trifolium.html) in polar coordinates:
```
propeller[θ_] := Sin[3θ + π/2];
PolarPlot[propeller[θ], {θ, 0, 2π}]
```
<img src="https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2022-03-13at7.54.29PM.png&userId=46025" width="150">
Now as the scrolling happens, each scroll line will be looking at a _different_ rotated version of the propeller. In polar coordinates that's just a shift in angle, e.g. `propellar[θ + shift]`. If we assume the camera scrolls in the x (horizontal) direction at a constant speed, then the shift value will be a constant times x.
For this example we'll assume the propeller makes 2.25 revolutions in the time the camera completes the scrolling. Now that we've mixed polar and Cartesian, we'll switch to `RegionPlot`:
```
revs = 2.25;
plot = With[{r = Sqrt[x^2 + y^2], θ = ArcTan[x, y]},
RegionPlot[
r <= propeller[θ - π*revs*x],
{x, -1, 1}, {y, -1, 1},
Frame -> None,
PlotPoints -> 100
]
]
```
<img src="https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2022-03-13at8.02.21PM.png&userId=46025" width="360">
We can get an intuitive feel for why this happens by simulating the rolling shutter ourselves:
```
Manipulate[
Show[
plot,
Graphics[{{EdgeForm[], White, HalfSpace[{-1, 0}, {t, 0}]},
{Thick, Black, InfiniteLine[{{t, 0}, {t, 1}}]}}],
PolarPlot[
propeller[θ - π*revs*t],
{θ, 0, π},
RegionFunction -> Function[{x, y, r, θ}, x > t],
PlotStyle -> Red
]
],
{t, -1, 1}
]
```
![enter image description here][2]
Lastly, we can simulate what a video of a spinning propeller would look like. Essentially each frame of the video would contribute a constant shift to θ (unlike the how the scrolling's shift depends on x).
```
Monitor[
plots = With[{r = Sqrt[x^2 + y^2], θ = ArcTan[x, y]},
Table[
RegionPlot[
r <= propeller[θ - π*revs* x + α],
{x, -1, 1}, {y, -1, 1},
Frame -> None
PlotPoints -> 100
],
{α, 0, 2π, π/20}
]
];,
α
]
```
Omitting the code for styling and coloring each propeller differently, here's the result:
![enter image description here][3]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=rolling_shutter_small.gif&userId=46025
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=screenshot3.gif&userId=46025
[3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=rolling_shutter_spinning.gif&userId=46025Greg Hurst2022-03-14T00:36:12ZAnimating Wolfram surfaces with Blender: Stones & Gallery
https://community.wolfram.com/groups/-/m/t/2812850
![enter image description here][1]![enter image description here][2]
&[Wolfram Notebook][3]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=gallery64_small.gif&userId=20103
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=stones64_small.gif&userId=20103
[3]: https://www.wolframcloud.com/obj/b704e9c1-d1af-40da-9a52-621b7113d3ccGuenther Gsaller2023-01-25T18:08:41ZWhy are book text interactive demonstrations not working?
https://community.wolfram.com/groups/-/m/t/2809136
I'm taking the Calculus course and on page one, there are multiple illustrations of what's being talked about with interactive buttons and all that, but the whole thing is broken and when the interactive sliders do appear they don't change anything that's being displayed. I encountered it first on Chrome, and then switched to Brave browser and it's the same exact problem.Arcadius Wowczuk2023-01-24T21:43:45ZHow to create a point on a circle in Descarta2D?
https://community.wolfram.com/groups/-/m/t/2718578
I'm a begginer and I need to build a single point on a Circle in Descarta2D, but I don't know how.
I tried to intersect a line and the circle and define the point formed, but also the Descarta2D gave an error. Can someone help and explain how can I do it?Ale Alexa2022-12-06T18:17:55ZSpace filling structure around rhombic triacontahedron (RT)
https://community.wolfram.com/groups/-/m/t/2615124
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/6cdfe0ad-3690-4aad-9e7c-6c88eb69a853Sandor Kabai2022-09-11T20:59:21ZStephen Wolfram on The UIUC Talkshow
https://community.wolfram.com/groups/-/m/t/2809317
During the Wolfram Tech Conference last Fall, we got a chance to have a conversation with Dr. Wolfram at HQ. During the conversation, we touched upon topics ranging from questioning the current educational institutions and learning how to think, to the importance of history and analyzing human civilization from the perspective of alien intelligence. The conversation was honestly so diverse and fascinating that I cannot summarize it in one post.
![enter image description here][1]
We have finally published the conversation on [YouTube][2] (and [Spotify][3]) for everyone to see.
&[Wolfram Notebook][4]
We all know that Dr. Wolfram already has thousands of hours of recordings published online, but this one is unique because he touched upon some topics he has never talked about before.
I hope it inspires you the way it inspired us.
(Special shoutout to everyone at Wolfram who made this possible!)
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=wolfram.jpg&userId=2809302
[2]: https://youtu.be/cShewypo7PY
[3]: https://open.spotify.com/episode/3Dwe790LVocnfMrTqth7Ce?si=3fcc32f377a34096
[4]: https://www.wolframcloud.com/obj/e96a3ec7-9956-40ff-b9b5-23d2e8df42b5Aaryaman Patel2023-01-24T23:39:43ZMathematica Beyond Mathematics: The Wolfram Language in the Real World
https://community.wolfram.com/groups/-/m/t/2801704
It is a pleasure to announce the second edition of the book: Mathematica Beyond Mathematics: The Wolfram Language in the Real World is available.
https://www.routledge.com/Mathematica-Beyond-Mathematics-The-Wolfram-Language-in-the-Real-World/Sanchez-Leon/p/book/9781032004839
The first edition has been highly valued (4.7 of 5).
This new edition includes a detailed discussion of the new capabilities added to the latest version of Mathematica (version 13), and introduces new topics related to machine learning, big data, finance, economics, and physics. The examples strike a balance between relevance and difficulty in terms of Mathematica syntax, allowing readers to incrementally build-up their Mathematica skills as they go through the chapters. While reading this book, you will also learn more about the Wolfram Language and how to use it to solve a wide variety of real-world problems.
Online supplementary materials, including code snippets used in the book and additional examples, are available in the book’s website: http://www.mathematicabeyondmathematics.com/
Thanks you. J. Guillermo SanchezJOSÉ GUILLERMO SÁNCHEZ LEÓN2023-01-22T09:08:16ZComputing functions and simultaneously produce markup language
https://community.wolfram.com/groups/-/m/t/2805032
My goal is to have all values and units show on both sides of the equation in traditional form. As and example I am using coulomb's law to calculate the magnitude of an electric field for specific distances. At the same time I am trying to create markup language level text and outputs for reporting and sharing. This is just a simple example. However the main divisor line seems to have a mind of its own (undefined behavior? or I'm just new at this). Here is my take on the example with the second to last output being close but not good enough:
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/f965f5d9-b271-4d3a-85ec-20e163bdef5cEd di Girolamo2023-01-23T18:58:14Z