# All Questions

73,602 questions
Filter by
Sorted by
Tagged with
10 views

### Testing a condition to replace elements of amatrix

I want to write a code that checks each element of a given matrix C2 and in case they are't 0 or 1 , replaces them with 1. My code is so far as follows and the code ...
10 views

### NMinimize to ignore arguments for which function is complex valued

I'd like to minimize a pretty complicated function $f(x, y, z)$ with NMinimize, however for certain values of the arguments $f$ becomes complex valued, and my ...
24 views

### Reading product of same ByteArrays

I am handling a huge set of data and I am trying to optimize my code. I have very large expressions to expand and simplify and I've seen that converting the expressions to ByteArrays improves a lot ...
24 views

### Make an InterpolatingFunction periodic

Interpolation can make an InterpolatingFunction periodic with the option ...
43 views

### Curve Fitting Data using Polynomial

I have this Data set into Mathematica as such: ...
18 views

### Best way to get handle on the Ticks properties

There are a lot of questions already on Ticks. However I did not find a better way to handle ticks place, size etc. I have a simple example where I want have some ...
23 views

### How to efficiently check if a matrix is a Toeplitz Matrix

With ToeplitzMatrix we can create a Toeplitz matrix from a list of values. I have a question going in the opposite direction, namely, how to efficiently check if a ...
15 views

### Let NCAlgebra know that Tr[] commutes

I have an expression where there are terms like a ** (b*Tr[a ** b]) and I want to simplify it to something like ...
32 views

### How do I get built-in functions to use custom objects as if they were e.g. List?

(This is part 2 of my earlier question, Can I overload Part for specific heads (a la overloaded array subscripting)?, which was well-answered as asked.) Overview: My goal is to create a custom object -...
40 views

### How to ingest and analyze benchmark results posted at MSE?

How to ingest Mathematica / WL benchmark results posted at Mathematica StackExchange (MSE), like the ones posted here ? Assumptions: There are multiple answers with benchmarks posted The benchmark ...
8 views

### ToCTensor does not respect symmetry of tensor

If I try to convert a tensor object to a CTensor DefTensor[F[i, j], M, Antisymmetric[{i, j}]]; Fc = ToCTensor[F, {ch, ch}] The output is ...
20 views

### Find fit distribution of Normalized Histogram

I need to find a function to fit an histogram with "Probability" setting: Histogram[data,Automatic,"Probability"]. Thanks
19 views

### How can I let the length of a vector in VectorPlot be represented by it´s norm?

I would like to draw a vector field and let the magnitude of the vectors change over time (t) using the Manipulate function. The direction of the vectors will be static. ...
44 views

### Highlight elements in the list using pattern matching

Starting from the following list: list = {{a, b, c}, {d, e, f}, {g, h, i}, {b, c, d}, {c, a, m}, {c, d, n}}; I want to ...
7 views

### Contracting a Tensor with a CTensor in xAct

I'm trying to contract two tensors that I made in xAct to get a simple result. First I set up a Cartesian space ...
21 views

### Problem wiith If statements inside For loop

Consider If statement If[1 == 2, 1] which is false and so does not evaluate, and If statement If[2 == 2, 2] which is true ...
22 views

### Probability Generating Function(s)?

I'm very new to Mathematica and I have started to use it since I have been tackling some Physics related problems(I'm an engineer by training). Specifically, I'm dealing with Master Equations and one ...
66 views

### Solve for parameters so that a relation is always satisfied

Lets say I have a function parameterized by a number of variables. As a simple example $$F(x,y) = ax^2 +by^2-cxy+1$$ I want to find some set of values (doesnt really matter what they are) for the ...
18 views

### GridLines missing using SciDraw

Does anybody know how to include standard GridLines in SciDraw? I found this but it doesn´t really answer the question. Here my minimal example reproducing the problem: ...
14 views

### How to define a divergence-free vector or a traceless tensor in xAct?

I'm trying to implement a Friedmann-Lemaître-Robertson-Walker metric + a perturbation in a scalar-vector-tensor split in mathematica, using xAct. The S-V-T decomposition comes with some rules for the ...
46 views

### How can I make an FFT in Mathematica using data from a file? [closed]

I need to calculate the seismic moment of an earthquake data, but I don't know how the FFT is applied in some data, my data is a plain text that I must import it to Mathematica ...
21 views

### How to share multiple “tagged” functions (symbols) like f[a][b] in parallel kernels?

I would like to give some context: I need to analyse many data sets stored in files using different kind of analyses. To keep track I like to tag each results of my analysis for example like ...
35 views

38 views

### How do I find the solution of a system of Diophantine equations in two variables? [closed]

If the first equation is 2x+y=152, and the second is x+2y=100, and it is a fact that both variables are whole numbers and x is larger than y, what is the value of x?
34 views

### Symmetric part of a 4th rank tensor in mathematica

I am quite new to Mathematica and would like to know how to compute the symmetric part of a 4th order tensor $A_{ijkl}$. Since there are 4 indices (i,j,k,l), we have 4!=24 permutations. The symmetric ...
35 views

### Group pattern using parenthesis

I have a very long list of data. Below is a simplified version data = {junk1, textHeader, moveTo, text, moveTo, text, junk2, textHeader, moveTo, text, junk3} I ...
84 views

### How can I evaluate a certain integral numerically?

The problem arises as value of $\gamma_0$ is very high (on the order of 10^13), whereupon $\exp (-\gamma_0\,h_a^2)$ is becoming very small and ultimately zero. Can anyone help me to evaluate this ...
149 views

### Finding astroids

An astroid is a particular mathematical curve: a hypocycloid with four cusps. Given a lot of data points I'm trying to fit such a curve to the data. As an astroid is also an algebraic curve of grade 6 ...
46 views

### How to set colors for the customize contours

I am trying to beautify a contour plot where I have a wide data range. But still I want to use a linear scale for axis. But due to large range of the data, the most of the contours are restricted to a ...
24 views

### spontaneously quitting kernel, assignment and packed arrays

I am having an issue where the kernel spontaneously quits, deep in a long code that I have used for quite some time without this issue. I've tracked it down to an assignment of the form: a[[All, All, ...
90 views

### Infinite summation giving weird results

We are searching in our group for closed forms of derivatives of hypergeometric functions. This leads to expressions like $\sum\limits_{m=2}^\infty \frac{z^m\Gamma[m-1/2]H_m}{2m^2\sqrt{\pi}\Gamma[m]}$ ...
13 views

### Can't plot derivative of Hankel function [duplicate]

I am trying to plot the first derivative of $H^{(1)}_3 (ix)$ with respect to its argument $ix$, where $H^{(1)}_3 (ix)$ is the Hankel function of the first kind with order $3$, $x \in \mathbb{R}$ is a ...
40 views

### Summation of all elements of list [closed]

Lets say I have below list of elements in which summation of all elements need to be done. ...