Re: Using Equal with Real Numbers
- To: mathgroup at smc.vnet.net
- Subject: [mg123206] Re: Using Equal with Real Numbers
- From: Gabriel Landi <gtlandi at gmail.com>
- Date: Sat, 26 Nov 2011 05:08:58 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201111241153.GAA28857@smc.vnet.net> <6A41692C-6AC4-4F55-9A6A-E292D36265DA@mimuw.edu.pl> <E6C5E416-42E7-4C8D-BB5C-F8F7EFD9CA24@gmail.com> <201111250955.EAA11112@smc.vnet.net>
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 combinations. 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 computed. 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 AllSets=Union@Append[AllSets,newset]; 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 combinations. 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
- References:
- Using Equal with Real Numbers
- From: Gabriel Landi <gtlandi@gmail.com>
- Re: Using Equal with Real Numbers
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Using Equal with Real Numbers