Message Boards Message Boards

0
|
2909 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Putting all extrema of an NDSolve output into a single list?

Posted 3 years ago

Hello everyone,

I am trying to put all of the extrema of an NDSolve output into a single list. Specifically, I am hoping to have the extrema listed in order. For instance, in the case of an oscillatory system, I would hope to have a list like the following: {Maximum 1, Minimum 1, Maximum 2, Minimum 2,...}. Is there an efficient way to accomplish this? Attached is a notebook showing the system of equations I am working with.

Attachments:
POSTED BY: Alex L
4 Replies
Posted 3 years ago

How is this question different from this one?

POSTED BY: Rohit Namjoshi
Posted 3 years ago

That question was asking how one can put the minima in a single list and the maxima in another separate list. This question is asking how one could put the maxima and minima in a common list and in the order that they appear. For instance, {maximum 1, minimum 1, maximum 2, minimum 2, etc}. Is this possible?

Alex

POSTED BY: Alex L
Posted 3 years ago

Something like this?

max = {1, 3, 5}; min = {2, 4, 6};

Riffle[max, min]
(* {1, 2, 3, 4, 5, 6} *)
POSTED BY: Rohit Namjoshi
Posted 3 years ago

Oh, I did not think it could be done that easily. Thank you! I am new to Mathematica, so I apologize for all of the really specific questions. Your help is much appreciated.

Alex

POSTED BY: Alex L
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract