Skip to main content

New answers tagged

2 votes

Delete elements less than the last largest element

A variant using FoldList: Union@Rest@FoldList[If[#2[[2]] > #1[[2]], #2, #1] &, {0, 0}, list] {{1, 170.93}, {3, 174.08}, ...
E. Chan-López's user avatar
2 votes

Delete elements less than the last largest element

Using IncreasingFilter by Sander Huisman ...
eldo's user avatar
  • 81.7k
1 vote

Check if number is in list

list1 = {{1, 2, 3, 4, 5}, {1, 2, 3, 4, 5, 6, 7}, {1, 2, 3, 4, 5, a}}; list2 = {{1, 2, 3, 4, 5}, {1, 2, 3, 4, 5, a}, {1, 2, 3, 4, 5, -1}}; Using ...
E. Chan-López's user avatar
1 vote

How can I print only the lines for a file that contain consecutive digits?

string = "123 321 567 765 124 568"; Using StringSplit and Select: ...
E. Chan-López's user avatar
1 vote

How can I print only the lines for a file that contain consecutive digits?

...
eldo's user avatar
  • 81.7k
2 votes

Check if number is in list

list = { {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5, 6, 7}, {1, 2, 3, 4, 5, a}}; 1. Using LookupPart by Richard Hennigan (Wolfram ...
eldo's user avatar
  • 81.7k
0 votes

Simplifying products of DiracDelta

Here's an extension of @Ulrich's solution, taking into account the Jacobian of the transformation: ...
Michael E2's user avatar
  • 239k
1 vote

Flattening the output of Solve[]

expr = Solve[y[x] == x^2 + c, c]; Using Query Query[Flatten, {Keys, Values}] @ expr {c, -...
eldo's user avatar
  • 81.7k
2 votes

Canonical way to map a function to diagonal elements of a square matrix?

A = {{E, 0, 0}, {0, E, 0}, {0, 0, E}}; Using SubsetMap: ...
E. Chan-López's user avatar
1 vote

How to compile the code for generate Pythagorean_triple?

A variation of Mr.Wizard, a little faster: ...
chyanog's user avatar
  • 15.6k
1 vote

How to compare and remove x-coordinates (and the associated y-coordinates) that are less than previous x-coordinates?

...
eldo's user avatar
  • 81.7k
3 votes

Any built-in function to generate successive sublists from a list?

Using AccumulateApply by Ian Ford and Jon McLoone ...
eldo's user avatar
  • 81.7k
1 vote

Creating a list of lists as a function of a list

Inspired by @ubpdqn's answer, I propose the following variant: ...
E. Chan-López's user avatar
2 votes

Approximate value for the area between the curve

Using IntegralApproximationPlot by Dennis M Schneider ...
eldo's user avatar
  • 81.7k
1 vote

SubsetQ[] without ignoring duplicates

Using MultisetIntersection by Robert B. Nachbar (Wolfram Solutions) ...
eldo's user avatar
  • 81.7k
1 vote

Creating a list of lists as a function of a list

f[a_] := MapAt[-1 &, Table[1, Length[a]], #] & @@@ Position[a, -1] f[a : {1 ..}] := f[-a] f @ {-1, -1, 1} {{-1, 1, ...
eldo's user avatar
  • 81.7k
1 vote

A fast, robust DropWhile

Using DropWhile by Sander Huisman DropWhile = ResourceFunction["DropWhile"]; DropWhile[{2, 4, 6, 1, 2, 3}, EvenQ] {...
eldo's user avatar
  • 81.7k
0 votes

How to get multiplication of the elements of a specific list/matrix

list = {a, b, c, d}; Using AccumulateApply by Ian Ford and Jon McLoone ...
eldo's user avatar
  • 81.7k
3 votes

Are there contributed Mathematica programs which yield the normal form and Lyapunov coefficients of an ODE at a bifurcation point, in dimens 3 or more

This is not an answer to the question or at least only a partial one. It may help to get started though. A Hopf bifurcation at an equilibrium, if I understand correctly, happens when the Jacobian has ...
Daniel Lichtblau's user avatar
2 votes
Accepted

Are there contributed Mathematica programs which yield the normal form and Lyapunov coefficients of an ODE at a bifurcation point, in dimens 3 or more

I have no method but Let's refine the script you provided to ensure it handles the computation of the L1 coefficient and the normal form correctly. I'll integrate improvements while maintaining the ...
zeraoulia rafik's user avatar
2 votes

How to extract both first and last rows of each group from unbalanced panel data

...
eldo's user avatar
  • 81.7k
3 votes

Use Mathematica to calculate the area enclosed between two curves

Using 3 resource functions by Wolfram|Alpha Math Team: ...
eldo's user avatar
  • 81.7k
0 votes

GatherBy based on condition imposed on index variable

...
eldo's user avatar
  • 81.7k
0 votes

How to replace identical positions in two different lists

la = {1, 2, 3, 4, 5}; lb = {a, b, c, d, e}; p = {1, 5}; Using SubsetMap (new in 12.0) ...
eldo's user avatar
  • 81.7k
0 votes

How to group lists that own one common element?

list = {{1, 2}, {3, 4}, {2, 5}, {2, 6}, {5, 4}, {9, 7}}; Using IntersectingQ (new in 10.0) ...
eldo's user avatar
  • 81.7k
2 votes

Restricted accumulation of values

Using Min: data = {-1050, 50, 1001, 1950, 1950, 1950, 525, 0}; FoldList[Min[#1 + #2, #2] &, data] -> {-1050, -1000, 1, ...
ubpdqn's user avatar
  • 62.8k
3 votes

Restricted accumulation of values

data = {-1050, 50, 1001, 1950, 1950, 1950, 525, 0}; Using Table, Take and ...
E. Chan-López's user avatar
3 votes

Restricted accumulation of values

data = {-1050, 50, 1001, 1950, 1950, 1950, 525, 0}; Using SubsetMap (new in 12.0) ...
eldo's user avatar
  • 81.7k

Top 50 recent answers are included