All Questions
93,923
questions
5
votes
1
answer
268
views
Derivative of a 3D Interpolated function
I cannot get the partial derivative of a set of data. I managed to get the accurate interpolation, but I cannot evaluate its derivatives.
Here are my details:
...
1
vote
1
answer
89
views
Collect a multivariate polynomial with 26 variables
I have a polynomial like this:
$(wz+h+j-q)^2+((gk+2g+k+1)\cdot(h+j)+h-z)^2+(2n+p+q+z-e)^2+(16(k+1)^3\cdot(k+2)\cdot(n+1)^2+1-f^2)^2+(e^3\cdot(e+2)(a+1)^2+1-o^2)^2+((a^2-1)y^2+1-x^2)^2+(16r^2y^4(a^2-1)+...
5
votes
3
answers
250
views
Matrix of Functions to Function that returns a Matrix
I have a $n\times n$ matrix, every entry is of the form
Function[{t},expr]
How do I get from that a function M[t_]$\colon\mathbb{...
9
votes
3
answers
546
views
Improve running speed for DeleteDuplicates
How to make this faster? I want to remove elements that satisfy the condition below but it's way too slow.
...
7
votes
2
answers
379
views
Why do the frame ticks disapear when a plot is exported as PNG?
I am using M12.0.0.0 on Ubuntu and I have these two plots:
...
3
votes
1
answer
66
views
Palette to copy and paste cell reference number
I have the following palette:
...
4
votes
1
answer
163
views
Achieving a plot similar to a RegionPlot with discrete data
I have the following data in the format of {x1,y1,z1}:
...
4
votes
1
answer
208
views
Solving two PDEs with common IC and BCs
I'm new to Mathematica and want to try it after MATLAB.
I want to solve two different PDEs using the same initial condition and boundary conditions.
(want to verify that the solution I got using ...
0
votes
0
answers
68
views
CUDA installed on Mathematica 12.1, is running but CUDA-Functions still run on CPU
I installed Mathematica and CUDA but all examples and functions are executed on CPU rather than GPU. I can check the time for a CUDAFourier vs Fourier and also don't see a GPU load in the taskmanager ...
1
vote
0
answers
61
views
Setting Directory for Paclet Deploy (Creation)
In the sample code below, I am trying to set the location for Paclet creation. The desired path is:
C:\Users\colin\Desktop\Packages
The "Packages" folder exists as I am able to archive ...
0
votes
0
answers
29
views
Extract actual result from equivalence [duplicate]
When I get a result like this {x -> -0.5 - 0.866025 I}, how do extract just the number: -0.5 - 0.866025 I. I can do this with the .rhs() method in Sagemath but I can't find the function in ...
2
votes
1
answer
103
views
Problem with the precision
I am trying to plot eigenvalues of a matrix.
I get some errors like “precision may be lost”.
As a result, there are some unwanted jumps in the plot.
Any suggestion of what am I doing wrong?
Thanks
5
votes
3
answers
283
views
Text rotation in GeoGraphics
I have a problem rotating some text in GeoGraphics. Whenever I rotate the text I am also getting a shift in the latitude.
OS: Linux x86 (64-bit)
FullVersionNumber: 12.1.1
As a minimum working ...
4
votes
1
answer
199
views
Chemical formulas with Mathematica
I am aware that there are many many things that we can do in Mathematica, but I am wondering if it is also possible to construct chemical compunds such as for example the one below?:
EDIT:
Using @...
0
votes
2
answers
111
views
How can I set a certain predicate for the result of a function to true?
I have an object called f (basically a vector of functions) and a predicate called MemberQR(actually its with subscript R).
<...
5
votes
3
answers
315
views
Getting the coordinates of points along a poly-line shown in graphics
I have been trying to obtain list of {x,y} coordinates from this code
...
2
votes
2
answers
174
views
Plot[Zeta[x], {x, 2, 20}, ScalingFunctions -> "Log"] is not logarithmic [closed]
The code
Plot[Zeta[x], {x, 2, 20}, ScalingFunctions -> "Log"]
produces the following image, which is a plot of the ...
2
votes
2
answers
103
views
Converting Units [duplicate]
I'm using MMA 12.2. Trying to put together some astronomy pages, but the output of the command below is in miles. I would rather have it in SI units instead.
On my system evaluating ...
6
votes
1
answer
316
views
Unable to time-dependently solve a Laplacian using NDSolve
This seems to be a bit of a strange one:
I have my equation, defined as:
...
1
vote
2
answers
68
views
function changes upon condition
I have the function
f[x_,y_]:=1/(Sin[x]+Sin[y])
which obviously becomes infinite for $x=\pi n, \;y=\pi n$ where $n\,\epsilon \, \mathbf{N}$.
I want to give ...
3
votes
0
answers
47
views
How to extract the same entries from two tables? [closed]
I have 30000 entries in two tables. Now, I want to extract those two entries which are the same. How can I do it? For example, I have two tables, say T1 and T2;
...
1
vote
1
answer
141
views
Maximize a function over several variables [closed]
I want to maximize the function,
$$S_{v}=\sum_{a \in\{1,-1\}^{n}}\left\|\sum_{i=1}^{n} a_{i} v_{i}\right\|$$
over $v_{i}$ and a given $n$ (say $n$=3).
$v_i$ are unit vectors.
$a$ are lists with $n$ ...
0
votes
1
answer
131
views
Expand product of symbolic sums (with identically named indices)
I have an expression that is a product of two symbolic sums.
Sum[a[k], {k, 1, n}]*Sum[b[k], {k, 1, n}]
How can I expand this expression? I want to see something ...
1
vote
1
answer
224
views
Correcting delimiter definitions in .csv files
I have a number of .csv files that have a semicolon (;) delimiter rather than comma, and I'm wondering if there is a simple way to change the text in them all.
Lets say I have a test file "a.csv&...
1
vote
3
answers
101
views
NMinimize with four equations for four points [closed]
The following is an unsuccessful attempt to pass a parabola through four points.
...
1
vote
2
answers
75
views
Accuracy of Mod[x, 1] and FractionalPart[x]
The difference between exact and numerical computation is clear to me. But why is
...
4
votes
3
answers
612
views
Calculate variance for a lottery?
I'm trying to calculate the variance for a lottery using the mathematica function "variance". In the following a simplified example with just a few values, and how I tried to solve it:
...
2
votes
2
answers
113
views
How to use ListPlot with specific form of data
I have a big data in this form {x,{y1,y2}}
expData = {{5.6, {4.5, 7.5}}, {7, {1.5, 7.5}}, {20, {2,12}}, {31, {1.5, 10}}};
I am ...
2
votes
2
answers
735
views
Given a list of linear equations, what is a neat way to use solve on the equations of this list? [closed]
Suppose I have a list of equations, say {2x+b+3c=3, 7x+2b+c=1, x+b+9c=-2} what is a neat way to use Solve[] on that list? ...
1
vote
2
answers
119
views
Problem fitting data
If I have the following data:
...
3
votes
0
answers
66
views
Mathematica gives $RecursionLimit to every single input [closed]
I have been using Mathematica Cloud for about 3 months. About twice a month I encounter a strange and perplexing error that I have, until now, overlooked as an immovable bug. Every function I input, ...
2
votes
1
answer
74
views
InteractiveTradingChart with date and time displayed for selected data
It is possible to modify TradingChart such that instead of just the date, date and time are displayed for a selected data point. Is there a "trick" that ...
4
votes
1
answer
438
views
Creating a plot for a solid (torus)
We have the following two equations: Sqrt[1 - (Sqrt[x^2 + y^2] - 3)^2], -Sqrt[1 - (Sqrt[x^2 + y^2] - 3)^2] and these have to be plotted into a parametricplot3D and regionplot3D, and these would yield ...
3
votes
1
answer
89
views
Manipulate InteractiveTradingChart or lazy Manipulate
Back in 2012, it seems that something like Manipulate[InteractiveTradingChart[ticker], {ticker, {"AMZN", "GOOGL"}}] worked fine. Mathematica 12....
4
votes
1
answer
441
views
Inset figures using show
If I have to figure done as in the following format:
Figure1= Show[....(*Several figures*)....]
Figure2=Show[....(*Several figures*).....]
Questions:
How can I ...
4
votes
2
answers
700
views
Is it possible to ask Mathematica to draw a plot like the given one?
Is it possible to ask Mathematica to draw a plot like this?
0
votes
1
answer
157
views
Why is a function just repeating input [closed]
This should give the answer of 2, but all it does is repeat the input. What is wrong?
...
1
vote
0
answers
97
views
OceanData not deep enough or just too deep for me?
It's exciting to see Mathematica/Wolfram Alpha addressing the marine realm in Version 12.2. Evidently, I was unaware that such data existed since Version 12.0 introduced in 2019. However, I have two ...
2
votes
1
answer
100
views
Clebsch-Gordan coefficients: General Expression Does Not Match Specific Expression
The expression ClebschGordan[{2, 0}, {4, 0}, {2, 0}] yields the correct result of Sqrt[2/7].
However the expression ...
4
votes
3
answers
88
views
Removing specific entries from a list
I have the list
L=8;
indx = Range[-π, π, 2 π/L]
(* {-π, -((3 π)/4), -(π/2), -(π/4), 0, π/4, π/2, (3 π)/4, π} *)
Now I want to delete specific elements of this list,...
1
vote
1
answer
184
views
Exploring curl of a gradient of a scalar function
Suppose I want to explore $\nabla \times \nabla V$ where $V$ is some scalar function. It basically results in a zero. But I would only know why if I solve it on paper. I wanted to use Mathematica for ...
0
votes
1
answer
486
views
How to remove complex infinity
I have an equation for the effective potential for a neutral particle (non-spinning), i.e.
VeffNonSPIN[r_, θ_] := (1 - 2/r)*(1 + LL^2/(r^2 Sin[θ]^2));
If I take ...
1
vote
1
answer
979
views
Mathematica Partial Fraction Decomposition full steps [closed]
I hope to get full steps instead of getting the result. Any ways to do so?
2
votes
1
answer
160
views
Copying Weights using NetTrain in Mathematica
I would like to implement the PPO algorithm - Reinforcement Learning - in Mathematica. And for that, I need to be able to copy network weights from say subnetwork NN1 to subnetwork NN2 as an update ...
3
votes
1
answer
234
views
Using dynamic programming to compute an integer sequence
Let a[n] = n + 1 - a[EulerPhi[n]], n integer > 0. I have Python code that generates the sequence using dynamic programming. How can I achieve the same thing elegantly/idiomatically in Mathematica?
...
0
votes
0
answers
56
views
Finding if a number is perfect square [duplicate]
I used the following code to found if a specific number is a perfect square:
...
5
votes
4
answers
510
views
Using the Tube function to create a torus from an equation for the curve
I've been searching for an answer for this for a while now, but I can't find anything that deals with using the Tube function to generate a torus from the equation of the torus.
The equation of my ...
3
votes
1
answer
91
views
Extracting information and adding more details to an imported image of a plot
I have the following image that has been created using another program.
Is there a way for Mathematica to load this image, "understand" the limits of the frame (horizontal axis between -1 ...
3
votes
1
answer
113
views
Can NetNestOperator take a non pre-defined number of iterations?
I'd like to Nest a particular NetChain inside a larger NetGraph for a random number of ...
14
votes
4
answers
634
views
Why MMA refuses to simplify the following simple expression?
I have the following simple expression
Exp[(Log[1 + x]^2 - Log[x]^2)/Log[1 + 1/x]] - x^2
that can be shown to simplify to x for ...