Questions tagged [wolfram-mathematica]
Wolfram Mathematica is a computer algebra system and programming language from Wolfram Research. Mathematica has its own Stack Exchange site at https://mathematica.stackexchange.com/ and that site is the preferred place to ask questions about it.
4,368
questions
1
vote
1
answer
27
views
Values on x-Axes
How to place certain values on the x-axis below and other values above in PlotRange. Below must be the calculated values and above values in the range 0-1.
ListLinePlot[
Marker = Log[{97000., 66000., ...
1
vote
1
answer
40
views
Why does my elementary cellular automata not display the right image given a certain rule-set?
I have recently made a simple elementary cellular automata visualisation using the built in C console, a cell that is alive is a @ and one that is dead is a space but for some reason it displays some ...
3
votes
0
answers
36
views
Translate integral calculation from Mathematica to R
I am trying to convert the below integral implementation in Mathematica into R syntax:
xprime = 0.5;
yprime = 3;
dimx = 20/1000;
dimy = 20/1000;
NIntegrate[Boole[Abs[x - xprime] < dimx/2 &&...
0
votes
0
answers
71
views
had an error running java program using Mathematica libraries
I was trying to do some diffrential equations calculation using Mathematica libraries. I used jlink to link java with Mathematica. Somehow I can't get the program running, I think something is wrong ...
1
vote
0
answers
22
views
VB - load and SHOW an empty notebook programmatically from Visual Basic
I am building an application in VB that wants to open a new second window running an empty (not existing) notebook of Mathematica, fill it with Input, show it as a different window on top of the ...
1
vote
1
answer
34
views
How to plot a function with different colour in Mathematica?
I tried to plot the function of S11 with different values of Z0e and my code is shown in the following.
Z0e = {120, 240}; Z0o = 60; ZS = 50; ZL = 100;
theta = (Pi/2)*(f/0.92);
Z11 = -I*(Z0e + Z0o)*...
0
votes
1
answer
35
views
How to do numerical aproximation of integral in Sympy
I'm new using Sympy, and people told me that I would be able to perform numerical approximations of integral with Sympy. What I have tried is this:
import numpy as np
from sympy.abc import x
import ...
0
votes
0
answers
8
views
How to stop Wolfram script process? NetModel::dllock: The requested neural network model is currently downloading in another process,
I try to run GPT2 with Wolfram script.
In[1]:= NetModel["GPT2 Transformer Trained on WebText Data"]
The download speed is too slow,500M in 6 hours???
Thus, I stop the script with Ctrl+C, and ...
0
votes
1
answer
41
views
How to make a program in mathematica that gives us the radius of a drop from the theoretical profile of that drop?
How to make a program in Mathematica that is able to recognize this image and return the radius of the circular part of it?
0
votes
1
answer
63
views
Heaviside theta integration with Mathematica
I am trying to integrate a Heaviside theta function with two signs inside and Mathematica won't give me a solution. Is there any way of improving the approach before just acknowledging that ...
0
votes
0
answers
33
views
Eigenvector - Different results - Python vs. Mathematica
I'm trying to get same result in python as in Mathematica.
Mathematica:
a = ( {
{1, 2, 3},
{3, 2, 1},
{1, 0, -1}
} );
Eigen = Eigenvectors[a];
Eigen // MatrixForm
Output:
[[2+√11≈ 5.32, 4+√11≈ ...
0
votes
0
answers
54
views
Can't get the same data and plot in Python as it is in Mathematica
I wrote this code in Mathematica and it runs without any problems
'''
u = 9.27*10^-21; k =
1.38*10^-16; j1 = 3.5; j2 = 1.2; nrr = 9740; nrm = -131180; nmm = \
1072770; na = 6*10^23;
(*d=42.807;*)
i1 ...
0
votes
0
answers
27
views
MATHEMATICA, How do I subtract the absolute magnitude of two different vectors in the xy plane?
I need to evaluate an equation in Matlab:
Cos^2(|r1|-|r2|)
where
r1 = {x_1, y_1}
r2 = {x_2, y_2}
for all x_1, x_2 in the x and y_1, y_2 in the y.
I understand that this is likely an extraordinarily ...
0
votes
0
answers
26
views
bug or something else? [duplicate]
I find out that
let x = 305.9*50
console.log(x);
gives a wrong number 15294.999999999998
where it should be simply 15295!
I tried that in node 14.17.0 and 16.14.1.
not honestly sure if this is a ...
1
vote
1
answer
44
views
Getting Different Eigenvalues Between Python/numpy and Mathematica
I was tasked with translating a Mathematica program to Python (Juptyr Notebook) and I'm having trouble getting them to match. The Mathematica program uses the function Eigensystem[] to get the ...
0
votes
0
answers
13
views
Setting legend in Mathematica from panel data on spreadsheet
I have the following code for setting automated legends from a spreadsheet "fake.xlsx" with time-series data.
imp = Import["C:\\Users\\ahw715\\Downloads\\fake.xlsx"]
Legend = Table[...
0
votes
0
answers
28
views
How to embed this javascrip into Mathematica with a single input
In my research, I need to generate Fricke Polynomials. Luckily the job has been done for me on a website. However, it is in javascript+html+css so I am not sure how it works as I only use Mathematica. ...
0
votes
1
answer
44
views
Circle within a drop
How to create a program in mathematica that automatically adjusts a perfect circle inside the drop shape so that the outside parts of the circle are added part by part and returns us a value? As in ...
0
votes
0
answers
56
views
Solving Nonlinear system of equations in Mathematica (wolfram)
I'm Trying to solve a System of equations in Mathmatica with the Function of NSolve
The Code should represent a Mass Balance of A factory, in one of the Flows im trying to change the Conc. of the ...
0
votes
0
answers
29
views
SetPartitions from Mathematica to Python
I have an ordered set partitioning function in Mathematica, just like:
SetPartitions[Table[i, {i, 2, 5}]]
. The output of the above code is:{{{2, 3, 4, 5}}, {{2}, {3, 4, 5}}, {{2, 3}, {4, 5}}, {{2, 4,...
-1
votes
1
answer
50
views
What are some common degenerate cases for structures or functions in computer science?
I can think of only a few for example the zero length list or set. The zero length string. How about empty matrices or tensors? How about parallelograms with all zero degree angles? How about a ...
0
votes
0
answers
34
views
Issues when producing spectrogram using Mathematica
I am trying to produce the spectrogram of a signal using Mathematica. The saddle points (points where the derivative of the phase with respect to frequency equals zero) of the signal have the ...
1
vote
2
answers
56
views
How to plot function embedded in module in Mathematica
I want to plot a 2D graph for this function.
Efficiency of a SS topology resonant circuit
I am new to Mathematica. This is what I have tried, I would appreciate it if someone could help me ...
0
votes
0
answers
48
views
Delayed system of differential equations
I wrote the following DDE in Mathematica:
sol = NDSolve[{ x'[t]=0.2x[t]+1.4y[t]+0.5y[t-𝜏]-2,
y'[t]=-0.2x[t]+0.4y[t]+2,
x[t /; t <= 0] == 2,
y[t /; ...
2
votes
1
answer
90
views
file.nb from Mathematica has a strange format on GitHub
I want to download a file with the extension .nb that was uploaded to a GitHub repository. However, it has a strange format that I can't get round and use it like the original. Here is a sample of ...
0
votes
1
answer
33
views
How to export below image graph from pixels to millimeters?
A linear graph of the drop curve is taken from this image, but the graph is too large because it is in pixels, it is necessary to convert the graph data in Mathematica to millimeters.
Drop
Graphic
0
votes
0
answers
36
views
Why does TensorContract differ from reshaped arrays in Mathematica?
I am recently trying to perform tensor calculations with Mathematica as I came across problems like these:
Given two tensors M,N (here matrices), I want to compute something like
m = RandomReal[{}, {2,...
0
votes
0
answers
21
views
Different colors plotting fixed points in NSolve
I am plotting fixed points of a system of differential equations in terms of a parameter. The code is
PX1Y1 = (1 - s1) (y1 + y2);
PX1Y2 = 0;
PX1X2 = 0;
PX2Y1 = 0;
PX2Y2 = s2 (y1 + y2);
PX2X1 = 0;
...
1
vote
1
answer
51
views
How to perform binomial-coefficient and factorial calculation with more precision?
I was comparing the result of my following python calculation with Mathematica: https://www.wolframalpha.com/input?i=sum+%28500+choose+r+%29%28-1%29%5Er+%2F%28r%21%29+%2C+r%3D0+to+500
import numpy as ...
0
votes
1
answer
63
views
Exact orthogonalization of vectors in Wolfram
What I have is a matrix, I need to orthogonolize its eigen vectors.
That is basically all I need, but in exact form.
So here is my wolfram input
(orthogonolize(eigenvectors({{146, 112, 78, 17, 122}, {...
-1
votes
1
answer
48
views
Is there any way to integrate spherical harmonics over the surface of a unit sphere in python?
I am trying to integrate this in Python
f1 = lambda phi, theta: ( np.conj(sph_harm(m1, l1, theta, phi)) \
* sph_harm(m2, l2, theta, phi) #theta--> 0-2pi, phi-->0-...
0
votes
1
answer
154
views
Mathematica : Convert easily a Notebook format into Wolframscript (.wls) by removing all comments on real instructions lines
I have a Mathematica notebook.
I would like to generate in an automatically way this notebook to a Wolfram script that I could make run directly from terminal under MacOS with : $ wolframscript ...
1
vote
1
answer
33
views
Export file to serve while evaluating Wolframscript through command line
I am trying to use a server to do a set of computations for me, and then export the results as a csv to the server to then be transferred to my own computer. I am having trouble exporting files by ...
1
vote
1
answer
40
views
Logistic regression (Verhulst's logic equation)
I need to build 2 graphics:
using logistic regression model
using the same model but with Allee effect
I tried using this formula in WolframAlpha
but it doesn't show any diagram, and looks like I do ...
1
vote
1
answer
93
views
Combining legends in mathematica Grid[]
I am trying to plot 2 figures that both share identical legends in a grid in Mathematical. Here is an example of the code:
Grid[{{Plot[{x + 1, 2 x + 1}, {x, 0, 10},
PlotStyle -> {{RGBColor[0....
0
votes
0
answers
47
views
How to make a 3D distribution plot in python?
The values of my array having shape (5,5,5) are shown below
[[[0.51804936, 0.54854341, 0.62379744, 0.75132647, 0.87030085],
[0.5767205 , 0.6077389 , 0.6853382 , 0.81809529, 0.94254742],
[0.64918176, 0....
0
votes
1
answer
103
views
How to create a server in Mathematica container?
I try to create a server in a Docker container using Wolfram Language. Docker parameters and Wolfram script, which starts a server inside it, are in the attached files:
docker-compose.yml
services:
...
0
votes
1
answer
49
views
Making a histogram out of values from a table
I have defined a Mixed distribution made out of two Normal Distributions, like this
MixDist[s_,n_]:=With[{Dist=MixtureDistribution[{.5,.5},{NormalDistribution[0,s],Normaldistribution[0.5s,s]}]},...
1
vote
1
answer
77
views
Artifacts in DensityPlot (Wolfram Mathematica)
I am trying to visualize the result of numerical integration in Wolfram Mathematica using DensityPlot. But dark artifacts appear inside the circle on the graph, this is incorrect. How to fix this?
f[...
1
vote
1
answer
78
views
Sagemath: Is there a simple way to factor a polynomial over C & have the roots appear in radical instead of decimal form?
In Mathematica, if I do the following
Roots[x^3 - 2 == 0, x]
I get
x=(-1)^(2/3) 2^(1/3) || x=(-2)^(1/3) || x = 2^(1/3)
I want to do something similar in Sagemath
sage: F1.<x> = PolynomialRing(...
2
votes
1
answer
37
views
Why am I not getting an output?
I'm trying to filter (comments) which is survey response from CSV file so all text.
I did
classify[“sentiment”,comments]
And
Counts[classify[“sentiment”,comments]]
Which works fine
So now I want to ...
0
votes
1
answer
31
views
How can I use WordFrequencyData from Wolfram?
Here you can fetch word frequencies from Wolfram but I would like to know how to do this in Python because I am having difficulty finding any code to do this.
https://reference.wolfram.com/language/...
0
votes
1
answer
57
views
Mathematica Series and Solve function
This is my first mathmatica code,
I defined the functions:
\[Beta] := v/c
\[Gamma] := 1/Sqrt[1 - \[Beta]^2]
TotalE[\[Gamma][\[Beta]]] := \[Gamma]mc^2
KE := TotalE[\[Gamma][\[Beta]]] - mc^2
No i want ...
0
votes
1
answer
31
views
Change shortcut of subscript from 'ctrl+_' into 'ctrl+l' failed?
I want to change the shortcut of subscript from ctrl+_ into ctrl+l. I find the KeyEventTranslations.tr file, successfully change superscript from ctrl+6 into ctrl+h. But when I do the same thing to ...
0
votes
1
answer
52
views
Integrate Log(x+1)^m in Mathematica
I got this question Integrate ln(x+1)^m for integers m=1to6.
I've tried this method but I didn't get the result.
Integrate[{Log (x + 1)^m, x}, Assumptions -> {m, 1, 6}]
The output I got
Integrate[{...
0
votes
0
answers
54
views
extracting the critical point of a function in Mathematica
Let's consider the function
f[x]:=x^3
To find the maximum value of this function in Mathematica, we can use
FindMaximum[f[x],x]/
which displays the result
{2.093608796950724*10^313, {x -> 2.75612*...
1
vote
1
answer
51
views
Mathematica - extracting upper bound envelope of of listplot
I have an unstructured dataset "nm", excel file in the link below.
https://www.dropbox.com/s/k7sdblxg4txjvj8/nm.xls?dl=0
it looks like that in a Mathematica list plot 1.
Could You please ...
0
votes
0
answers
37
views
How to find regions in a graph from an image in Mathematica?
Our aim is to find the shortest path to an exit. We have an image of a floor plan where we have painted the exit yellow. Then we turn all the walkable space (including said exits) into a mesh and then ...
1
vote
1
answer
105
views
How to use the values from FindRoot?
Im trying to use FindRoot to mark points on a graph.
What I want to do is Draw a line on the graph at the x and y points of the max of the function using this:
g = 2 Sin[t];
g2 = FindMaxValue[g, t];
...
2
votes
1
answer
103
views
Mathematica equivalent of Pandas groupby and sum
I imported a World Health Organization (WHO) csv file with Covid-19 cases per country from January 2020 into Mathematica. The file is a table with "Date Reported", "Country Code", &...