For information and tips about Mathematica features.
related reddits:
/r/Mathematica
Like the Desktop version of Mathematica?
So much more convenient to use a symbols palette than using Wolfram Language.
Specifically, the HiGGS package, as part of xACT.
I understand how to load the package, but that page mentions using the Wolfram Cloud directory as the file system. I've tried going to Base>Applications and placing the xACT file and its contents there, and the HiGGS files in that, but the CloudGet command is failing, so obviously I'm doing something wrong.
I'd prefer to use Wolfram Mathematica, but right now I only have institutional access to Wolfram Cloud, I'd rather not spend any of my own money, and WLJS isn't yet in a state where it's able to properly format the outputs from HiGGS.
I am trying to solve a differential equation (image bellow) and the solution contains the following: DSolve`DSolveOrder2PFQSolsDump`b. Running ?DSolve`DSolveOrder2PFQSolsDump`b, returns that it is a symbol and google has nothing.
Has anyone see this before? What is it and then does it occur?
Anyone, who is not part of the development team, used the notebook assistant program to help with an actual project using Mathematica. It seems like it could be a game changer, but watching Stephen Wolfram struggle with his presentation https://www.youtube.com/live/jVG4FYo6qA8?si=gJtoM33EAw9MNrVR makes me wonder how long it will take to get it to be useful for my projects
If you have a generating function, is it possible for Mathematica (and how?) to do the binomial expansion to (directly) obtain the formula for a coefficient?
As an example, I got the g.f.:
SeriesCoefficient[(1 - x^m)^n/(1 - x)^(n + 1), {x, 0, n m - s}]
Now I would do the binomial expansion myself, to arrive at the formula for the coefficient:
Sum[(-1)^k Binomial[n, k] Binomial[m(n - k) + n - s, n], {k, 0, Floor[n - s/m]}]
But I feel like Mathematica should probably be capable to do this for me, but I can't figure out how.
Hi everyone! I apologize in advance for my bad English, I'm trying my best.
I need help solving a Sudoku but using Mathematica. The problem is that I'm not allowed to use commands as SudokuSolve (which would make things a lot easier). The goal is to approach the solution through algebraic techniques, which means using variables, equations, and possibly matrix operations to find the solution. I made this code but it doesn't work for some reason:
(the comments are in Spanish)
In[17]:= (* Lo primero es definir el Sudoku como una matriz de variables*)
(*Cada celda es una variable desconocida,excepto donde ya conocemos los números.*)
sudoku = {{x11, 4, 6, 7, x15, x16, x17, x18, x19}, {x21,
x22, 8, x24, 6, 9, x27, 5, x29}, {x31, x32, x33, x34, 4, x36, x37,
9, x39}, {x41, x42, x43, x44, x45, 5, 4, 8, 3}, {x51, x52, x53,
x54, 2, x56, 5, 7, x59}, {x61, 8, x63, 4, x65, x66, x67, x68,
x69}, {7, 2, x73, 6, 5, x76, x77, x78, 4}, {x81, 3, x83, 8, x85, 7,
6, x88, 2}, {x91, x92, 8, 2, x95, x96, x97, 7,
x99}};
In[18]:= (*Ahora vamos a poner las restricciones:
1- Cada celda debe tener un valor entre 1 y 9. Hacemos esto para que los valores que tomen las variables no se pasen*)
restriccionesCeldas = Table[1 <= sudoku[[i, j]] <= 9, {i, 9}, {j, 9}];
(* 2- Las filas no pueden tener numeros repetidos. Vamos a comparar los elementos de cada fila para asegurarnos de que no se repiten.*)
In[19]:=
restriccionesFilas = (Table[
Table[sudoku[[i, k]] != sudoku[[i, l]], {k, 9}, {l, k + 1,
9}], {i, 9}]);
(* 3- Las columnas no pueden tener numeros repetidos. Vamos a comparar los elementos de cada columna para asegurarnos de que no se repiten.*)
In[20]:=
restriccionesColumnas = (Table[
Table[sudoku[[k, j]] != sudoku[[l, j]], {k, 9}, {l, k + 1,
9}], {j, 9}]);
(* 4- Las submatrices de orden 3 (son 9 en total) no pueden tener números repetidos. Paraa ello vamos a analizar las 9 submatrices de orden 3 y ver que sus elementos sean diferentes. *)
In[21]:=
restriccionesSubmatrices =
Table[Table[
sudoku[[3 (a - 1) + i, 3 (b - 1) + j]] !=
sudoku[[3 (a - 1) + k, 3 (b - 1) + l]], {i, 3}, {j, 3}, {k, i,
3}, {l, If[k == i, j + 1, 1], 3}], {a, 3}, {b, 3}];
(* 5- Hay elementos que ya conocemos. Esos van a ser fijos. *)
In[22]:=
restriccionesConocidas = {sudoku[[1, 2]] == 4, sudoku[[1, 3]] == 6,
sudoku[[9, 3]] == 8, sudoku[[9, 4]] == 2, sudoku[[9, 9]] == 7,
sudoku[[7, 1]] == 7, sudoku[[7, 2]] == 2};
(* Ahora vamos a unir todas las restricciones, vamos a usar una lista*)
In[23]:=
restriccionesTotales =
Flatten[{restriccionesCeldas, restriccionesFilas,
restriccionesColumnas, restriccionesSubmatrices,
restriccionesConocidas}];
(* Vamos a usar un Solve para buscar los valores de los elementos y que cumplan las condiciones/restricciones*)
In[24]:= solucion = Solve[restriccionesTotales, Flatten[sudoku]];
(* y mostramos resultado como matriz*)
In[25]:= MatrixForm[sudoku /. First[solucion]]
ReplaceAll::reps: {1<=x11<=9,True,True,True,1<=x15<=9,1<=x16<=9,1<=x17<=9,1<=x18<=9,1<=x19<=9,1<=x21<=9,1<=x22<=9,True,1<=x24<=9,True,True,1<=x27<=9,True,1<=x29<=9,1<=x31<=9,1<=x32<=9,1<=x33<=9,1<=x34<=9,True,1<=x36<=9,1<=x37<=9,True,1<=x39<=9,1<=x41<=9,1<=x42<=9,1<=x43<=9,1<=x44<=9,1<=x45<=9,True,True,True,True,1<=x51<=9,1<=x52<=9,1<=x53<=9,1<=x54<=9,True,1<=x56<=9,True,True,1<=x59<=9,1<=x61<=9,True,1<=x63<=9,True,1<=x65<=9,<<1010>>} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
I don't know what to do, I've tried asking chatGPT, MathGPT and Copilot. They all give me codes that say that it doesn't have a solution.
I really would appreciate some help as I’m in kind of a hurry (my deadline is Wednesday at midnight 💀)
I am in school and new to Mathematica. I'm working on a project where I'm trying to calculate the volatility of stock prices between different sectors. I'm using the Wolfram FinancialData dataset and getting the adjusted close prices from 6 representative companies in 6 different sectors to do the analysis. However, I keep running into multiple issues when trying to pull the data in. The code below is a simplified version, only looking at the Technology sector for now while I try to debug this. It also looks at only 3 days worth of data, vs. the 5 years that I will eventually use. I've tried debugging this for a while and can't figure out where I'm stuck. It seems like it should be a simple fix since I'm using standard data and not calling anything that is particularly complicated. Any help is appreciated!
(* will use 6 companies from Technology, Healthcare, Financials, Consumer Discretionary, Energy, Industrial sectors. For now, starting with Technology to ensure the code works *)
sectors = {{ Apple FINANCIAL ENTITY , Microsoft FINANCIAL ENTITY , NVIDIA FINANCIAL ENTITY , Alphabet Class A Shares FINANCIAL ENTITY , Meta FINANCIAL ENTITY , Amazon FINANCIAL ENTITY }};
(* using 3 days worth of data to test. Will expand to 5 years for full analysis *)
startDate = "2024-12-04";
endDate = "2024-12-06";
(* I've exported this data to a csv file and it looks correct - each stock has prices for the 3 days I'm evaluating *)
data = Table[FinancialData[stock, "AdjustedClose", {startDate, endDate}], {sector, sectors}, {stock, sector}];
(* added this code below because Mathematica kept giving an error stating there were non-numeric values in data. I'm assuming that it might be because there is a $ sign in the financial data. Once I added this, it was able to calculate the logReturns in the next line of code *)
cleanedData = QuantityMagnitude /@ Table[FinancialData[stock, "AdjustedClose", {startDate, endDate}], {stock, sectors}]
(* this should return a list of the differences of the logs between the stock prices, but it's returning a lot of 0s *)
logReturnsCleanedData = Table[Differences[Log[sectorData〚All, 2〛]],
(*Compute log returns*){sectorData, cleanedData}]
(* I was expecting this to return {2, 2, 2, 2, 2} but it is returning {5} *)
Length /@ logReturnsCleanedData
(* this gives me an error with the StandardDeviation function, and says that a "Rectangular array is expected at position 1 *)
stockVolatilities = Table[StandardDeviation[returns], {returns, logReturnsCleanedData}]
(* this is the full error message I get from the code above
StandardDeviation : Rectangular array expected at position 1 in StandardDeviation[{{{{0.587791, 0.599486, 0.602453}}, {0}, 0, {0, 0}, {0, 0}, 0, {0, 0, 0, 0, 0}}, {{{-1.10326, -1.11556, -1.13593}}, {0}, 0, {0, 0}, {0, 0}, 0, {0, 0, 0, 0, 0}}, {<<1>>}, {{{1.25846, 1.26049, 1.27265}}, {0}, 0, {0, 0}, {0, 0}, 0, {0, 0, 0, 0, 0}}, {{{-1.03441, -1.01558, -1.0107}}, {0}, 0, {0, 0}, {0, 0}, 0, {0, 0, 0,0, 0}}}]. *)
(* the remaining code below does not work yet since I cannot get the code above to output the correct info *)
sectorVolatilities = Mean /@ stockVolatilities
BarChart[sectorVolatilities,ChartLabels→{"Technology","Healthcare","Financials","Consumer Discretionary","Energy","Industrials"}, ChartStyle→"Pastel",AxesLabel→{"Sectors","Volatility"}]
I'm using code someone wrote for me already and that, when they ran it, worked, but now when I try to run it it's not working. Any ideas why?
I am trying to solve the system of DE but whenever I plug it in, it just outputs my input
DSolve[{x'[t] == -2 y[t] + x[t]/(1 + x[t]^2 + y[t]^2),
y'[t] == 2 x[t] + y[t]/(1 + x[t]^2 + y[t]^2), x[0] == 0.5,
y[0] == 0.4}, {y, x}, t]
Is there anything wrong with my syntax or can mathematica just not solve this problem?
I am attempting to animate two parametric plots within the same box but I cannot determine how to do so. Guidance is appreciated.
So i installed wolfram mathematica in my pc, licensed through my university. After some days i realized it would be much more handy to have that software in my laptop. So my question is fairly simple. Can i unistall the one in my pc and then install in my laptop?
I'm a freshmen student in physics and I have to do a project in mathematica of a certain level of difficulty. While I don't have great knowledge about biology, I'm interested in ProteinData because it looks cool. Any ideas about how I do a cool project about it?
Snapdragon X Elite
Is there any possibility to use mathematica on snapdragon chips as my university recommended snapdragon laptops and we need mathematica for our masterthesis.
Kind regards Your Wilfram appreciator
I have a following function and want to calculate its one sided Limit in x->1.
The left-sided output is totally fine, but I'm wondering why do I get -Infinity on right-sided Limit since it does not exist.
I also plotted the function and printed its domain using built-in function and all checks out with my understanding. So we do I get -inf output? What am I missing here?
Can someone give some examples of differential equations on perturbation method using mathematica. I'm new to Mathematica and I'm sot sure if I can use it to solve them or how to use it.
V[x_] = (1 - Exp[-Sqrt[2/3]*x])^(2);
drV[x_] = D[V, x];
Solve[-drV/V == -Sqrt[2], x];
phif = 0.940;
X = (1 + (2 - a)*phi/(2 Sqrt[3 b]))^(2/(2 - a));
M[phi_] = -Sqrt[b/3] (X^a (a + 6 X) - 3 b*X)/(X^(1 + a/2)*(2 X^a - b));
drM[phi_] = D[M[phi], phi];
Mf[a_, b_] := M[phif] == V[phif];
drMf[a_, b_] := drM[phif] == drV[phif];
Solve[{Mf[a, b], drMf[a, b]}, {a, b}]
Processing img c28obgpgex1e1...
dbgbb!(...) makes it easy to debug array data using notebooks just like the dbg!(...) macro. It sends the data to the BulletinBoard server, and then it can be read from Mathematica/Jupyter notebooks
BulletinBoard is an in-memory object storage that mediates data between a Rust program and a notebook. The BulletinBoard server is available on crates.io, DockerHub, and GitHub. There is also a GUI application that acts as both client and server.
Data is stored as ArrayObjects, which is a self-describing binary data format optimized for array data and for object storage.
Check it out and enjoy the accelerated coding experience!
https://github.com/YShoji-HEP/dbgbb
Here is the code generated taking help of an AI tool (ChatGPT):
Count[WordList[], StringMatchQ[#, "q" ~~ ___] &]
There is definitely something wrong as the output should not be zero.
The syntax StringMatchQ[#, "q" ~~ ___] & is something I find difficult to relate. It will help if someone could explain the relevance of #, ~~ ___, & within the code. Of course since the code is apparently giving wrong output, first need to revive the correct code.
Thanks in advance!
On running TextSentences[x], it will help if anyone can explain how the Wolfram Languages infers for example "Resrly" is not the first word of a new sentence.
StringLength[MaximalBy[WordList[],StringLength]]
Not sure why the output is in list form. Obviously there should be a way to convert this list form into integer form.
The problem is to make a string from the first letters of all the sentences in the Wikipedia article about computers.
Here is my tentative code:
StringJoin[StringTake[StringSplit[WikipediaData["computers"],"."], 2]]
Not sure about the error messages shown in red above.
I chose 2 instead of 1 for StringTake argument as there seems to be a whitespace after period.
Help is sought also for how to ensure that the first letter after a sentence is selected irrespective of it appears after the period or followed by one or more whitespaces.
StringSplit[stringsample,{"."}][[ 1]]
The double square bracket syntax appears not that intuitive with otherwise the usual way which is putting one function above the other.
If I understand correctly, the output of StringSplit function which is a list is being used by [[1]] to show just the first element of the list. What appears strange is the syntax.
The goal is to by using StringSplit, split the text on the basis of comma appearance.
StringSplit["Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",","]
The above syntax generated after referring to Wolfram docs on StringSplit:
It seems the comma is indeed split but difficult to discern from the output. So trying to take help of InputForm function in order to show each substring with quotes.
The docs uses InputForm[%] as second code after the StringSplit code. Not sure how the second code using InputForm function will know that it is the previous code of which referred.
I tried to do the same with my code and here is the screenshot: