MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Using Equal with Real Numbers

  • To: mathgroup at
  • Subject: [mg123206] Re: Using Equal with Real Numbers
  • From: Gabriel Landi <gtlandi at>
  • Date: Sat, 26 Nov 2011 05:08:58 -0500 (EST)
  • Delivered-to:
  • References: <> <> <> <>

Hello guys,

I really appreciate the comments.

However, I still believe that slow as it may be, my original solution is 
still more adequate.
The reason is that I am not interested in using only MemberQ, but rather 
a variety of pattern matching functions.
Another example is:

In[1339]:= Union[Range[0, 1, 0.1], {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 
0.7, 0.8, 0.9,1.0}]
Out[1339]= {0., 0.1, 0.2, 0.3, 0.3, 0.4, 0.5, 0.6, 0.6, 0.7, 0.7, 0.8, 
0.9, 1.}

Perhaps I could explain my simulations in a little bit more detail and 
then see if there are any suggestions or comments.

In summary I solve a large system of differential equations which depend 
on N free parameters, each spanning a broad range of values.
Usually N = 5, which gives a quite large number of possible 
The issue then is, how do I keep track of which simulations I have 
already computed?
Basically, it is a problem of forming n-tuples from different 
combinations of the parameters and then having a "data base" ( a long 
list with a bunch of tuples) that stores which ones I have already 

Except for the issues with pattern matching, this is quite simple. For 
instance, let N = 2 and suppose I want to simulate (in addition to all 
previously computed) some ranges:

para1 = {1,2,3};
para2 = {0.001,0.01,0.1,1.0};

Then I do

newset = Distribute[{para1,para2},List];

This gives me a list of 2-tuples with all simulations that I wish to do.

For instance, If I want to know which have not yet been computed 
(assuming that AllSets is a list containing all that already were), then 
I do

notcomputed = Complement[newset, AllSets];

Or, after I am done, I could append these values to AllSets by using


And so on. Never mind the particular examples. My point is that, I am 
looking for a convenient and practical way of working with large sets of 
Obviously, these sets will never get so big as to hamper any 
computational efficiency. So, a stable strategy is likely more important 
than a fast one.

Again, I appreciate the support.

Best regards,

Gabriel Landi

  • Prev by Date: Re: Root finding needs higher accuracy
  • Next by Date: Re: Matrices as operators
  • Previous by thread: Re: Using Equal with Real Numbers
  • Next by thread: Re: Using Equal with Real Numbers