I have collected some experimental data at 544 frequencies, and have a computer model for that data. I have created a list which has the differences between the experimentally measured data and the model. They are not really errors, as neither the model or experimental data are perfect, but to make the discussion easier I will call them errors.
The first item in the list is frequency, and the second a phase error. So at a frequency of 200 MHz the phase errors is 0.092593 degrees, whereas at 7000 MHz, the phase error is 1.23048 degrees.
phaseErrors={{200.`, 0.0925929735343855`}, {212.5`, 0.06536204885470609`}, {225.`,
0.0476567575293923`}, {237.5`, 0.07512708968635051`}, {250.`,
0.06988303494777459`}, {262.5`, 0.08247458243017602`}, {275.`,
0.06723172074437223`}, {287.5`, 0.07860443799551908`}, {300.`,
0.06802272178311031`}, {312.5`, 0.07794655920100102`}, {325.`,
0.13718593
<snip out rest of list>
{6875., 1.19548}, {6887.5, 1.16039}, {6900., 1.13316}, {6912.5,
1.12165}, {6925., 1.12583}, {6937.5, 1.16913}, {6950.,
1.18908}, {6962.5, 1.20127}, {6975., 1.21354}, {6987.5,
1.22588}, {7000., 1.23048}}
I want to see if the phase errors exceed some thresholds. But there are only 7 thresholds which each cover a span of 1000 MHz, which is a lot larger than the 12.5 MHz between data points.
I want to see if all data between 0 and 1000 MHz has an error of less than 0.6 degrees, all data >1000 MHz but <= 2000 MHz has an error of less than 0.78 degrees, all data >2000 and <=3000 MHz has an error of less than 1.24 degrees .... etc. It is likely the permissible errors will always increase with frequency, but I don't want to make that assumption.
permissableErrors = {{1000.0, 0.6}, {2000.0, 0.78}, {3000.0,
1.24}, {4000.0, 1.69}, {5000.0, 2.31}, {6000.0, 3.05}, {7000.0,
3.64}};
Can anyone suggest a few decent ways to check if the errors in the first list exceed the permissible errors in the second list? I can think of several very messy ways to do it, with lots of IF statements, which would be practical when there are only 7 ranges of permissible errors, but would be impractical if that list was 50.
I'm guessing I need to create a big list of 544 element with permissible errors at each frequency, then subtract from that the actual errors, and see if the minimum value in the resultant list is less than 0, which would indicate one of the errors was greater than the permissible error. In other words, something like
biglist={{200,0.06}, {212.5,0.6}, {225,0.6} ...{6987.5,3.64},{7000.0,3.64};
minimum=Min[biglist-phaseErrors];
If[minimum < 0, fail=1,fail=0];
But maybe there are better ways, and in any case I don't know a neat way of creating "biglist".
Dave
Attachments: