Questions tagged [functions]
Questions about the use of built-in Mathematica functions, including pure functions.
3,884 questions
3
votes
1
answer
94
views
How can I generate unique partitions of a list into sublists of specific sizes (no overlap)?
I need to partition a list of elements into sublists of specific sizes, ensuring:
The order of elements within each sublist doesn't matter.
There is no overlap between sublists (each element appears ...
1
vote
6
answers
646
views
How to select a random element from a list without repetition until all elements are used?
I have a list, for example:
list = Range[10];
I would like to randomly select one element from this list each time I run the code. However, once an element has ...
4
votes
1
answer
129
views
How to split a graph at two cut vertices?
How can I split a graph into two subgraphs, as shown in the image below, given a pair of cut vertices?
(Let's assume the user ensures that a valid pair of cut vertices is provided.)
The possible cut ...
5
votes
1
answer
224
views
Is there an algorithm/functions to detect 2-isomorphic graphs?
Are there any algorithms or functions to find 2-isomorphic graphs (second isomorphism), either built into Mathematica, IGraph, or available in other programming languages?
I've been searching, but ...
0
votes
1
answer
85
views
Filling slots by referring to multiple lists [duplicate]
I have written a little function to find the odd integers between 3 and 1000 that are divisible by a given prime p but are not divisible by all the odd primes less than p.
...
4
votes
1
answer
203
views
Using Total to evaluate row sums of a matrix inside Compile
I have some code that evaluates a a large function of the strengths and degrees of a bipartite adjacency matrix. It takes a while to evaluate it, so I tried compiling it:
...
1
vote
1
answer
55
views
Why does Mathematica plot a function with a discontinuity as if one does not exist? [duplicate]
I wrote the code below to plot the function shown over two regions. Mathematica plots the function across the two regions (r from 0 to 2) without recognizing a discontinuity exists at r = 1 (a divide ...
0
votes
0
answers
58
views
How to plot a graph with intersections, asymptotes and turning points?
Is there a mathematica function that for some function like (x^2-1)/x it labels the intersections, asymptotes and turning points?
I'm new to mathematica, thanks ...
1
vote
0
answers
16
views
NDSolve::ndinnt Updating one IVP with Results of another at each iteration [duplicate]
I'm solving the problem involving two IVPs.
I start by creating a function of the inlet conditions of the first IVP. This function gives the value of the function at some point when the initial value ...
1
vote
1
answer
104
views
Attribute based pre-processing of arguments
I work with hashes that can be related to various data structures.
I find it convenient to have my functions work either when a hash argument is provided or when the required data structure is ...
3
votes
1
answer
141
views
Understanding the Distribute Function
I am trying to understand the built-in Distribute function. Should be simple enough, but for some reason, I can't wrap my head around it...
If I execute the ...
3
votes
1
answer
226
views
Find the position of a planet at a specific time
I have been trying to find the position of the planets at a specific time or date without success. The command which should work according to my reading of the documentation is
...
1
vote
2
answers
151
views
ParametricRegion doesn't recognise BezierFunction as 3D
Problem
I'm trying to make a MeshRegion from a bezier surface defined from an array of control points. Consider
...
0
votes
0
answers
93
views
Why does Mathematica not recognize an exact polynomial after SetDelayed command?
I am using the numerical analytic continuation method to find quasinormal modes of the black hole 2 with $s=0, l=1$ in arXiv:2209.00679, please see Table 1 of arXiv:2209.00679. However, my code is ...
2
votes
2
answers
94
views
How to automatically generate implicit regions from conditional expressions?
I need help writing a function that can automatically convert the following conditional expressions into implicit regions in Mathematica.
Given a list of conditional expressions:
...