Logic to check logic
5.7 Example calculation
Let us imagine the following five lines constitute a complete calculation which we wish to test for all combinations of data:
Default values (1=Yes, 0=No) +ans=????
Axial load +P=???? kN Continuous/not-continuous (1 or 0) +con=????
Bar diameter (12,16,20,25) +dia=???? mm Exposure condition (1 to 5) +xpo=????
Obviously we could run the calculation and type in each bar diameter, for each continuous or not-continuous; for each exposure conditions 1 to 5. Such an exercise would take a considerable amount of dedication when the data is not just 5 numbers, as above, but extends to say 50 numbers. The process of providing 1000 sets of data for a calculation containing 50 prompts requires 50000 items of data to be coded. It is considered that such an exercise would be too onerous for most engineers, so a shorthand method has to be devised. Usually engineers prefer examples to syntax &
formality, so there now follows a discourse on the preparation of data for the example given above.
It is convenient to include the data for generating the sets of test data within the calculation itself. To avoid conflict with names of variables used in the calculation, each numeric variable will commence with a z. Four types of string are required:
• storage of parameter names: ans,P,con,dia,xpo in $27001 to $27005 say
• storage of expressions giving minimums, where required, in $28001 to $28005
• storage of expressions giving maximums, where required, in $29001 to $29005
• storage of expressions giving overriding expressions in $30001 to $30005.
The last set of strings is for expressions which are totally dependent on previously defined parameters e.g. in a reinforced concrete beam having just one layer of tension reinforcement, the effective depth d will be defined as h-cov-20 where h is the overall depth, cov is the cover, and 20 is an allowance for bar diameters up to 40 mm. It would be bad engineering to vary the effective depth over the range of the overall depth.
First we need to specify the number of increments for each variable; this can vary between 2 and 166 so that the product of number of increments and 6 patterns (section 5.8) of loading is below 1000, thereby keeping the number of runs in each batch manageable. For this simple explanation take the number of runs as three i.e. the first &
last value and one in the middle thus:
! +zni=3
Next specify the number of parameters, for the example there are five parameters viz:
ans, P, con, dia, xpo, thus:
! +znp=5
Next provide the symbolic names for all the prompts thus:
! +$27001=ans +$27002=P +$27003=con +$27004=dia +$27005=xpo
Next provide a start and end numerical value for each prompt thus:
! +zst(1)=VEC(0,1,1,12,1) +zen(1)=VEC(0,400,0,25,5)
which says that the start & end value for the first parameter are both zero; for the second parameter the start and end values for the axial load are 1 kN and 400 kN; for the third parameter the start and end values are 1 and zero; for the fourth parameter the start and end values are 12 mm & 25 mm; for the fifth parameter the start and end values are 1 and 5.
So far we have coded data to say that: the name of the first variable is ans which starts and ends with zero, the name of the second variable is P which starts at 1 and ends at 400; the name of the third variable is con which starts at 1 and ends at 0; the name of the fourth variable is dia which starts at 12 and ends at 25; the name of the fifth variable is xpo which starts at 1 and ends at 5. Although this is not the complete story, the exercise has been made straightforward.
Next we need to say how each parameter may vary between its start value and its end value so that the procedure which builds the sets of data to be run by the model, can engineer the sets of data such that the data will be appropriate. Some parameters may vary uniformly e.g. axial load, other parameters must be constrained to be integer e.g.
continuous/not-continuous can only take values 1 or 0, reinforcing bar diameters have to be integer and have to be obtainable, although 18 is an integer number, bars of diameter 18 mm are not available, and so on. The word code is ambiguous, so we will call the definition of how the value of a parameter may vary its type. The type is held in the array zty(1:znp), where znp is the number of parameters in a model.
The first prompt in the example calculation asks if the engineer wishes to be offered a set of default values, default values are useful the first time a calculation is run as they allow the engineer to see what the calculation does without the need to worry about the data. For subsequent runs, it is usual to respond to the prompt with zero to use the engineer's own data or automatically generated sets of data for which the variable ans should contain zero whatever the number of increments. For the first variable ans, by interpolation, three increments of: 0, 0, 0 would be sensible, we can say that the type of the variable ans =0 (aide-memoire 0=Ordinary interpolation).
For the second variable P, by interpolation, three increments of: 1 kN, 200.5 kN, & 400 kN would be sensible, so we could again say that its type =0, but the production of a set of test data loads to the nearest kN will be more convenient for the engineer, so we will say that the type of variable P =1 (aide-memoire 1=Integer); by linear interpolation with Integer rounding, three increments of: 1kN, 200kN, 400kN would be generated.
For the third variable con, by interpolation, three increments of: 1, 0.5, 0 would not be sensible, but if we say that its type=2 (aide-memoire 2, or more, means cycle as in bi-cycle), cycling the 2 values 1 & 0 would be sensible, so for three increments, con would take the values: 1,0,1. For seven increments con would take the values:
1,0,1,0,1,0,1.
For the fourth variable dia, by interpolation, three increments of: 12mm, 18.5mm, 25 mm would not be sensible as 18.5 mm bar diameters do not exist; but if we say that its type=4 (i.e. cycle 4 values), bar diameters of: 12mm, 16.33mm, 20.67mm, 25mm would be computed and would be sensible if their integer value were taken for each bar diameter; we can say its type=-4, where the 4 says cycle just 4 values and the minus tells the program to round the 4 values to integers. (Bar diameters 12mm to 25mm are a sensible range for the main steel of a suspended reinforced concrete floor slab.)
For the fifth variable xpo, by interpolation, three increments of: 1, 3 & 5 would be OK but not thorough, if we say that its type=5, cycling the values 1,2,3,4,5 would be sensible, but with only 3 increments, only exposure conditions 1,2,3 would be considered. The implication of five exposure conditions is that we must increase the number of increments zni to at least 5 to test for exposure conditions 4 & 5, but this is not essential as later described in Patterns of variation, section 5.8. The following will suffice for describing the type for the 5 parameters in this example:
! +zty(1)=VEC(0,1,2,-4,5)
To those who would enquire why not use different increments for each variable and test all increments for all variables? The response is that the choice of three increments, used in the above explanation, is only to describe what is going on; to verify each model, 166 increments are normally specified, as the subcycling: 2, 4 & 5 respectively for con, dia & xpo is very small in comparison to 166, each parameter will be tested many times over its full range, furthermore each of the 166 increments is tested in combination with 6 patterns of variation, producing 166*6=996 sets of data, to ensure that every parameter on a rising range of values is tested against every other parameter on both a rising and falling range.
Reinforcing bar diameters may be considered separately for beams and slabs, for large beams use zst()=25mm zen()=40mm with zty()=-3 which will compute bar diameters 25, 32 & 40 mm diameters (the -3 means cycle 3 values making each value an integer).
For smaller beams use zst()=16 zen()=25mm with zty(n)=-3 which will compute bar diameters 16, 20 & 25mm.
As an alternative to selecting bar diameters as described above, there will be occasions where it is desirable to include all the bar diameters e.g. in the testing of bar scheduling in accordance with BS 8666. To do this, type=100 means interpret the zst() & zen() as pointers to the start and end elements in the special set za() containing:
+za(1)=VEC(6,8,10,12,16,20,25,32,40,50..) thus if zst()=3, zen()=8 & zty()=100, bar diameters 10mm to 32mm will be used in a set of 8-3+1=6 values and cycled.
There are occasions when it is desirable to round computed values to the nearest 5 or 10 or whatever; e.g. in response to the prompt:
Characteristic concrete strength +fcu=???? N/mm²
although BS 8110 does not prohibit concrete strengths of say 43 N/mm², concrete suppliers normally supply strengths from 20 to 50 N/mm² in steps of 10 N/mm², these strengths can be specified in the test data by setting the type to 4 which will cause strengths of 20 30 40 50 N/mm² to be cycled, therefore if the engineer has set the number of increments to 7, the test data will be: 20 30 40 50 20 30 40. There are occasions when the engineer may require that the concrete strength be increased uniformly from the first increment to the last; this can be achieved by specifying the type as: 200 to round to the nearest 2, 300 to round to the nearest 3 etc. 1000 to round to the nearest 10 and so on. Thus if the engineer specifies the type as 1000, for the number of increments =7, the strengths would be prorated initially to: 20 25 30 35 40 45 50, then rounded to the nearest 10 as: 20 30 30 40 40 50 50.
To those who would enquire how is periodicity avoided e.g. when two parameters of type=3 are included in the same parameter table? The response is that: instances 1 2 3 of parameter A will be tested with instances 1 2 3 of parameter B and also 3 2 1 of parameter B; furthermore inspection of the parameter tables for 108 verified models for the structural analysis of frameworks in Appendix A, shows that when parameters have the same type, then periodicity does not affect any of the logic within the model. For models for the structural design of components, which exhibit periodicity, judicious engineering i.e. changing the number of instances for say parameter A, can be used to avoid the problem of periodicity. The writer feels sure that changes will be made to the system invented for verification, and solution space theories will be developed.
Summarising: the vector zty(1:znp) holds a number referred to as type for each of znp parameters, which describes how intermediate values between the start zst(1) to zst(znp) and end zen(1) to zen(znp) values for each parameter are formed; in other words type is a reference for modifying linear interpolation between the start and end values of each parameter.
0 means no modification i.e. zst(n)-zen(n) in zni equal increments for parameter n.
1 means as for 0, but make all values integer (aide-memoire by 1=I).
2 means split into 2 increments and cycle with the 2 increments; similarly 3 means cycle with 3 increments, and so on. When it is required to both cycle and make all values integer, then type is -2,-3 etc.
100 means interpret the zst(n) & zen(n) as pointers to the start and end element in the za() set, if +za(1)=VEC(6,8,10,12,16,20,25,32,40,50) and if zst(n)=3, zen(n)=8 &
zty(n)=100 then bar diameters 10mm to 32mm will be used as a set of 8-3+1=6 values to be cycled. Types 101 to 125 are similar to 100 but refer to vectors zb() to
126 means store the numbers following the 126 and use them e.g. if zst=1 and zen=5 and the numbers following the type are 20 7 20 23 26, then rather than assigning values within the range 1 to 5, values 20 7 20 23 26 are assigned to the parameter, thus type=126 provides a means of accessing an irregular set of integer or real numbers.
200 means make the parameter value exactly divisible by 2; when the type=300, it is taken as an instruction to make the parameter value exactly divisible by 3; when the type=1000, it is taken as an instruction to make the parameter value exactly divisible by 10; and so on up to 20000 which is taken as an instruction to make the parameter value exactly divisible by 200.