Skip to main content

Questions tagged [code-request]

Questions on finding existing Mathematica implementations or expertise to address a clearly stated problem.

Filter by
Sorted by
Tagged with
1 vote
0 answers
62 views

How can I speed up symbolic integration of this highly oscillatory function?

I am trying to figure out how to speed up this symbolic integration. I have tried parallelization and numerical integration (both I am failing to implement). Here is the function: ...
brian mcgloughlin's user avatar
0 votes
0 answers
37 views

Please correct this code to show plotting lines

The given code does not show plotting lines, but I need given plot in the image. ...
Iram Riaz's user avatar
2 votes
0 answers
66 views

Regional Rank Choice Voting on Maps

So, I made an algorithm to do rank choice voting on regions. Based on where you are, votes for candidates are stored in specific position in each list that labels the region. If there is a tie, then ...
Teg Louis's user avatar
  • 114
0 votes
0 answers
86 views

Proving Exact Answers to Logistics Map for 3-Cycles

Seems that I may have found a pair of exact solutions to the logistics map with cycles of period three. However, I’ve run into a bit of a snag in proving it because of some “ambiguities” in the ...
Steersman's user avatar
1 vote
1 answer
57 views

Using a pre-rendered image of a plot within a Mathematica Figure

I want to plot new data over data that I only have in the form of a figure in order to be able to make a comparison. Say for example I have only the image (not the original data) produced by (or ...
Kvothe's user avatar
  • 4,651
4 votes
1 answer
51 views

DeleteDuplicates By Proportionality

I have a list of expressions and I would like to delete "duplicates" that are proportional to each other where the (simplified) proportionality constant satisfies NumericQ. What would be the ...
Kvothe's user avatar
  • 4,651
0 votes
0 answers
44 views

Using NetMeasurements for basic neural network

I have a neural network that works fine, but I would like to obtain some results on the Validation Set which provides some metrics on the performance of the training. I am obtaining some strange ...
John Doe's user avatar
  • 271
0 votes
1 answer
126 views

How to execute this code? [closed]

I want to plot the following equation: ...
vijay's user avatar
  • 47
0 votes
0 answers
34 views

ReplaceIndexed function

I would like a replaceAllIndexed in the spirit of MapIndexed where there is an easy way to access the counter in the rule. I ...
Kvothe's user avatar
  • 4,651
0 votes
0 answers
90 views

SoftmaxLayer with one-hot vectors

The quantum physics problem I am looking at is a rotated qubit. The setup involves a y-rotated qubit measured in the z-basis (hence spin-up and spin-down). This scenario typically includes modeling ...
John Doe's user avatar
  • 271
0 votes
0 answers
62 views

Using CrossEntropyLoss function for basic neural network

Hi I am interested in understanding how to use the neural network functions in Mathematica. I have just started learning hence this is a basic query. The simple example I am looking at is as follows: ...
John Doe's user avatar
  • 271
0 votes
0 answers
48 views

Solve in solving equation system

I have the following problem: I have a system of equations specifically consisting of 56 equations, with 34 coefficients to be determined, in simplified form: ...
iron's user avatar
  • 1
0 votes
2 answers
81 views

Generating lists where new elements depend on the previous element

I am interested in using some type of list or table in-built Mathematica function to generate a list, where the elements of the new list not only depends on the input values of a previously defined ...
John Doe's user avatar
  • 271
3 votes
2 answers
152 views

How to draw a curve projection?

I want to draw the following projection picture for the cuspidal cubic curve in Mathematica. Does anybody know how to do this?
eloparti's user avatar
5 votes
4 answers
354 views

Still on Filling

I am really sorry to bother you for the same problems, but I cannot get in the view about this command, the filling option. What I want: to fill the semicircle part, under the $y = x$ curve. Here is ...
Enrico M.'s user avatar
  • 963
0 votes
1 answer
66 views

Generate all commutators and anti-commutators up to a certain order of a list of matrices

I am given a list of matrices. At first order I want to evaluate the commutators and anti-commutators of all pairs in the list and return a new list that contains two lists: one containing all ...
JohnnyB's user avatar
  • 115
4 votes
3 answers
231 views

Vertical line: plotting and filling

I need some help to complete this code in order to make the wanted plot. In the following, the function that I define as $m(x) = 1$ should be replaced (if possible) to a function that plots a vertical ...
Enrico M.'s user avatar
  • 963
1 vote
1 answer
72 views

Adding list of error-bars to plot

I have a basic question about adding error-bars to a plot. It seems that the built-in errorbar function is no longer available, could someone advise on what would be an efficient way to include the ...
John Doe's user avatar
  • 271
2 votes
1 answer
71 views

Solving multivariable equation after setting partial derivative to zero

I have a real-valued function of four variables, namely $L[\phi, m0, m1, m2]$. I am interested in taking the partial derivative $\partial_{\phi}L$ thereof and setting the partial derivative to zero, ...
John Doe's user avatar
  • 271
3 votes
1 answer
126 views

Problem with calculation of Lyapunov exponent

The code given by Chris K for Lyapunov Exponent does not work and gives lot of errors for the dynamical system given in equation(2) of this paper The dynamical equations: ...
Arssat's user avatar
  • 187
7 votes
1 answer
511 views

Borromean rings [closed]

how can I plot the Borromean rings in Mathematica? I am interested in the configuration showcased in figure.
Yasha Gindikin's user avatar
1 vote
1 answer
87 views

How to plot a community structure with specific properties

This code generates a community structure where each community is shown with a different color. The same color is used for bars within a community and outgoing edges from that community. I would like ...
Tugrul Temel's user avatar
  • 6,263
2 votes
1 answer
90 views

Alternative Representation for Energy Levels and Energy Level Density

I need to show the energy level density around the local maximum of this double-well potential. I can do it using the following: ...
user444's user avatar
  • 2,688
5 votes
5 answers
210 views

How to color a selected set of variables in a ListPlot

This code: ...
Tugrul Temel's user avatar
  • 6,263
4 votes
1 answer
288 views

Recognizing a Higher Percentage of Multiple Barcodes from an Image

I would like a path or way to find barcodes in an image and read more of them and ideally quicker (It is very slow for an image). So, BarcodeRecognize[] already ...
Teg Louis's user avatar
  • 114
3 votes
1 answer
95 views

Quickly processing long lists using SequencePosition

Overview SequencePosition does exactly what I need; however, it seems to be very slow for long lists. Is there an input option that would allow it to process faster? Or, perhaps an alternative ...
user6546's user avatar
  • 1,079
5 votes
2 answers
173 views

How to combine two different datasets to create a unified dataset

I have two different datasets : dsDat1 and dsDat2: ...
Tugrul Temel's user avatar
  • 6,263
7 votes
6 answers
556 views

How to identify intervals for each integer number

I have two lists: ...
Tugrul Temel's user avatar
  • 6,263
9 votes
2 answers
1k views

Can Mathematica perform logical reasoning?

The question goes like this: Ms. Li has just moved into a new home and plans to buy several potted plants at once. Her thoughts are as follows: Buy either Green Radish or Podocarpus. Buy at least ...
csn899's user avatar
  • 4,824
1 vote
1 answer
66 views

Compressing a file's name string

I was working with files where each name records a lot of information about what is in its respective file and wanted to compress it a little bit. So I wanted to change it's 'base'. And I noticed that ...
Teg Louis's user avatar
  • 114
2 votes
2 answers
183 views

Why do image sizes shrink when printing multiple plots as a single object?

I searched the repository a lot and found no answer to the following question. My code below produces 4 plots as a group. Each plot has ImageSize->300. However, ...
Tugrul Temel's user avatar
  • 6,263
6 votes
3 answers
436 views

Placing a single X and a single Y axis to a group of plots

I have the following 4 plots sharing a common X and Y axes. I place 4 plots in a grid of 2 by 2. I do not want to use separate X and Y-axis labels for each of them. Instead, I want to put a single X-...
Tugrul Temel's user avatar
  • 6,263
1 vote
2 answers
82 views

Numerical search of two simultaneous equations for three unknowns

Given the following two equations with three unknowns $\eta_1, \eta_2$ and $\tau$: $\frac{i e^{-i \phi/2}}{\sqrt{2}} = \cos(2 \tau - \eta_1 -\eta_2)\cos(\eta_1-\eta_2) - i\sin(2 \tau - \eta_1-\eta_2)\...
John Doe's user avatar
  • 271
3 votes
2 answers
293 views

Reading what is inside DataStructure[]

In my code I end up with such data structures and I cannot see what is inside. Is there a command to open this type of data structure? I tried \\Normal but it does ...
Tugrul Temel's user avatar
  • 6,263
7 votes
1 answer
296 views

How to condition all cells of a notebook to a specific SeedRandom?

Is there a way to fix SeedRandom[.] for an entire notebook? If I carry out many calculations using random numbers, I need to give a separate code ...
Tugrul Temel's user avatar
  • 6,263
4 votes
1 answer
142 views

How to maximize over a set containing an isolated point?

How can I maximize a function F over a set composed by a compact set like [a, b], plus a single isolated point, like $[a, b] \cup \{p\}$? I cannot code the isolated point part.
Heidegger's user avatar
  • 347
2 votes
2 answers
147 views

Shape of a boomerang

I want to create a physical pendulum in 2D with the shape of a boomerang. And first problem I met with was how to define a boomerang, so I could have a shape of it and use it to make my pendulum. Can ...
pewna osoba's user avatar
1 vote
1 answer
149 views

How can a directed network model be linked to Dataset[ ] for further computation?

REVISED Question: My only request is to know how to monitor the evolution of {agentStates, steps} in simulateSlow[...] function. ...
Tugrul Temel's user avatar
  • 6,263
2 votes
1 answer
76 views

Defining multivariable function from previous cell output

In the following, I would like to define a function $h(\theta, \beta, \alpha_1, \alpha_2)$. The function $h$ should be defined by the output of a previous function (which includes the partial ...
John Doe's user avatar
  • 271
1 vote
0 answers
157 views

How to construct a layered 3D graph of three community structures?

Consider: ...
Tugrul Temel's user avatar
  • 6,263
0 votes
1 answer
53 views

Making some powers of variables inside the function : $X * \alpha^{m} *\beta^{n} f[A[x,y]] \Rightarrow X f[\alpha^{m}\beta^{n} A[x,y]]$

Suppose I have a function of the form $ a_1 a_2 \cdots a_n b_1 \cdots b_m \cdots f[L[x,y]]$. I want to make some particular letters and their power inside the bracket. i.e., I want the letter $\alpha,...
phy_math's user avatar
  • 923
1 vote
2 answers
151 views

Normalized Coincident Detection Probability of Laguerre - Gaussian Modes

I am working on a paper in which a pump mode is passing through SPDC(Spontaneous Parametric Down conversion) is converted into two photons called as signal and idler. In which laguerre-Gaussian mode ...
Qubit's user avatar
  • 45
2 votes
0 answers
80 views

Extracting tables from .pdf

Can we construct some automated method for extracting tables from pdfs? I can get decently far by just copy and pasting its content and splitting at newlines but it would be great if it was possible ...
Kvothe's user avatar
  • 4,651
2 votes
1 answer
94 views

How to transform the regions in which a piecewise function are defined?

I have a function f[x,y,z] that has a piecewise definition, i.e., its values depends on the ranges of the arguments. Now suppose I have a coordinate transformation <...
user1620696's user avatar
1 vote
2 answers
182 views

Sorting a list of functions by exploiting the recursive structure

Given a list of functions list and a vector of arguments {t, a}: ...
Tugrul Temel's user avatar
  • 6,263
3 votes
1 answer
580 views

How to simulate a directed acyclic graph?

My goal is to have a code to identify and estimate the regression models associated with a directed acyclic graph (DAG), which is obtained through the reduction of a given weighted, directed graph <...
Tugrul Temel's user avatar
  • 6,263
9 votes
1 answer
376 views

How to replace graph communities with the associated bar charts?

The following code generates a community graph and a set of bar charts, each one of which corresponds to a community. ...
Tugrul Temel's user avatar
  • 6,263
0 votes
0 answers
78 views

Finding the Complete Silhouette Area Formula given a Convex Polyhedron

Like always, I am probably over complicating this and there is a much simpler way to derive a general formula using built-in Mathematica functions, think about it differently, or a faster way to solve ...
Teg Louis's user avatar
  • 114
0 votes
0 answers
64 views

How to create a customized layered community structure from a directed graph

This answer provides a code for scaling the sizes of communities. I like to make the presentation of the community structure given in this answer (by @kglr) a bit more informative and friendly by ...
Tugrul Temel's user avatar
  • 6,263
4 votes
2 answers
184 views

How to create a size-adjusted community graph with eigenvector centrality bubles

Given this: ...
Tugrul Temel's user avatar
  • 6,263

1
2 3 4 5
11