# All Questions

95,115 questions
Filter by
Sorted by
Tagged with
5 views

### Splitting an infinite sum in two parts results in a different total

I am completely puzzled why splitting an infinite sum into two parts, one where the index i is negative, and another where the index i is not negative, leads to a different result. I posted the code ...
• 71
6 views

### Finding the position of a list element using functions like Max on lists that might contain 'Indeterminate' values

I am working with lists of the following form: ...
• 75
21 views

### Best way to extend the size of a SparseArray

Let's say I have a "small" SparseArray, in the example $2\times2$ ...
• 36.9k
11 views

### Plot fill using phase of complex-valued function

I am plotting the time dependent solution of the quantum harmonic oscillator wavefunction. What So far I have been able to plot the magnitude squared of the function using this code: ...
31 views

### How to use Abort and Throw?

I was wondering if there is a way to break the following triple loop once condition01 is satisfied ...
1 vote
30 views

### I want to plot the frequency spectra of the output field

I have the following coupled equations, as shown in the attached picture. I want to solve them using the Runge-Kutta method and apply the initial conditions to my code and picture. Also, plot the ...
41 views

### ReplaceAll with PureFunction

Here is a small example. list = Thread[f[x, Range[3]]] (* {f[x, 1], f[x, 2], f[x, 3]} *) g = {#1, #2} & (* {#1, #2} & *) Then ...
• 1,201
34 views

### How to add plain text (or comment) to DisplayFormula?

I would like to add a comment to (behind) a displayformula. Is there a (recommended) way to add 'plain text'/'a comment' to a displayformula?
• 103
21 views

### Why is doing Monitor with a ProgressIndicator so slow?

Here's a handy "monitored map" function: ...
• 696
28 views

### Plotting arrows whose lengths are proportional to a list of numbers on a 2D grid

I am trying to plot arrows whose lengths are proportional to a list of numbers, on top of a 2D arrayplot. For example, I have an Arrayplot like this- I was able to lay circles whose diameter was ...
41 views

### Operations on Sub Lists

Let us assume that I have the following list of lists: foo = {{2, 1}, {3, 1}, {4, 1}, {2, 2}, {3, 1}, {2, 1}}; and that I want to multiply the elements of each sub ...
• 75
1 vote
33 views

### Deformation of Breather by Isometric Mapping

Is it possible to isometrically map the Breather surface $(K=-1)$ so that the end points at infinity on z-axis $(z=-\infty, z=+\infty)$ map onto to two finite separation points $( z=+a, z=-a)$ ...
• 3,214
1 vote
45 views

### Help dsolve obtain this solution to standard second order ode with missing x and y

Could someone find a smart way to help DSolve solve this second order standard ode? This is second order nonlinear ode with missing $x$ and missing $y$. ...
• 148k
1 vote
29 views

### Handling Argument Counts in Custom Functions in Mathematica

I'm working on a custom function, and I'm encountering an issue with verifying the number of arguments passed to the function. I want to ensure that my function only works with a specific number of ...
• 28.7k
1 vote
28 views

### Perturbation theory. Get xAct tensor component. Substitution for xAct tensors

I work with perturbations in FLRW metric with arbitary curvature. I'm following Weinberg's book. In modified gravitation theory there is additional tensor S and I need to find it's perturbation in the ...
1 vote
17 views

### Apply A Function With Parameters to a Dataset Query

If I create a simple Dataset like: ...
• 161
129 views

### Union of lists with original order

I would like to combine a few lists such that the resulting list follows the order of the original lists, which will have disjoint elements, but their order is compatible. ...
• 1,052
48 views

### How do I invert this function?

I have the following function that I want to invert to use in further calculations, i.e. I need to be able to plug in the expression $r = r(p)$ in further calculations where $r$ goes over the range ...
1 vote
44 views

### How to fix Mathematica's interpretation of numbers

I am trying to code something where the result are integers. However I am not sure how Mathematica interprets the number (3-2.95)/0.05 , since If I ask Mathematica to give me the integer part of this ...
• 195
1 vote
35 views

### Solving a non-linear ODE with a non-trivial coupling between the state variables

I'm trying to solve an ODE where I need to integrate over the entire solution (up to the calculated time step) of one of the state variables. The equations look as follows I outline below two pieces ...
• 2,105
1 vote
20 views

### Parallelizing efficiently a numerical integration over a list of data

Say I have a function f[x] that is an expensive multidimensional numerical integration. I want to map it over a list and evaluate it for each element. Currently, I ...
• 793
223 views

### Why did Resolve[] fail to verify a statement whose counter-example was proven to be nonexistant by FindInstance[]?

I wanted to know whether the following statement is correct. Let $a$, $b$, $c$, $d$ be positive real numbers such that $abcd=1$, then \frac{(3 a+1) (d-1)}{a+1}+\frac{(a-1) (3 d+1)}{d+1}+\frac{(3 b+...
• 281
139 views

### "Undefined" when attempting analytical expression for a RegionIntersection and its Area in V14.0

I know I can obtain the Area of a Region, both numerically and symbolically, for example: ...
• 36.9k
45 views

• 2,475
86 views

### Mathematica to Python

I have very large expressions in Mathematica which I need to convert to python for fast numerical computations. Is there a way to do it automatically. I dont want to type it manually. It will take me ...
• 141
29 views

### NDSolve for non-linear Poisson equation: the case of a pn diode

I am solving the physical problem of a pn diode under no bias voltage. This involves solving a rather 'complicated' non-linear Poisson's equation in 1D -\frac{\partial^2\phi(z)}{\...
• 583
100 views

### Trigger event if both conditions are met

I would like to change the colour of different regions if both are clicked. I can work around this with ...
• 8,820
66 views

### When symbol or name of calculated value needs to be mentioned once again

thC = 1.2; aa = 1.0; QQQQ = (thC + aa + 0.8) (* How to write "QQQQ"name/symbol once again in the next line after its value (3.) is printed ? *) It is too ...
• 3,214
58 views

### Inclusion of absorbing boundary in continuous stochastic process simulation

While I'm now aware of the great functions Mathematica has for simulating stochastic processes on an unbounded domain, a common problem is a bounded domain with absorbing boundaries. In particular, ...
113 views

### I have a error on my code but I can't find it!

I have a problem by my code I can't find it yet!! ...
• 447
1 vote
46 views

### Independent and interdependent notebooks

My Mathematica 11.2 home edition license under Windows 10 allows only for two independent notebooks/processes at a time. Is this what the Mathematica license calls "2 Frontends"? Does this ...
• 391
27 views

### Plotting the result of NDSolve for different values of a parameter

I have numerically solved an integral and plotted the result for a specific value $ll=0.1$ in a function g. ...
• 173
24 views

### FeatureExtractor = "Minimal" in Classify function

I would like to run Mathematica's Classify[] (and Predict[]) function without feature selection. If I set FeatureExtractor to "Minimal", what if any feature selection is implemented prior to ...
• 101
1 vote
28 views

### xCoba Change the components of the metric

DefScalarFunction /@ {f, bb}; metric = DiagonalMatrix[{-f[r[]], bb[r[]], r[]^2, r[]^2 Sin[\[Theta][]]^2}]; metric // MatrixForm The components of the metric take ...
• 111
74 views

### Sorting a list to achieve some minimum

I have a large list of ~10000 elements. The ordering of the list matters for my function, $f(\text{list})$ that evaluates to a positive real. I want to minimise $||f(\text{list})||$. At the moment I ...
• 4,594
234 views

### FindInstance on a system with three variables keeps evaluating

I have been trying to find a set of parameters for a function that fit some constraints. ...
• 31
1 vote
61 views

### Series does not deal with the branch cut for the power function correctly [bug]

This is an issue I am having in Mathematica version 13.1.0.0. According to https://functions.wolfram.com/ElementaryFunctions/Power/04/05/02/, the power function should have a branch cut for $x<0$ ...
62 views

### How to adjust the positions of the axes labels in the following way? [closed]

Consider the following plot: ...
• 5,887
52 views

### Encountered non-numerical value for a derivative [closed]

Trying numerically to solve Maxwell-Bloch (Optical Bloch equations) for 2-level system encountering this issue: ...
54 views

### Stiff ODE with step-like solution

Below is the code I am trying to evaluate: ...
1 vote
77 views

### How to check equivalence when variables in equations are replaced by their negatives?

In a previous post about checking whether two systems of equations are equivalent, the suggestion was to use the Reduced Row Echelon Form, which was great. However, I now want to consider an ...
• 817
549 views

### Possible bug in DateList, DateObject etc returning negative years in 14.1

DateList (and other date functions such as DateObject) were very good at catching ambiguous dates. However it looks like they ...
1 vote
79 views

### Reshaping a list as another nested list

I have the following list ( p to be some even number ) ...
• 307
128 views

### How can the errors in this Solid Geometry code be corrected?

As shown in the figure, in the cube ABCD-A1B1C1D1, point N lies on BD, point M lies on B1C, and CM = DN. Construct the intersection of plane MNB1 with the cube ABCD-A1B1C1D1 to obtain the cross-...
• 4,705
200 views

### Simplifing equation with complex coefficients

I'm trying to simplify an expression with complex coefficients. It should be very straightforward, but for some reason, I cannot get the correct answer. Please, see the code below: ...
198 views

### Generating a mesh with fine elements around certain areas

I want to generate a mesh on the following domain that has finer mesh elements near the edges of the seven disks. How can I do so? ...
• 365
57 views

### Manipulating plot of DSolveValue

I am solving a heat equation in following example: ...
• 3
1 vote