Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6753 > unrolled thread
| Started by | Gabriel Landi <gtlandi@gmail.com> |
|---|---|
| First post | 2011-11-26 10:14 +0000 |
| Last post | 2011-11-26 10:14 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Using Equal with Real Numbers Gabriel Landi <gtlandi@gmail.com> - 2011-11-26 10:14 +0000
| From | Gabriel Landi <gtlandi@gmail.com> |
|---|---|
| Date | 2011-11-26 10:14 +0000 |
| Subject | Re: Using Equal with Real Numbers |
| Message-ID | <jaqe6v$nil$1@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
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web