Materials correspoding to the journal paper (PLEASE, CITE AS SUCH):
Vales et al. "Analytical computation of the mean number of tag identifications during a time interval in FSA,", IEEE Communications Letters, vol. 18, issue 11, pp. 1923-1926, November 2014.
Paper abstract:
"We analytically compute the mean number of identifications when N tags contend in a bounded time interval of T seconds in RFID systems using framed slotted aloha. Usually, performance is described in terms of identifications per time-slot. However, slot duration notably varies depending on the event (identification, collision, or empty slot). Moreover, during the reading process, the number of tags contending dynamically changes since identified tags withdraw from the process, and the frame length may vary dynamically as well. These conditions have been included in the model and lead to an accurate analysis of real RFID systems."
-------------------
What we compute?
The expected number of identifications when N tags contend in T seconds (formula PHI).
How to use it?
-------------------
First, about the units. N is the number of "tags" and "T" is time. T is given in 0.01 ms units. An example: T=100 means 1 ms, 21 means 0.21 ms, and so on. The reason is that is the minimum resolution required to represent all the possible time combinations as natural number.
When you run all codes, you can give order to mathematica to compute for particular values:
PHI[4,1100] -> N=4 tags, T = 11 ms
2.10119
or compute separately the PSI (see paper for its definition)
PSI[600, 2, 1, 4] -> T=6ms, 2 singletons, 1 collision, used frame length k=4
1.33333
How is it coded?
-----------
As you can see in the letter, the analysis leads to recursive formulas, both for PHI and PSI. The main idea in the code is store new computations in tables and when doing a new one, use already computed values to speed up the computation.
The mathematica coding is a bit "obfuscated" because of that. The nested If[If[If ...]]] are doing this store&recover process.
In addition, when I programmed the PHI part, I did this stuff of the Tables storing a -1 in the tables for non-yet seen values, so it requires initialization to -1 at the beggining. Latter, when I added the part of the PSI computations I discovered a "cleaner" way of doing all of this process. So, if you look at the code you will see two different ways of doing the same thing.
Validation scripts in matlab
-----------
The same computations by Monte-Carlo:
phicontinuomatlab(N,T,k) -> computes by means of Monte-carlo iterations the average number of identifications when N tags contend in T seconds in frames of length k. NOTE that here T is in SECONDS
phicontinuomatlabDFSA(N,T) -> Idem but frame policy if DFSA*
simscript -> computes .mat matrix equivalent to the mathematica program for SFSA
simDFSAscript -> idem with DFSA*
procesa.m --> creates the .eps files of the figures of the letter from the .mat files computed with Mathematica
Precomputed Solutions
-------
Download in http://jval.es/phi-results.zip
All solutions are stored in matlab files,
You can access them by matlab command:
load phi_DFSA_T300ms_N50
>> who
Your variables are:
Expression1
>> size(Expression1)
ans =
51 30001
------
Note1: the solution contains PHI for all combinations of N=0,1,2... Nmax and T=0,1,2,... Tmax up to the indicated in the file configuration (Tmax = 300 ms, Nmax=50 in this case)
Note2: N indicates number of users and T is given in 0.01 ms units
Note3: since in matlab there are not 0,0 position in vectors (contrary to Mathematica) you must sum always 1 to both index. Note that in Mathematica you are NOT summing this +1
EXAMPLE
Expression1(1,1) --> phi(0 tags, 0 ms)
Expression1(51, 1001) --> phi(50 tags, 10.00ms)