Community RSS Feed
https://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions from all groups sorted by activeBlank plot of complex polynomial equation solution?
https://community.wolfram.com/groups/-/m/t/2295297
Dear All,
I have a code for a complex polynomial equation which I'm trying to plot solving its real and imaginary parts separately. While I try to plot it gives me a blank plot.
I need your valuable advice which can help me immensely in solving the same.
Please advice me.
The code is as attached herewith.
rgdsRahul Chakrabory2021-06-22T11:58:26ZUnexpected limit result from Wolfram|Alpha?
https://community.wolfram.com/groups/-/m/t/2237030
lim (x,y)->(0,0) 2xy^2/(x^4+y^2) is not D.N.E, it should goes to 0Xinbo Wang2021-04-04T18:20:29ZFinding the maximum of an NDSolve output over different time intervals?
https://community.wolfram.com/groups/-/m/t/2298667
Hello everyone,
I am trying to find the maximum of an NDSolve output for different time intervals. For instance, imagine we have the following list of time intervals {{0,100},{100,342},{342,510}}. Is there a way to numerically solve the system of ODEs below; find the maximum value occurring within each interval in the list above; and put each of those maxima into a common list?
a=0.03; c=0.5; K=1000; g=1; NDSolve[{h'[t]==y[t]*(1-h[t]/K)-a*h[t],y'[t]==y[t]*(1-c*g)*(1-h[t]/K)+y[t]*g*(1-c*g)*(1-h[t]/K)-y[t]*(x[t]+y[t])/K,x'[t]==x[t]*h[t]/K-x[t]*(x[t]+y[t])/K,y[0]==1,x[0]==K,h[0]==K},{h[t],x[t],y[t]},t]Alex L2021-06-24T23:41:36Z[WSS20] Classifier for predicting surgical site infections
https://community.wolfram.com/groups/-/m/t/2028857
![user interface][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=HDCSSIScreenShot.jpeg&userId=1992875
[2]: https://www.wolframcloud.com/obj/d02bc448-c0a3-4360-bf25-faa1405cd28eJohn Cromwell2020-07-14T15:52:27ZSpeed up evaluation time of a code
https://community.wolfram.com/groups/-/m/t/2279210
Hello ,
I hope everyone is ok at Corona virus times. I would like to speed up my attached code.
For large K's and the small values of T/M, my code runs slowly.
Please do not hesitate to ask me anything.
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/88dfdbc0-1afb-44db-ae1a-116102a0f287Vedat Erturk2021-05-30T19:25:49ZEstimation of the position and value of a peak point
https://community.wolfram.com/groups/-/m/t/2296745
Hi,
We know that the value of the 20th peak point is 38.60.
If I want to estimate the position and also the value of this point based on previous peak points.
How do I that?
data = {45.070711725125555`, 53.498297934722096`,
29.584510552747492`, 11.151690956807158`, 11.189625653415481`,
25.285839036082518`, 28.057908240982226`, 23.56037341335459`,
27.359877903104667`, 23.136393135264058`, 20.52783862787402`,
34.12780683174508`, 42.99141335930445`, 44.57290718131107`,
25.58296670347263`, 12.519024579537946`, 8.813650190806353`,
17.823927962891695`, 37.99345093666351`, 38.609478630177335`,
36.80195533249116`, 26.344280857176376`};
FindPeaks[data]
{{2, 53.4983}, {7, 28.0579}, {9, 27.3599}, {14,
44.5729}, {20, 38.6095}}
ListLinePlot[{data, FindPeaks[data]},
Joined -> {True, False},
PlotStyle -> {Automatic, {Red, PointSize[.02]}}]
![enter image description here][1]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=6485Untitled.png&userId=1822915Alex Teymouri2021-06-23T20:36:47ZDrawing lines and other geometrical shapes on a trading or financial chart?
https://community.wolfram.com/groups/-/m/t/2298110
I believe this to be a straightforward question to which I have not found an answer. I am interested in drawing my own graphics on top of a TradingChart or InteractiveTradingChart. Most importantly, I would like to draw my own lines or functions onto the aforementioned charts.
Yes, I have read the documentation on ChartElementFunction, on FinancialIndicator(s) and cannot see if it is even possible to simply draw a line on a TradingChart or InteractiveTradingChart. For instance, I have a designed and implemented a program that can locate all the possible Elliott Waves in a stock movement (Intraday, daily, weekly, monthly or any other scale you care to look at). From those waves, I can detect patterns such as Bat, Butterfly, Retracement, etc... from the Harmonic Trader book by Scott Carney.
I have read about the Line[] function, but it draws on its own chart. I wish there were a function that would take the endpoints of the line as well as the Chart as arguments to draw on the chart.
I would like to display the patterns I find on the appropriate stock chart to check the correctness of the algorithms as well as display alerts and setup events like "Buy", "Sell" or "Hold".
Does anyone know of any function that can draw a Line on an already existing chart? Even better would be being able to draw geometrical shapes, but I will be happy with just drawing lines.Henrick Jeanty2021-06-24T02:15:27ZWeb scraping and crawling for open e-books in nested web sites
https://community.wolfram.com/groups/-/m/t/2296244
&[Wolfram Notebook][1]
----------
*MODERATOR NOTE.* *Sources have varying rules and terms associated with accessing and compiling their data, which should be strictly adhered to (as well as those of Wolfram software @ https://www.wolfram.com/legal .*
[DON'T DELETE: Original Notebook]: https://www.wolframcloud.com/obj/a52e4675-031c-4b59-bc1b-827bee0ec4a7
[1]: https://www.wolframcloud.com/obj/59fec5d5-4cc1-4f7f-9dd6-a6de64860830Daniel Carvalho2021-06-23T04:21:13ZUsing CoefficientArrays to Invert simultaneous equations
https://community.wolfram.com/groups/-/m/t/2298238
The table obtained via the CoefficientArrays command of a list of vector equations does not seem to result in 3x3 Matrix as the coefficients of the original simultaneous equations.
I tried using LinearSolve to invert the simultaneous equations, and I faced the same issue.
`(*Deformation Equations*)
X = {X1, X2, X3};
x = {x1, x2, x3};
Eulerian = {e^-\[ScriptT]*x1 + 0*x2 + (e^-\[ScriptT] - 1)*x3,
0*x1 + x2 + (e^-\[ScriptT] - e^\[ScriptT])*x3, 0*x1 + 0*x2 + x3}
CoefficientArrays[Eulerian, {x1, x2, x3}]
Normal[%] // MatrixForm
Take[%, {2}] // MatrixForm
q = Flatten[%, 1] (* q is the Coefficients Matrix of x *)
q // MatrixForm
qInv = Inverse[q] // MatrixForm (* Eulerian in terms of q *)
x = qInv . X(* Lagrangian Form *)
(* Velocity Vector Field*)
v = D[x, \[ScriptT]] // MatrixForm(* Material derivative*)`Aslam Kittur2021-06-24T07:51:02ZPutting all extrema of an NDSolve output into a single list?
https://community.wolfram.com/groups/-/m/t/2297359
Hello everyone,
I am trying to put all of the extrema of an NDSolve output into a single list. Specifically, I am hoping to have the extrema listed in order. For instance, in the case of an oscillatory system, I would hope to have a list like the following: {Maximum 1, Minimum 1, Maximum 2, Minimum 2,...}. Is there an efficient way to accomplish this? Attached is a notebook showing the system of equations I am working with.Alex L2021-06-24T05:03:10ZList manipulation with DateObject
https://community.wolfram.com/groups/-/m/t/2297795
I work with a list containing DateObjects. I want to transform the dateobject to a "Month". The list contains 6 parts.
Fot simplicity, the list looks like:
test = {{"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F", 21.95} , {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F", 21.95} , {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F", 21.95} , {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F", 21.95} , {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F", 21.95} , {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F", 21.95}};
The transformation rule is like:
test /. {a_, b_, c_, d_, e_, f_} -> {a, b, DateObject[c, "Month"], d, e, f};
The output is:
{ {"ASX", 15, DateObject[{2021, 3, 8}], "buy", "F", 21.95} , {"ASX", 15, DateObject[{2021, 3, 8}], "buy", "F", 21.95} , DateObject[{"ASX", 15, DateObject[{2021, 3, 8}], "buy", "F", 21.95}, "Month"] , {"ASX", 15, DateObject[{2021, 3, 8}], "buy", "F", 21.95} , {"ASX", 15, DateObject[{2021, 3, 8}], "buy", "F", 21.95} , {"ASX", 15, DateObject[{2021, 3, 8}], "buy", "F", 21.95}}
It goes wrong with the third element of the list.
DateObject[{"ASX", 15, DateObject[{2021, 3, 8}], "buy", "F", 21.95}, "Month"]
When the original list contains 5 elements or 7 elements, the output is correct. When the list contains the same number of elements as the parameters a_, b_, ... f_ then something goes wrong.
For example:
test5 = {{"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F",
21.95}, {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F",
21.95}, {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F",
21.95}, {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F",
21.95}, {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F",
21.95}};
test5 /. {a_, b_, c_, d_, e_, f_} -> {a, b, DateObject[c, "Month"], d, e, f}
test7 = {{"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F",
21.95}, {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F",
21.95}, {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F",
21.95}, {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F",
21.95}, {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F",
21.95}, {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F",
21.95}, {"ASX", 15, DateObject[{2021, 03, 08}], "buy", "F",
21.95}};
test7 /. {a_, b_, c_, d_, e_, f_} -> {a, b, DateObject[c, "Month"], d, e, f}
The transformations with 5 and 7 elements in de list are correct. When the list containts 6 elements, it's goes wrong.
When I use a different a transformation like
Map[ {#[[1]], #[[2]], DateObject[#[[3]], "Month"], #[[4]], #[[5]], #[[6]]} &, test]
Then I don't have any problem.
I would like to understand what's wrong with the first transformation, and why it goes wrong when there is a relation with the number of elements in the list. Anyone a suggestion?Michiel van Mens2021-06-24T08:10:23ZHow to graph a series of complex exponential Fourier?
https://community.wolfram.com/groups/-/m/t/2298213
Greetings,
I am new to Wolfram, I have a problem, I need to graph this Fourier series in exponential form, but my variable k is in the denominator, this gives me an error, and as it seems it is because at some point my variable k takes a value of zero, creating an indeterminacy.
Could you help me solve this problem please, I THANK YOU VERY MUCH.
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/3e5f7838-8bcf-4caf-b782-e5f9189a3414WILLIAM DOICELA2021-06-24T04:20:50ZWill version 13 feature some modules on Discrete Differential Geometry?
https://community.wolfram.com/groups/-/m/t/2298518
Mathematica already packs some nice and strong functionality to handle meshes and it is probably an area that will be expanding in the upcoming versions. I am quite curious to know from the computational geometry development team whether there are any plans to incorporate the tools/functionality for handling discrete differential geometry in the future version 13.
There are extensive libraries which can be integrated with Mathematica to expand its computational geometry based functionality:
https://www.cgal.org/ and https://www.cs.cmu.edu/~kmcrane/index.html#code and https://www.cs.cmu.edu/~kmcrane/Projects/DDG/
Some features that will be indispensable to have would be:
1. Computing discrete gradients of volume and surfaces at the mesh vertices
2. determining Gaussian and Mean curvatures of a mesh
3. implementing Half-edge structures
4. Curvature Flow
5. represent vector fields on meshes
It would be great if someone from the development team can engage here or provide some kind of a roadmap for the functionality in sight for discrete differential geometry.Ali Hashmi2021-06-24T13:11:14ZFederated learning support in the Wolfram ecosystem
https://community.wolfram.com/groups/-/m/t/2298275
Is anyone aware of Wolfram working on adding support for federated learning for model training or any external packages for this purpose?
With Wolfram's great support for the cloud and for the ease at which one can move data between client and cloud, the ability to aggregate parameters from multiple independently trained models would be a killer application for Wolfram, particularly when moving local datasets is inefficient or in highly regulated environments where data sharing is problematic.John Cromwell2021-06-24T13:08:23ZBuilding a GPS tracker with the Raspberry Pi
https://community.wolfram.com/groups/-/m/t/157461
This post shows how to build a simple GPS tracker with the Wolfram Language on a Raspberry Pi.
To recreate this experiment you will need the following hardware (in addition to the Raspberry Pi itself):
[list]
[*][url=http://www.adafruit.com/products/746]Ultimate GPS Breakout[/url]
[*][url=http://www.adafruit.com/products/954]USB to TTL serial cable[/url]
[*][url=http://www.adafruit.com/products/954][/url][url=http://www.adafruit.com/products/64]Half-size bread board[/url]
[*][url=http://www.adafruit.com/products/758]Male/male jumper wires[/url]
[/list]Plug the GPS module into the breadboard as shown and connect red to VIN, black to GND, green to RX and white to TX, using the jumper wires and the USB to TTL serial cable. Plug the USB end of the cable into the Raspberry Pi (powered down). Power up your Raspberry Pi.
[img=width: 512px; height: 384px;]/c/portal/getImageAttachment?filename=1-out.jpg&userId=11733[/img]
The GPS module starts to transmit data shortly after power up and will continue to do so until it is unplugged from a power source.
In a terminal start the Wolfram Language using the following command:
[code]> wolfram
Wolfram Language (Raspberry Pi Pilot Release)
Copyright 1988-2013 Wolfram Research
Information & help: wolfram.com/raspi
In[1]:=
[/code]
You can now open the serial port using the [url=reference.wolfram.com/language/ref/DeviceOpen.html]DeviceOpen [/url]by entering:
[mcode]serial = DeviceOpen["Serial",{"/dev/ttyUSB0","BaudRate"->9600}]
[/mcode]
This returns a DeviceObject which can be used to read GPS data from. In this case we use [url=http://reference.wolfram.com/language/ref/DeviceReadBuffer.html]DeviceReadBuffer [/url]to read all available GPS data that has been generated up to this point:
[mcode]data = DeviceReadBuffer[serial,"String"]
[/mcode]
The data returned is in a comma separated format, called [url=http://aprs.gids.nl/nmea/]GPS NMEA sentences[/url].[code] $GPRMC,154541.000,A,4005.8369,N,08814.7322,W,0.04,253.32,201113,,,A*79
$GPVTG,253.32,T,,M,0.04,N,0.07,K,A*3B
$GPGGA,154542.000,4005.8369,N,08814.7322,W,1,8,1.07,228.0,M,-33.9,M,,*6B
$GPGSA,A,3,04,12,10,17,23,24,25,02,,,,,1.31,1.07,0.76*04
$GPGSV,3,1,12,04,65,040,24,02,63,265,16,10,55,135,39,12,48,302,21*7D
$GPGSV,3,2,12,17,35,096,33,05,19,190,17,25,13,321,33,24,12,247,16*71
$GPGSV,3,3,12,23,05,061,31,13,02,090,27,20,02,036,35,45,,,*45
$GPRMC,154542.000,A,4005.8369,N,08814.7322,W,0.06,253.32,201113,,,A*78[/code]
We can import the data with the Wolfram Language using ImportString:[mcode]csv = ImportString[ data, "CSV" ][/mcode]
The NMEA sentences which contain GPS coordinates start with $GPRMC so we filter for those using Cases and pattern matching:[mcode]gps = Cases[ csv, {"$GPRMC", ___} ][/mcode]
The coordinates (latitude and longitude) are in the 4th and 6th position of each list, for example this is the GPS coordinate for the first data point:[mcode]Part[ gps, 1, {4,6} ] / 100[/mcode]
which returns the GPS location for Champaign, Illinois, where Wolfram Research is located 40' North, 88' West):[mcode]{40.0583, 88.1474}
[/mcode]Arnoud Buzing2013-11-21T17:10:15ZPlotting graphs with manipulate: empty plots
https://community.wolfram.com/groups/-/m/t/2296801
Hello Together,
I am currently working on visualizing my results with the help of Mathematica. There is mainly one Problem (I think) and that has to do with the manipulate order.
1.) What do I have to calculate?
Physics apart the formulas I have to calculate look like this
&[Wolfram Notebook][1]
Now I know that the last 3 Integrals can not be calculated by the System because they have unspecified parameters. So I calculated it one time for g=w=1 and d=0.5. I just defined the Functions:
l[x_]=ArcCos[0.9841229182759271+0.0158770817240729*Cos[x]]
(wich is o for the parameters above)
g[t_]=Sqrt[-1/8 (-1+Sqrt[1-0.5^2])(3-Cos[2 *t])]
(which is Sqrt[k] for the parameters above)
and evaluated the Integral of g with
f[y_]:=NIntegrate[g[t],{t,0,y}]
Then I plotted my wanted function
Plot[x*l[x]/f[x],{x,0,10}]
![image][2]
Now the stuff I need help with:
The thing is that I would like a shortcut to the plot and the option to manipulate the parameters g, w and d afterwards. I tried the following:
&[Wolfram Notebook][3]
But I don't get any results. I think the parameters are the problem so the system cannot solve the numerical Integral for n. I am grateful for any help.
Regards,
Henrie
[1]: https://www.wolframcloud.com/obj/a3124b5e-ea12-4ffa-b836-b1f475b00d0c
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=plot.PNG&userId=2296566
[3]: https://www.wolframcloud.com/obj/f5d2350b-0ea2-4cb8-80e1-9f295dc89299Henrie Küppers2021-06-23T12:14:25ZCan requirments for GPU be changed after upgrade?
https://community.wolfram.com/groups/-/m/t/2251609
So far, I have used the option `TargetDevice -> "GPU"` in `NetTrain` function that provided 3 times faster networks' training. But after last upgrading from Wolfram Research server, each time the message "*NetTrain::mxoldgpu: Your GPU does not support the operations required to evaluate this network*" is reported. The option `TargetDevice -> "CPU"` works properly, but slower.
The only reason I can suppose is the change of requirements for GPU equipment.
My card is not enough powerful (2 GB nVIDIA GeForce GT 710).
Do experts have any thoughts on this issue?Konstantin Nosov2021-04-23T15:55:20ZSubtracting two lists of unequal length?
https://community.wolfram.com/groups/-/m/t/2297743
Hello everyone,
Broadly, I am trying to subtract two lists of unequal length. More specifically, I am hoping to find a way to determine which list has the least number of elements (N) and subsequently find the absolute difference between the first N elements of the two lists.
For instance, imagine t1 has 3 elements {0, 1, 2} and list t2 has 4 elements {0, 1, 2, 3}. I am hoping to do something like the following:
Abs[t1 - t2] = Abs[{0,1,2} - {0,1,2}] = {0,0,0}.
Is there an efficient way to do this?
Thank you,
AlexAlex L2021-06-24T00:45:47ZSpeeding up running time of a code
https://community.wolfram.com/groups/-/m/t/2297406
Hello, I hope everybody is fine at Corona virus times.
Can anyone help me in speeding my code up for large M, for example 20?Thank you.Vedat Erturk2021-06-23T21:02:49ZError in using NDSolve
https://community.wolfram.com/groups/-/m/t/2295374
n = 2
sol=NDSolve[{Table[{x_i'[t]==ν_i [t],y_i'[t]==ω_i [t],z_i'[t]==ρ_i [t]},{i,1,n}],
Table[{x_i [0]==x0[i],y_i [0]==y0[i],z_i [0]==z0[i]},{i,1,n}]},
Flatten[Table[{x_i,y_i,z_i},{i,1,n}]],{t,0,T},
MaxSteps→Infinity,Method→{"DiscontinuityProcessing"→False}]
This is the error
NDSolve::ndinnt: Initial condition x0[1.] is not a number or a rectangular array of numbers.
Please someone can help me on how to solve this errorPraviserk Chand2021-06-21T22:50:42ZLooking for easier way to create and plot recombining trees
https://community.wolfram.com/groups/-/m/t/2296393
I need to creating and plot structures I call "recombining trees" a->{b->{d,e},c->{d,f}}. In version 12.3 trees have been improved, so I hope I can improve upon the method I have been using to create and plot trees. Take a look at the notebook to see what I am currently doing. Is there a way I can automate some of this to make creating trees less labor intensive. I feel like the way I am doing things is not leveraging the capabilities of the software.
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/440e29a5-e0e5-4366-be4f-f59858343a12Robert Buchanan2021-06-23T20:35:49ZPotential bug with TimeSeriesWindow and InfiniteFuture?
https://community.wolfram.com/groups/-/m/t/2295612
I've posted on [SE][1], but it seems not have enjoyed any interest, while it may prove to be an important issue for users of TimeSeries functionality
I use Wolfram Mathematica 12.1 and want to subset a TimeSeries, but noticed that TimeSeriesWindow returns last observation even for range that does not intersect with the original TimeSeries.
Here is an example:
TimeSeriesWindow[
TimeSeries[Transpose[{#, Range@(Length@#)}]],
{{2022, 1, 1}, InfiniteFuture}] &@(DateRange[{2000, 1}, {2002,
1}, {1, "Month"}])
So intuitively this should return nothing as tmin is {2022, 1, 1} for TimeSeriesWindow, but the TimeSeries ends earlier at {2002, 1}.
But it does and returns TimeSeries[{{{2002,1},12.1}}].
While if I use something like {2100,12,1} instead of InfiniteFuture M will correctly return an error stating that there are no values.
So is it just me? Can you reproduce it? What am I doing wrong?
[1]: https://mathematica.stackexchange.com/questions/249771/timeserieswindow-with-infinitefuture-returns-last-observation-beyond-starting-daAlex Isakov2021-06-22T06:25:29ZComputational genealogy with the Wolfram Language
https://community.wolfram.com/groups/-/m/t/2241480
![enter image description here][2]
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/cda697fc-95be-47b6-b67e-f0b883f998b6
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2021-04-10at5.48.08PM.png&userId=228444
[Original]: https://www.wolframcloud.com/obj/rnachbar/Published/Genealogy%20With%20Wolfram%20Language.nbRobert Nachbar2021-04-10T22:07:42ZDerivative of vector given the sum of its n elements?
https://community.wolfram.com/groups/-/m/t/2296670
How can I calculate the differentiation of qi if I have the sum of n qi
&[Wolfram Notebook][1]
[1]: https://www.wolframcloud.com/obj/d6133613-82ab-4c74-9b7f-5dbdd085ebb0I A2021-06-23T11:58:38ZLocating variables in nested modules
https://community.wolfram.com/groups/-/m/t/2296820
This code works.
Module [{x1, x2},
Module [{},
x1 = "111";
];
Module [{},
x2 = "222";
];
Row [{x1, "-", x2}]
]
The same code separated into three attachments does not work.
What am I doing wrong? What is the solution?
Thanks a lot.Ernesto Espinosa2021-06-23T13:20:50ZMatrix computation over modulo N
https://community.wolfram.com/groups/-/m/t/2296459
Hi,
I am just starting with Mathematica. Is there an easy way to do matrix computations over the field Zn (1,2,...,n-1)? For example, I would like to find the eigensystem of a matrix M over Z5 or the reduced echelon form of a matrix over Z5. I know the functions Eigensystem[] and RowReduce[] but is there any way to add an argument so that I can obtain the results over the field Z5?
Thanks in advanceGaspard Pairault2021-06-23T08:59:18ZManipulate genealogy GEDCOM files using Wolfram Language?
https://community.wolfram.com/groups/-/m/t/1167459
Robert Nachbar has an interesting Wolfram video http://www.wolfram.com/broadcast/video.php?c=400&p=2&v=1497 on using Mathematica to manipulate genealogy GEDCOM files. As far as I can see the video does not provide a link to a source for his package. Does antone know where I might find it?Ron Gove2017-08-19T21:06:59ZCryptocurrencies: correlations, clustering and data analysis
https://community.wolfram.com/groups/-/m/t/2295861
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=sdfq34fdasdfas34.jpeg&userId=20103
[2]: https://www.wolframcloud.com/obj/409f97e4-1aff-4160-9131-b7cc38d76ebf
[DONT DELETE: Original Notebook]: https://www.wolframcloud.com/obj/ed6de398-4875-4040-b3cd-d36d285d9c59Anton Antonov2021-06-22T17:48:33ZRendering issues using Manipulate (Win 10; M 12.3)?
https://community.wolfram.com/groups/-/m/t/2295969
I am having rendering issues with the slider bar and buttons etc when using Manipulate command. Exactly the same notebook runs fine on colleagues' Mac machines.
Slider control does not render, buttons do not render, and the appearance of the input generally is obviously not rendering correctly.
Please see the screenshot.
Windows 10 (64 bit) OS
Mathematica v12.3.0.0
Any help/suggestions very welcome. I could not find anything on this issue whilst searching the Community questions.
Many thanks
&Wolfram Notebook
![Rendering issues with Manipulate][1]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ManipulateRenderingIssues.jpg&userId=2295955David Boyle2021-06-23T03:09:47ZApply all the rules at the same time? How is it possible?
https://community.wolfram.com/groups/-/m/t/2278182
Hi everyone,
Since I first read about rulial space and the concept that every possible rule may be applied at the same time, I was dubious about the idea.
You can find these concepts explained in the [Project Announcement][1], or also in [Exploring Rulial Space][2], to get some context.
I had always thought that I had misinterpreted what Wolfram was saying. Maybe he didn't mean that every step, every possible rule is applied. Maybe he just meant that every Turing complete rule is able to emulate the behavior of every other rule, and therefore every rule is equivalent. Then, to us (computationally bounded observers) it is *like* every rule could be applied every step.
But I recently came across the bulletin [Why Does the Universe Exist?][3] where it seems that Wolfram is indeed considering to apply every rule simultaneously.
The reason of my concern about the simultaneous application of all the possible rules is that I feel that this would lead to a trivial universe, that doesn't evolve. Imagine for example to start from the simplest initial condition, an empty hypergraph $\{\}$. You then apply all the possible rules that have $\{\}$ as LHS. For every hypergraph $a$, there will be a rule $\{\} \rightarrow a$, and therefore the second step of the multiway graph will contain every possible hypergraph. For the third step you are now free to apply really *every* possible rule, since you have *every* possible LHS available. As a consequence the third step will consist, again, of every possible hypergraph. And each subsequent step will be exactly the same. Hence the system is not evolving anymore. Time is frozen.
This argument may not convince you because treating infinities may be slippery and the state of the a multiway system isn't described just by the collection of states in a particular slice, but also the events that lead there (the causal relations) carry information. I will now address these issues by formalizing the argument.
I will start by defining what I mean by "step" and what I mean when I say that a system is frozen in time, or that it is not evolving anymore.
### Definition: multiway step
Given a set of rules $\mathcal{R}$ and a set of spatial hypergraphs $C$, a step is a triplet $(C,E, C')$, where $C'$ is the set of all the spatial hypergraphs that can be obtained by applying a rule $r\in \mathcal{R}$ to an element of $C$, and $E$ is the set of causal events generated by the application of such rules.
In other words, to complete a step you have to apply the rules everywhere they are applicable. This definition of step induces a natural way to foliate a multiway graph, and defines a global time coordinate.
### Definition: causally inverted event
Given a rule $r$, one can define the inverted rule $\bar{r}$ that is obtained from $r$ by swapping left hand side and right and side. A similar operation can be done to events. Given two hypergraphs $a$ and $b$, and an event $e: a \rightarrow^r b$, the causally inverted event $\bar{e}$ will be $\bar{e}: b \rightarrow^\bar{r} a$
### Definition: frozen system
Consider a multiway system that has evolved for n steps $(C_i,E_i, C_{i+1})$ for $i=1,...,n$. The system at the step n is considered frozen if:
1. $C_{n-1} = C_n = C_{n+1}$
1. $E_{n}$ can be obtained by $E_{n-1}$ by causally inverting every event of $E_n$.
In a certain sense this definition says that if you invert the direction of time (go from n to n-1 instead that to n+1) and don't notice any difference, then it means that time has stopped, because you cannot distinguish the future from the past.
![example of a frozen system and of a non frozen system][4]
By this definition, the system on the left is not frozen, because it is asymmetric under temporal inversion. The system on the right is instead frozen.
### Definition: complete set of rules
Given a set of hypergraphs $C$, the complete set of rules associated with $C$ is the set $\mathcal{R}_C$ defined such that for every couple of hypergraphs $a,b \in C$ there exist a rule $r \in \mathcal{R}_C$, that brings the state $a$ to the state $b$ (in symbols $a\rightarrow^r b$).
It is obvious that if $r \in \mathcal{R}_C$, then also $\bar{r} \in \mathcal{R}_C$.
### Theorem: A multiway system with a complete set of rules freezes after the second step
Consider a set of hypergraphs $C$ and its complete set of rules $\mathcal{R}_C$. Choose an hypergraph $c \in C$ as initial condition and evolve the multiway system.
Since $\mathcal{R}_C$ is complete, $c$ can be linked to any other hypergraph in $C$, and the first step will then be $( \{ c \} , E_1, C)$, where $E_1$ is the set of events that link $c$ to any hypergraph in $C$.
The second step will be $(C , E_2, C)$ and the third will be $(C , E_3, C)$.
For every $a,b \in C$ there exist a rule $r \in \mathcal{R}_C$ such that the event
$e: a \rightarrow^r b$ belongs to $E_2$ and to $E_3$.
This means that $E_2=E_3$.
Moreover, for every event $e: a \rightarrow^r b$ that belongs to $E_2$, there will also be in $E_3$ the inverted event $\bar{e}: b \rightarrow^\bar{r} a$. In other words, $E_2=E_3$ and they coincide with the set of their inverted events. As a consequence, by the third step the system has frozen.
It is important to notice that I have nowhere assumed that the set of hypergraph or the set of rules must be finite. The whole argument fully applies to infinite set, and in particular it applies to the set of all possible hypergraphs, completed by the set of all possible rules.
Therefore, if we model a universe where, every step, every possible rule is applied, then we can only obtain a trivial, non evolving universe, deprived of any of the complex structures that we observe today in our universe.
![a complete multigraph][5]
In the figure it is shown an example of complete set of rules, which are:
$A \rightarrow A$, $A \rightarrow B$, $A \rightarrow C$, $A \rightarrow D$, $B \rightarrow B$, $B \rightarrow C$, $B \rightarrow D$, $C \rightarrow C$, $C \rightarrow D$, $D \rightarrow D$, plus their inverse. As you can see, by the second step the system started repeating itself, and every step is the same.
In [Why Does the Universe Exist?][6], Wolfram wants to address this particular critic that someone may have raised:
> What if each piece of our hypergraph is updated according to all possible rules—generating many different possible histories? Or, in other words, what if the universe in some sense “simultaneously runs” all possible rules—generating all possible resulting histories?
>Our first instinct might be that if all these possibilities are allowed then there could never be anything definite said about what would happen in the universe. But it turns out that this is far from correct. And it all has to do with the entangling of different possibilities associated with the repeated application of rules.
>Given a particular state of the universe, applying different rules can lead to different states. But applying rules to different states can also potentially lead to the same state. Or, in other words, the “rulial multiway graph” that represents how one state leads to another can exhibit both branching and merging.
I am not able to see how the merging of the multiway branches could provide structure to a multiway system with a complete set of rules, which, by the theorem just proven, is required to freeze by the third step.
Additionally, Wolfram makes two examples, but the first does not have a complete set of rules, so I don't think it is suited to prove that complete sets of rules can generate nontrivial structure.
The second example is instead complete, and therefore freezes after the second step. What Wolfram refers to as a "more symmetrical structure", is just a complete graph, the signature that the system is not evolving anymore.
Any thoughts on that? Have I misinterpreted Wolfram? Does the concept of simultaneous application of every possible rule need to be abandoned?
[1]: https://writings.stephenwolfram.com/2020/04/finally-we-may-have-a-path-to-the-fundamental-theory-of-physics-and-its-beautiful/
[2]: https://wolframphysics.org/bulletins/2020/06/exploring-rulial-space-the-case-of-turing-machines/
[3]: https://writings.stephenwolfram.com/2021/04/why-does-the-universe-exist-some-perspectives-from-our-physics-project/
[4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=frozen.png&userId=2078523
[5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=complete.png&userId=2078523
[6]: https://writings.stephenwolfram.com/2021/04/why-does-the-universe-exist-some-perspectives-from-our-physics-project/Ruggero Valli2021-05-28T23:12:27ZHow does the initialization process in WSM work?
https://community.wolfram.com/groups/-/m/t/2294623
Dear users of SystemModeler
I am trying to build a steady-state analysis module in Mathematica that will take a model from WSM to simulate a base cycle and extrapolate the final conditions to reach the steady-state fastly. I do not have any trouble in nonsingular systems where the number of differential equations matches the number of energy-storing elements. But I am having some problems extending my algorithm to singular systems like the one I have attached here.
In Mathematica, I have checked that the selected state variables are:
{L1.i,c2.v} so I guested that it will suffice to give initial conditions for L1, but this is not the case. Instead, I got the following error:
"SystemModelSimulate::eva: The variables {L1.i} are computed from other variables,"
which is corroborated with the equation browser at the simulation center. The following equation may be found:
L1.i = L3.i. Shouldn't it be the inverse assignation?
What is the right way to programmatically initialize this kind of system?
Also, can someone direct me to verify the circuit system approach that WSM used in the automated generation of equations.? Is it Modified Nodal Analysis? I cannot find this kind of documentation.
As always, I will appreciate any help you can give me.
JesusJ Jesus Rico-Melgoza2021-06-21T01:05:14ZSuccessful NN GPU training on a multi-GPU local machine?
https://community.wolfram.com/groups/-/m/t/2199222
Many useful discussions here about GPU training issues, with different hardware mentioned. So I thought it might be useful to ask about success. My general question is: in the absence of access to cloud-based GPU resources, can the WL take full advantage of a local machine specified for NN work?
So... if you regularly do WL NN training using either a newer, high-end GPU (e.g., RTX 2080) or, even better a machine with *multiple* such GPUs, can you let us know, and what the hardware is?Gareth Russell2021-02-19T13:40:22ZLearningRate algorithm in NetTrain?
https://community.wolfram.com/groups/-/m/t/2207547
Hello,
NetTrain (unless it is specified) takes LearningRate "Automatic". Which algorithm is used for this "automatic" process? (I would like to repreduce the results with other means). Or is there any way to get the trace of this automation after training (like what values, etc. were being used)?
Thank youYeso Alde2021-03-02T11:52:47Z[WSG21] Daily Study Group: Building and Applying Epidemic Models
https://community.wolfram.com/groups/-/m/t/2251812
A new study group for Building and Applying Epidemic Models with the Wolfram Language begins Monday, May 10, 2021!
Making progress in an online course can be daunting when you have to study all alone. Join a cohort of fellow Wolfram Language users for a two-week study group in which you will start in week one with the basics of implementing compartment-based epidemiological models in the Wolfram Language. In the second week, you will cover multi-group models–taking into account vital demographics (i.e. birth, death) and age groups–in addition to introducing control measures and ending with stochastic models.
**Sign up here**: https://wolfr.am/UZfPoLAqJeremy Stratton-Smith2021-04-23T20:17:17ZVisualizing the 100 first factorials: 100!
https://community.wolfram.com/groups/-/m/t/2296036
![enter image description here][1]
&[Wolfram Notebook][2]
[DONT DELETE: Original Notebook]: https://www.wolframcloud.com/obj/3b2957bd-7371-4fb3-b042-863112b39f31
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=.jpg&userId=20103
[2]: https://www.wolframcloud.com/obj/f97fcd55-358e-4975-8df6-29ddabe7fe7eDaniel Carvalho2021-06-22T19:54:30ZCryptocurrencies: data acquisition with visualization
https://community.wolfram.com/groups/-/m/t/2293868
*MODERATOR NOTE: a related resource function can be found here:* [CryptocurrencyData][1]
&[Wolfram Notebook][2]
[Original Notebook]: https://www.wolframcloud.com/obj/8a2ce9a8-eb16-4ec8-8ff7-ff3fd1d60516
[1]: https://www.wolframcloud.com/obj/antononcube/DeployedResources/Function/CryptocurrencyData
[2]: https://www.wolframcloud.com/obj/018a6ebf-c7c2-4912-99fe-dd797dec2030Anton Antonov2021-06-19T15:59:01ZDetection of statistical outliers of voting tables in Peruvian election
https://community.wolfram.com/groups/-/m/t/2295433
![enter image description here][1]
&[Wolfram Notebook][2]
Original post (Spanish): https://elecciones.deigualaigual.net/2021/1578-elecciones-presidenciales-peruanas-2021-segunda-vuelta-deteccion-de-actas-estadisticamente-atipicas/
[DONT DELETE: Original Notebook]: https://www.wolframcloud.com/obj/b73422b3-ee7c-4a2f-8396-382196e4f0aa
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=9384peruvian_hero.jpg&userId=20103
[2]: https://www.wolframcloud.com/obj/243e9838-23bc-4dab-87c2-84e23eb027b9Francisco Rodríguez2021-06-21T23:51:17ZDynamic portraits w/ quasicrystal, waves interference and half-toning
https://community.wolfram.com/groups/-/m/t/2292842
*MODERATORS' NOTE: This post is based on the [tumblr blog found here][1].*
![enter image description here][2]
&[Wolfram Notebook][3]
[1]: https://intothecontinuum.tumblr.com/post/122804795458/mathematica-codehthr-imporththrtzyjpg
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=tumblr_nqffnpsNNO1qfjvexo1_540.gif&userId=20103
[3]: https://www.wolframcloud.com/obj/a66cdce5-bd6f-4882-a109-01a1f0cacd62Sumit Sijher2021-06-17T22:09:28ZHow can I solve this impulsive heat equation please?
https://community.wolfram.com/groups/-/m/t/2295039
I need to solve the following impulsive heat equation:
$$
\left\{\begin{array}{ll}
\partial_{t} \psi(x,t)-\partial_{xx} \psi(x,t)=0, & (x,t)\in (0,1) \times((0, 2) \backslash\{1\}) \\
\psi(0,t)= \psi(1,t)=0, & t \in (0, 2) \\
\psi(x, 0)= x (1-x), & x \in (0,1) \\
\psi(x, 1)=\psi\left(x, 1^{-}\right)+4, & x \in (0,1)
\end{array}\right.
$$
$1^{-}$ denotes the limit to the left!
This is the code I tried in Mathematica, but it's not giving the results
(* problem *)
homogen = If[x = 1, {f[x, t] == Limit[f[x, t], t -> 1, Direction -> "FromBelow"] + 4}, {D[f[x, t], {t, 1}] - D[f[x, t], {x, 2}] == 0}];
(*Initial conditions *)
ic = {f[x, 0] == x*(1 - x)};
(* Dirichlet boundary conditions*)
bc = {f[0, t] == 0, f[1, t] == 0};
(*solution*)
sol = DSolve[{homogen, ic, bc}, f[x, t], {x, 0, 1}, {t, 0, 2}]walid zouhair2021-06-21T16:54:17ZSlider value change on output
https://community.wolfram.com/groups/-/m/t/2295484
Hello,
As, "d" changes the values of "s" and "t" must also change.
Similar to "c" also : as "c" changes the values of "s" and "t" must also change.
I have tried to do it, but as I move slider "d", the values of "s" and "t" remain same.
Thanks for help to resolve same
Clear[p, t]
sol2 = Table[
Take[Solve[
-10 p - 26 t == 5 &&
-5.3 p + 19 t == (var1 - 50),
{p, t}]], {var1, 10, 20}];
pSol1 = p /. sol2 // Flatten;
Column@Flatten[
var2 = Solve[
# == 0.42 - 2.4 s + 1.52 c &&
d == 15 - 1.4 s + 0.4258 c, {d, s}] & /@ pSol1, 1];
d[c_] = d /. var2 // Flatten;
s[c_] = s /. var2 // Flatten;
var10[c_] = Column@Flatten[Sqrt[c]/(s /. var2 // Flatten)];
Dynamic[Manipulate[
TextGrid[
{{"s", "t"},
{Column[s[c]],
var10[c]}},
Frame -> All,
Background -> {Automatic, 1 -> LightYellow},
ItemStyle -> {Automatic, 1 -> Bold},
Alignment -> {Center, Automatic, {{{2, -1}, {1, -1}} -> "."}}],
{c, 10, 30, 1, Appearance -> {"Labeled", "Open"}},
{d, 2, 12, Appearance -> {"Labeled", "Open"}}],
SaveDefinitions -> True]Ma oj2021-06-22T11:48:05ZHow to control paragraphs in string output?
https://community.wolfram.com/groups/-/m/t/2293919
It' a pretty stupid question, I know: How can I control the paragraph indentions for the output of some string?
str = StringRepeat[
"This is some long string which should break into several lines. ",
4]
displays as:
![enter image description here][1]
I.e. **The first line is indented to left** by about 3 characters. I don't know why. The string is just an ordinary string with no special characters;
![enter image description here][2]
I was reading about ParagraphIndent and use it within Text, but his changes nothing (apart from the font):
![enter image description here][3]
Hence a simple Grid looks very strange:
![enter image description here][4]
Can anybody tell me, what I should do to get an ordinary paragraph with no first-line-indention?
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=9665b1.jpg&userId=890153
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=b1a.jpg&userId=890153
[3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=b2.jp.jpg&userId=890153
[4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1560b3.jpg&userId=890153Werner Geiger2021-06-19T22:51:03ZError "parameters of the net diverged" while training a Neural Net
https://community.wolfram.com/groups/-/m/t/2295262
Hello Community,
I am attempting to implement the YOLOv2 object-detection neural network loss function in Wolfram Language. Doing this will allow us to train YOLOv2 on our own datasets to build our own domain-specific real-time object detectors.
However, I am running into a strange error which seems to have only [two other mentions on the entire internet](https://www.google.com/search?hl=en&q=%22parameters%20of%20the%20net%20diverged%22).
NetTrain::arrdiv: Training was stopped early because one or more trainable parameters of the net diverged. As no ValidationSet was provided, the most recent net will be returned, which is likely to be unusable. To avoid divergence, ensure that the training data has been normalized to have zero mean and unit variance. You can also try specifying a lower learning rate, or use a different optimization method; the (possibly automatic) values used were Method->{ADAM,Beta1->0.9,Beta2->0.999,Epsilon->1/100000,GradientClipping->None,L2Regularization->None,LearningRate->Automatic,LearningRateSchedule->None,WeightClipping->None}, LearningRate->0.001. Alternatively, you can use the "GradientClipping" option to Method to bound the magnitude of gradients during training.
The message is somewhat vague, and I am not exactly sure what is causing it. If I set LearningRate->0, I still get this error. If I set Method -> {"SGD", "GradientClipping" -> 0}, I also get this error.
This is also followed by a trail of additional errors:
CompiledFunction::cfta: Argument {238.826,{0.}} at position 1 should be a rank 1 tensor of machine-size real numbers.
CompiledFunction::cfta: Argument {45.0069,{0.}} at position 1 should be a rank 1 tensor of machine-size real numbers.
CompiledFunction::cfta: Argument {161.463,{0.}} at position 1 should be a rank 1 tensor of machine-size real numbers.
General::stop: Further output of CompiledFunction::cfta will be suppressed during this calculation.
I have found through some trial and error that the error is present if I directly include part of my net (box iou calculations) in the loss function.
The code is not included directly here because it is not the focus of the discussion. Rather, I would like to know what `NetTrain::arrdiv` means so I can get around this. I would also like to get this answered publicly so others who have this issue in the future may know what is wrong and how to fix it.
The current error message is not very helpful, since it does not really tell me what "diverging paramters" are and the troubleshooting recommendations are ineffective (the input is already normalized, and lowering the learning rate to 0.0 does not prevent the error from occurring).
[Here is the full notebook](https://www.wolframcloud.com/obj/3a2a3fda-0644-4c56-81e3-a92b8796e579) if anyone wants to see the errors themselves.
Thanks for the help!Alec Graves2021-06-22T06:09:33ZPreprocessing that Classify[ ] does on NumericalVectorSequence[ ]?
https://community.wolfram.com/groups/-/m/t/2236253
When the input data for [Classify][1] is a list of vector sequences where the number of vectors in each sequence is not constant, called [NumericalVectorSequence][2], Classify performs a preprocessing step called NumericalSequenceExtractFeatures that converts NumericalVectorSequence to NumericalVector. I was wondering what this step does. When I look inside the returned [ClassiferFunction][3] and hover over NumericalSequenceExtractFeatures, I see that some Chi-squared test is being done, but it is not exactly clear what Mathematica is doing under the hood to preprocess a list of vector sequences. I attached a relevant notebook with some sample NumericalVectorSequence type data and a [ClassiferFunction][3] that does the preprocessing step that I am concerned with.
[1]: https://reference.wolfram.com/language/ref/Classify.html
[2]: https://reference.wolfram.com/language/ref/FeatureTypes.html
[3]: https://reference.wolfram.com/language/ref/ClassifierFunction.htmlSepehr Elahi2021-04-03T08:04:29ZFine tuning GPT-2 in Mathematica
https://community.wolfram.com/groups/-/m/t/2282909
Hello everyone
I'm trying to fine-tune GPT-2 (https://resources.wolframcloud.com/NeuralNetRepository/resources/GPT-2-Transformer-Trained-on-WebText-Data)
I tried training it like this:
gpt = NetModel[{"GPT-2 Transformer Trained on WebText Data",
"Task" -> "LanguageModeling", "Size" -> "345M"}]
gpt = NetTrain[gpt, {"This is an example"}]
But it didn't work, can someone explain me how to train transformers in Mathematica?Mike Bark2021-06-04T14:40:10ZParabola, tangents and circumcircle
https://community.wolfram.com/groups/-/m/t/2294788
The circumcircle of a triangle formed by three tangents of a parabola always passes through the focus of this parabola
----------
![enter image description here][1]
&[Wolfram Notebook][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=conic.gif&userId=23928
[2]: https://www.wolframcloud.com/obj/a93473a3-ee84-4f11-8f3c-ea0129f64339
[Original]: https://www.wolframcloud.com/obj/eff32e25-7a32-4ca2-87b5-2f7ed9fbdedbShenghui Yang2021-06-21T17:02:19ZStock prices and time series charts
https://community.wolfram.com/groups/-/m/t/2294403
Hi All,
I have recently started to work with Wolfram and Mathematica. I would appreciate your support on a simple query I am trying to write.
I am using Financialdata to grab stock returns for a period (lets say 5 years). As an example
FinancialData["Humana", "Return", {{2015, 1, 1}, {2020, 12, 31}, ]
I have tested to see that the data returns (via "Path") are the daily price return. I am looking to aggregate this by month. The TimeSeriesAggregate function computes the mean as opposed to adding up the daily returns for the month.
Can anyone help?
There are a couple of follow on questions that I am sure I will need assistance on so if anyone is happy to support my queries can you please let me know. I promise they will be simple and not time-consuming for a superuser.
Thanks, AjayAjay Treon2021-06-20T12:20:06ZMath one-liners from YouTube
https://community.wolfram.com/groups/-/m/t/2285635
There are some daily Youtubers who write out their **symbolic** solutions to a short straight-forward (non-quiz like type) math problem. Oftentimes *Mathematica* can solve those problems too. Maybe we could share here the ones which our software **cannot** solve easily?
Let me go first. In the "[Putnam Exam 2004 | B5][1]" video the youtuber claims that $L = \frac{2}{e}$
$$L=\lim_{x\to 1^-} \prod _{n=0}^{\infty } \left(\frac{1+x^{n+1}}{1+x^n}\right)^{x^n}=\ldots =\frac{2}{e}$$
Imho the *Wolfram L* code for this expression should be:
Limit[Product[((1 + x^(n + 1))/(1 + x^n))^(x^n), {n, 0, Infinity}], x -> 1, Direction -> "FromBelow"]
However, *Mathematica* computes forever without returning a result, i must abort the computation. Maybe my code line is wrong, can you get the desired result?
Obviously [this (hopefully collective) thread][2] (*feel free to memorize the short-URL, if you can't follow/subscribe to the thread for updates*) is nothing urgent. It is **entertaining** to let *Mathematica* have a crack at such symbolic math problems which get ten thousands of views within a week. Thanks for taking an interest!
[1]: https://www.youtube.com/watch?v=2nfW9BTMtMI
[2]: http://bit.ly/mathonelinersRaspi Rascal2021-06-08T08:09:38ZStarting day of returns of FinancialData?
https://community.wolfram.com/groups/-/m/t/2294774
Hi All,
I hope you are well and ready for a novice question.
Does anyone know why the property returns does not start from the start of the month?
humana = FinancialData["Humana",
"Close", {{2015, 1, 1}, {2015, 1, 31}}]
This returns a close price for 2 Jan 2015 onwards
stockpxreturn =
FinancialData["Humana", "Return", {{2015, 1, 1}, {2015, 12, 31}}]
This provides returns from the 5th Jan onwards.
I am assuming that the function is simply looking for the first two data points and then computing a daily return which is why it starts T+1 as opposed to look for the previous month's close and attempt to work out a return for the 1st day of the month.
Is there a way to correct this?
Thanks, AjayAjay Treon2021-06-21T14:14:24ZSolving an equation in Mathematica?
https://community.wolfram.com/groups/-/m/t/2294707
So I am solving for an equation for projectile calculation and I have come down to a single equation, however, I want to solve it in terms for a variable. This variable is the unknown and the rest of the variables are inputs. ![equation in mathematica][1]
![equation I solved for ][2]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2021-06-20174238.png&userId=2294393
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2021-06-20174400.png&userId=2294393
I am not able to figure out what I am doing wrong to solve for the equation. I replaced psiF with x in Mathematica. Please help me solve this! Thank You.Sai Juttu2021-06-20T22:45:34ZA filled glass or the mathematics of dioptric anamorphism
https://community.wolfram.com/groups/-/m/t/2294643
Back in 1638, Minim Father [Jean François Niceron][1] wrote a ground-breaking book for architects and artists alike: "[La Perspective Curieuse][2]". In this book he describes the mathematical methods to obtain drawings and paintings using perspective, catoptric anamorphism (with cylindrical and conical mirrors) and dioptric anamorphism by means of refraction in crystals.
![enter image description here][3]
The refractive telescope in the above illustration used a polyhedral lens consisting of 8 crystals and was meant to recompose 8 pictures into a single one by means of refraction. Although a [digital reconstruction][4] of the apparatus exists, the actual telescope was lost in a Venice flood. It would be a mathematical tour de force to study the mathematics of the refractive optics through the multi faced lens. To get a feel of what is refractive anamorphism (contrary to [catoptric anamorphism][5]), I made a short study about anamorphism by means of refraction in a cylinder filled with a sugar solution. The crystals used by Niceron had a refractive index of at least 1.55. The highest index I could obtain was 1.448 by using a 65% sucrose solution inside a cylindrical glass.
Let us first see what we can do with Mathematica to emulate refraction through a solution filled cylinder and create a dioptric anamorphic image.
![enter image description here][6]
The above optical ray diagrams show a 3D view (left) and a 2D horizontal {top right) and vertical (bottom right) cross section.
A ray leaving the point R in the x-y plane will meet the viewer's eye at V. This after being refracted at intersection points Q2 between air and cylinder liquid and Q1 between liquid and air. The resulting light ray from V to R is a combination of:
1. refraction in the horizontal plane through Q1 and Q2 (top right) and
2. refraction in the vertical plane through Q1 and Q2 (bottom right).
The result is that the viewer sees the point R in the x-y plane as a virtual point P in a view plane inside the cylinder. R can be defined as the dioptric (refractive) anamorphic of P or, inversely, P can be defined as the refracted image of R.
In both cases, [Snell's law of refraction][7] applies:
![enter image description here][8]
n1 and n2 are the two refractive indices: 1.448 for air -> sucrose solution and 1/1.448 for sucrose solution -> air. Theta 1 and Theta 2 are the incident and refracted angles. Since the relation between anamorphic points R and virtual points P is rather complex, we use an interpolation function ifR to compute the coordinates of R in the x-y plane from the coordinates of P in the view plane. The following code makes a table tblR of R and P coordinates using Snell's law and plain geometry. The interpolation function ifR is derived from the data in tblR:
tblR = With[{c = 1, yv = 10, zv = 10,
nr = 1.448},(*the cylinder radius is 1 and the viewpont is at {10,
0,10)*)
ParallelTable[
Quiet@
Module[{yc, ptVh, ptVv, ptPh, ptPv, ptQ1h, ti1, tr1, ti1v, tr1v,
ptQ2h, ti2, tr2, ti2v, tr2v, ptQ1v, ptQ2v, ptRv, ptR},
(*view plane location and width*)yc = c^2/yv;
wi = Round[c Sqrt[1 - c/yv^2], .001];
ptVh = {yv, 0}; ptPh = {yc, xp}; ptVv = {yv, zv};
ptPv = {yc, zp};
(*HORIZONTAL SECTION*)
(*incoming intersection point Q1*)
ptQ1h =
First@
NSolveValues[{Element[{x, y}, Line[{ptPh, ptVh}]] \[And]
x^2 + y^2 == c^2}, {x, y}];
(*angle of incidence*)ti1 = VectorAngle[ptVh - ptQ1h, ptQ1h];
(*angle of refraction*)tr1 = Sign[xp] ArcSin[Sin[ti1]/nr];
ptQ2h =
First@
SortBy[
NSolveValues[{Element[{x, y},
InfiniteLine[
ptQ1h, -AngleVector[-tr1 + ArcTan @@ ptQ1h]]] \[And]
x^2 + y^2 == c^2}, {x, y}], First];
(*outgoing intersection point Q2*)
(*angle of incidence*)
ti2 = tr1;
(*angle of refraction*)tr2 = ArcSin[Sin[ti2]*nr];
(*VERTICAL SECTION*)
(*incoming ray*)
\
(*intersection point*)
ptQ1v =
First@
NSolveValues[{Element[{x, y}, Line[{ptVv, ptPv}]] \[And]
x == ptQ1h[[1]]}, {x, y}];
(*angle of incidence*)ti1v = VectorAngle[ptVv - ptQ1v, {1, 0}];
(*angle of refraction*)tr1v = -ArcSin[Sin[ti1v]/nr];
(*outgoing ray*)
(*intersection point*)
ptQ2v =
First@
NSolveValues[{Element[{x, y},
HalfLine[ptQ1v, {-1, Tan[tr1v]}]] \[And]
x == ptQ2h[[1]]}, {x, y}];
(*angle of incidence*)ti2v = tr1v;
(*angle of refraction*)tr2v = ArcSin[Sin[ti2v]*nr];
ptRv =
First@
NSolveValues[{Element[{x, y},
HalfLine[ptQ2v, {-1, Tan[tr2v]}]] \[And] y == 0}, {x,
y}];
ptR =
Last@
NSolveValues[{Element[{x, y},
InfiniteLine[ptQ2h,
AngleVector[tr2 + ArcTan @@ ptQ2h]]] \[And]
x == ptRv[[1]]}, {x, y}];
{{xp, zp}, ptR}], {zp, .75, 7.5, .05}, {xp, -.99, .99, .02}]];
ifR = Interpolation[Flatten[tblR, 1]]
![enter image description here][9]
Below, we apply the function ifR to a set of concentric circles in the view plane and compute the corresponding refractive anamorphic mapping in the x-y plane. The hatched disk is the cross section of the cylinder and shows its relative size and position.
![enter image description here][10]
Using the same function ifR, we can make an animation in 3D of a point rotating around a circle in the view plane and see it traveling around the circle's refractive anamorphic image in the x-y plane:
![enter image description here][11]
We are now ready to experiment with some real images. The first trial is with the the "Bugs Bunny" [popular curve][12]. We map the function ifR to the point coordinates and get the refractive anamorphic image:
centerAndScale[g_] :=
Module[{lns, pts, xMin, xMax, yMin, yMax, centeredLns, scaledLines},
lns = Cases[g[[1]], _Line, \[Infinity]];
pts = Flatten[lns[[All, 1]], 1]; {xMin, xMax} =
MinMax[pts[[All, 1]]]; {yMin, yMax} = MinMax[pts[[All, 2]]];
centeredLns = Map[#1 - {(xMax + xMin)/2, +yMin} &, lns, {3}];
Map[1.35` #1/Abs[xMax - xMin] &, centeredLns, {3}]]
bugsbunnyPrimitives =
centerAndScale[
First[
ParametricPlot[
Entity["PopularCurve", "BugsBunnyCurve"]["ParametricEquations"][
t], {t, 0, 40 \[Pi]}]]] /. {x_?NumericQ, y_?NumericQ} :>
1.35 {x, 1.05 y + 1};
refractedPrimitives = MapAt[ifR @@ # &, prims, {All, 1, All}];
Graphics[{{HatchFilling[], Disk[]}, Circle[], AbsoluteThickness[1],
refractedPrimitives}, Axes -> False, Ticks -> None,
AxesOrigin -> {0, 0}]
![enter image description here][13]
Below demonstrates how the printout of the anamorphic image looks like the original after refraction through a glass filled with a sucrose solution:
![enter image description here][14]
The same can be done with any photographic image. We use the function [ImageSquareDivide][15] from the Wolfram Function Repository to divide the image into a set of colored polygons and map the function ifR to the coordinates of polygon's vertices:
mandrill = ImageResize[ExampleData[{"TestImage", "Mandrill"}], 50];
gr = ResourceFunction["ImageSquareDivide"][
mandrill] /. {x_, y_} -> .7 {x, y + 5};
Graphics[gr, Axes -> True, AxesOrigin -> {0, 0}];
grR = Quiet@MapAt[ifR @@ # &, gr, {All, -1, 1, All}];
Graphics[{{HatchFilling[], Disk[]}, Circle[], grR},
AxesOrigin -> {0, 0}]
![enter image description here][16]
Here again, we see the original image after refraction of the anamorphic printout:
![enter image description here][17]
Refraction does not result in the strong deformations obtained by [reflection in cylindrical mirrors][18]. The use of polished glass lenses or crystals as documented by Niceron would undoubtedly result in more spectacular results.
[1]: https://en.wikipedia.org/wiki/Jean_Fran%C3%A7ois_Niceron
[2]: https://bibliotheque-numerique.inha.fr/viewer/11579/?offset=#page=8&viewer=picture&o=bookmark&n=0&q=
[3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=8149niceronbookimages.png&userId=68637
[4]: https://www.mas.bg.ac.rs/_media/istrazivanje/fme/vol45/2/3_aderosa_et_al.pdf
[5]: https://community.wolfram.com/groups/-/m/t/2100897
[6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=3029geometrycombi.png&userId=68637
[7]: https://en.wikipedia.org/wiki/Snell%27s_law
[8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=6198snellslaw.png&userId=68637
[9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=10772interpolationfunction.png&userId=68637
[10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=9820circlescombi.png&userId=68637
[11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=dioptriccircle500.gif&userId=68637
[12]: https://reference.wolfram.com/language/ref/entity/PopularCurve.html
[13]: https://community.wolfram.com//c/portal/getImageAttachment?filename=8432bugsbunnyprintout.png&userId=68637
[14]: https://community.wolfram.com//c/portal/getImageAttachment?filename=bugsbunnycollage.png&userId=68637
[15]: https://resources.wolframcloud.com/FunctionRepository/resources/ImageSquareDivide/
[16]: https://community.wolfram.com//c/portal/getImageAttachment?filename=10239mandrillprintout.png&userId=68637
[17]: https://community.wolfram.com//c/portal/getImageAttachment?filename=mandrillcollage-1.png&userId=68637
[18]: https://community.wolfram.com/groups/-/m/t/2100897
[19]: https://www.researchgate.net/figure/Digital-reconstruction-of-plate-number-23r-after-J-F-Niceron-La-Perspective-Curieuse_fig1_315893906Erik Mahieu2021-06-21T12:02:30Z