Skip to main content

Questions tagged [order]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
8 votes
5 answers
295 views

Ordering with repeats

A quick question on list ordering, how can I easily get the ordering of the list, so that, for {0, Sqrt[3], 2 Sqrt[3], Sqrt[3], 3, 2 Sqrt[3]} I get ...
sam wolfe's user avatar
  • 4,863
1 vote
1 answer
56 views

Force certain operations to evaluate last

I have an integral of a term which first needs some massaging, e.g. (EDIT: Made the integral in such a way that it cannot be pulled out) ...
Confuse-ray30's user avatar
1 vote
0 answers
61 views

How to Parse Binary .STL File Created on Ancient 32-bit Architecture

Import[fileName,"STL"] returns $Failed The file format is so simple that one can calculate the number of triangles in the file by counting the number of BinaryReads to reach EndOfFile. https:...
Stewart Dickson's user avatar
6 votes
7 answers
610 views

Dropping disordered numbers in a list

I have a list of numbers like l1 = (1,2,3,4,8) and clearly, l1 is in order (next number is greater than previous number). Well, ...
cheese.burger's user avatar
1 vote
3 answers
122 views

Is it possible to prevent two functions from commuting?

I have an expression of the following type: x f[a] g[b] where x is a number but f[a] and <...
Pxx's user avatar
  • 711
2 votes
2 answers
89 views

How is the output (a list) of the "Eigenvalues" function ordered?

The documentation of the function Eigenvalues says that the Eigenvalues are sorted in order of decreasing absolute values. But what is if the absolute values are the same. For example when two ...
zbjoko's user avatar
  • 35
4 votes
4 answers
411 views

How to replace the element in list of list by its ordering index

I have a list of list: res={{9, 1, 5}, {3, 6, 12}} I want to change it to res={{5, 1, 3}, {2, 4, 6}} by following their ordering ...
mmmm's user avatar
  • 95
3 votes
3 answers
491 views

Check ordered subset in list

I need to find a function that checks if a list is contained in a larger list RESPECTING the order of the smaller one. For example check[{a,b,c},{a,d,b,c}] would ...
Marcosko's user avatar
  • 259
5 votes
5 answers
280 views

Finding relative ordering of two lists

Suppose you have two lists A and B which are related by a permutation, and have no repeated elements. Is there a simple and ...
ComptonScattering's user avatar
2 votes
0 answers
85 views

How to improve the efficiency of NIntegrate on complicated functions?

When solving a problem by Matlab and Mathematica both, I find the speed of NIntegrate are far less than dblquad when calling ...
swish47's user avatar
  • 153
1 vote
1 answer
92 views

KSetPartitions function with fixed points

I'm trying to develop a function that computes some numerators for scattering amplitudes and I need to generate a collection of tree diagrams that contain a set of particles (effectively numbers) <...
Marcosko's user avatar
  • 259
2 votes
1 answer
86 views

Visualizing order of operations

TreeForm[HoldForm[ (9-2^2+10 8)/9]] produces this: Is there a way to use Divide instead of ...
Geremia's user avatar
  • 478
4 votes
2 answers
116 views

Tuples which treats re-ordering as equivalent [duplicate]

I would like to define a new function myTuples, that behaves just like Tuples, except that it treats, as with ...
Patrick.B's user avatar
  • 1,511
3 votes
1 answer
160 views

Re-sorting higher-order ordinary differential equations

I have some higher-order ordinary differential equations. Firstly, I want to collect the terms with common factors together. Besides, I want to re-sort the ODE with the highest order term first. How ...
Eric_Jansen's user avatar
6 votes
4 answers
224 views

How to order the coordinates generated by ToBoundaryMesh counterclockwise?

The following code works for polygons. A square 4x4 is tried here: ...
Husain Al-Gahtani's user avatar
0 votes
1 answer
111 views

Double Sum, taking a constant out of the first sum gives a different result

I have a code with the following double sum: Sum[Sum[(-1-k+f[k]) (-l+n+f[l]), {l,k+1,n}], {k,1,n}] /. f[r_] -> If[r == 1, n, 0] With that, I get: I wanted to ...
Wille Bell's user avatar
3 votes
1 answer
128 views

reorder 2-d list according to the second value of each element

I have a nested list with n row and 2 column, its values are numbers, Can I change the order of elements according to the second value?? so every element have in its second value the same value in the ...
user81348's user avatar
1 vote
1 answer
207 views

Find Order of a Differential Equation (ODE or PDE)

In Mathematica, I need a code in order to find the order of ODEs and PDEs. Here are some examples using different notations: For fifth-order ODE: ...
Eric_Jansen's user avatar
2 votes
1 answer
101 views

How to get neighbor lists in the same order/orientation from a periodic IGTriangularLattice[] graph?

Using IGraphM, I want to get the VertexComponent[] neighbors around all nodes, in a periodic IGTriangularLattice[] graph. To do ...
TumbiSapichu's user avatar
  • 1,603
1 vote
2 answers
94 views

Rearrange a matrix with new Table Headings-List

I have used a procedure to rearrange my data in a more appropriate way for data analysis such that more similar elements lie next to each other and dissimilar ones far apart. Let's say I have a 5x5 ...
Axha's user avatar
  • 83
1 vote
0 answers
41 views

Yet Another Expression Ordering Question (not polynomial but transcendental)

Forcing a particular ordering of terms, i.e. overriding Mathematica's, is a recurrent issue, especially for users working within particular domains where there is a particular ordering tradition or ...
Julian Moore's user avatar
  • 2,560
1 vote
1 answer
53 views

l,r-operations on words $[[[1,2],3],4] \cdots, n]$, $[1,[2,[3,\cdots, [n-1,n]\cdots ]]]$

Suppose I have a word $\{1,2\}$, then $l(\{1,2\}) = \{[1,2]\} = \{1,2\} - \{2,1\}:=12-21$ and for the word with length $3$, (I will omit bracket), the $l$-operation is defined as $ l(1,2,3) = [[1,2],3]...
phy_math's user avatar
  • 923
4 votes
1 answer
154 views

Concise way to do lexicographic ordering

I want to order a bunch of number sequences lexicographically. Did this with ...
მამუკა ჯიბლაძე's user avatar
2 votes
1 answer
32 views

ordered set inclusion 2

Slightly change the previous question, ordered set inclusion, Now, consider $A=\{2,3\}$ and $B=\{2,3,4,5\}, C=\{5,2,4,3\}$, Now I want to make element $\{2,3\}$ is in $B$ as well as $C$, what can be ...
phy_math's user avatar
  • 923
2 votes
1 answer
49 views

ordered set inclusion

Suppose I have a ordered set $A=\{2,3\}$ and $B=\{2,3,4\}$ and $C=\{2,4,3\}$. Is there any mathematica command whether $A\subset B$ gives true(or 1) but $A$ which is not a subset of $C$ gives false(or ...
phy_math's user avatar
  • 923
2 votes
2 answers
140 views

How to reorder {x,y} list data and plot as ListLinePlot

How to re-arrange data to find line plot in order (I tried with given below code). ...
Gopal Verma's user avatar
  • 1,065
1 vote
0 answers
30 views

Consistency of sample quantile to population quantile for discrete variables [closed]

Can I know if the sample quantile converges to the population quantile in probability for discrete variables? If we use Hoeffding (1963)'s results, is this true?
jun lu's user avatar
  • 39
1 vote
4 answers
1k views

How would we extract elements of a list greater than a certain value? [closed]

Say we have a list {35,210,67,950,32,365} how would we extract all the elements greater than 100 from this list (using a function)? The desired output would be ...
user avatar
1 vote
4 answers
126 views

Sorting a function

So I have a function f[x : {{_, _} ...}] := f /@ x; f[a_,b_]=:a+b. I can input f[{1,2},{2,0},{3,4}] and get ...
user avatar
2 votes
0 answers
52 views

Map Inverse Ordering on Matrix [duplicate]

I have an matrix (symmetric, but any $n \times n$ will do) $$A = \begin{bmatrix} 0 & 4.5 & 6 & 5.5 \\ 4.5 & 0 & 4 & 3 \\ 6 & 4 & 0 & 5 \\ 5.5 & 3 & 5 &...
aptmess's user avatar
  • 63
14 votes
3 answers
416 views

Ordering Problem With VoronoiMesh

Imagine I want to model 2D cells moving in a tissue. Consider, as an example, Lloyd's relaxation algorithm. Using VoronoiMesh I'm able to mimic some cell movement. ...
sam wolfe's user avatar
  • 4,863
8 votes
2 answers
2k views

Best way to insert element into an ordered list at the correct position?

Suppose I have an ordered list orderedList and I want to write some code that will involve regularly inserting new elements into ...
WillG's user avatar
  • 960
2 votes
1 answer
71 views

Does Mathematica have an order relationship for lists, or a general ordering relation?

{1, 2} < {3, 4} doesn't seem to work, but Sort[{{3, 4}, {1, 2}}] yields {{1, 2}, {3, 4}}. ...
user3257842's user avatar
7 votes
1 answer
183 views

Ascending and descending in the context of the order of operations on Datasets

I did not understand the concepts ascending and descending in the context of the order of operations on Datasets. It is listed in the documentation, on Dataset's page and yet I did not understand. ...
Dani's user avatar
  • 257
8 votes
4 answers
1k views

SortBy first element then second element, and so on?

SortBy can sort list by first element easily like so: SortBy[{{1, 6}, {1, 2, 8}, {2}}, First] and the result is: {{1, 6}, {...
liang's user avatar
  • 599
2 votes
1 answer
113 views

Inverse of matrix up to some order

Let $A(t,s)$ be a matrix of any size (potentially large), whose entries are polynomials functions wrt $(t,s)$ of order $N$. I would like to compute the inverse $X$ of $A$ up to the order $N$ that is $...
Smilia's user avatar
  • 592
0 votes
1 answer
51 views

Order of evaluation of variable

I'd like to control the order of evaluation in a multi-variable function. Example: Suppose I have the function: B[x_, y_] := x + y/x; If I try to evaluate ...
user avatar
1 vote
0 answers
73 views

Dealing with positive power variables in Taylor expansion and assumptions

I would like to compute the Taylor expansion of monomials whose powers are nonnegative rational variables. First, here is a function which encodes the multivariate Taylor expansion at the points <...
Smilia's user avatar
  • 592
8 votes
2 answers
283 views

How does Query decide the order in which the functions are applied?

First of all I know that Query is a nice way to organize your functions that are applying at specific levels of an expression. But I don't understand the order in ...
user13892's user avatar
  • 9,443
14 votes
4 answers
1k views

ListPlot join points by nearest neighbor rather than order

I have found some software that allows me to "data mine" the values from publication figures. I have a bunch of contours from papers that I've mined using this software, and am having some trouble ...
zack's user avatar
  • 405
3 votes
1 answer
177 views

Symbol Order for Built-in Functions such as TrigReduce

I’d like to use the TrigReduce function on a sum of n sinusoids to any power, and am running into an issue with Mathematica’s default ordering of symbols. Is there a way that I can specify an order ...
TikiTiki's user avatar
2 votes
1 answer
3k views

What is "standard" or "canonical" order? [duplicate]

When trying to sort a list of fractions and quadratic numbers I'm trying to work out why sort orders the quadratics after the fractions. It seems to use the function "OrderedQ" and "standard order" or ...
pdmclean's user avatar
  • 1,398
7 votes
1 answer
266 views

Cross product without reordering (noncommutative)

Not related to question I assume this question (as it is of very general structure) might have been asked before, unfortunately I did not find an answer to it - despite what I used as search queries. ...
pbx's user avatar
  • 842
4 votes
2 answers
184 views

Cyclically Flat Functions

Any idea how to define some operator ° such that e.g. $((a°b)°c)°d=a°(b°(c°d))=a°b°c°d=b°c°d°a$ (but $a°b\neq{b°a}$ in general)? So ° is Flat plus (insert here)?
Hauke Reddmann's user avatar
0 votes
1 answer
141 views

how to order a parameter by power?

for example, y=a x^2+ a(b x^2)+c^3 x^2+z^2+c z how to tansfer function y to formart like y=?x^2+ ?x+? and y=?z^2+?z+? So, I want to tansfer the equation below to arrange both A_{2l} and A_{2h} (one ...
Centrino Gu's user avatar
0 votes
0 answers
210 views

The order of evaluations with nested slots [duplicate]

I tried to join a series of evaluations with nested slots as follows: #^2 & /@ #^2 & /@ Range[10] However, the results were somewhat different from what ...
Satoshi Oota's user avatar
1 vote
1 answer
467 views

Ordering of monomial terms

I have monomials with variables $a_1,\, a_2,\,\dots$ also their complex conjugates. I found that their order within the monomial depends on at which point I set the overline for the complex conjugate. ...
sdx23's user avatar
  • 21
1 vote
1 answer
898 views

Variable order in output

I have two questions about editing my output in Mathematica. I want the variables to be to the right of the fractions with the parameters. Update ...
chrisdi91's user avatar
4 votes
0 answers
121 views

How do I reassign the ordering of symbols in a polynomial expression?

I have a big polynomial expression, like this: ...
user43259's user avatar
1 vote
3 answers
894 views

Matching the order of a master list of lists from a random list of lists

Using Mathematica 9, I have 2 lists of lists one master with dimensions {300, 6}. The second is some random order but has the same first ...
Nothingtoseehere's user avatar