Loop


The Loop command is new for GEMPACK 12.

 

 

Set ITER (K1-K20);
Coefficient
(all,c,COM)(all,i,IND)   TmpTot1(c,i) # Temp total 1 #;
(all,i,IND)(all,r,REG)   TmpTot2(i,r) # Temp total 2 #;
(all,c,COM)(all,r,REG)   TmpTot3(c,r) # Temp total 3 #;
(all,k,ITER) SumAbsErr(k) # Sum of absolute errors #;
 
LOOP (BEGIN) (all,k,ITER);
Formula
! scale F1 so product adds to Control total 1 !
(all,c,COM)(all,i,IND)   TmpTot1(c,i) = sum{r,REG, F1(c,i)*F2(i,r)*F3(c,r)};
(all,c,COM)(all,i,IND:TmpTot1(c,i)>0)   F1(c,i) = F1(c,i)*Control1(c,i)/TmpTot1(c,i);
 
! scale F2 so product adds to Control total 2 !
(all,i,IND)(all,r,REG)   TmpTot2(i,r) = sum{c,COM, F1(c,i)*F2(i,r)*F3(c,r)};
(all,i,IND)(all,r,REG:TmpTot2(i,r)>0) F2(i,r) = F2(i,r)*Control2(i,r)/TmpTot2(i,r);
 
! scale F3 so product adds to Control total 3 !
(all,c,COM)(all,r,REG)   TmpTot3(c,r) = sum{i,IND, F1(c,i)*F2(i,r)*F3(c,r)};
(all,c,COM)(all,r,REG:TmpTot3(c,r)>0) F3(c,r) = F3(c,r)*Control3(c,r)/TmpTot3(c,r);
 
! Calculate errors !
(all,c,COM)(all,i,IND)   TmpTot1(c,i) = Control1(c,i) - sum{r,REG, F1(c,i)*F2(i,r)*F3(c,r)};
(all,i,IND)(all,r,REG)   TmpTot2(i,r) = Control2(i,r) - sum{c,COM, F1(c,i)*F2(i,r)*F3(c,r)};
(all,c,COM)(all,r,REG)   TmpTot3(c,r) = Control3(c,r) - sum{i,IND, F1(c,i)*F2(i,r)*F3(c,r)};
SumAbsErr(k) = sum{c,COM,sum{i,IND,ABS[TmpTot1(c,i)]}}
             + sum{i,IND,sum{r,REG,ABS[TmpTot2(i,r)]}}
             + sum{c,COM,sum{r,REG,ABS[TmpTot3(c,r)]}};
 
LOOP (END);
 

 

 

 

Gutter lines show loop begin and ends

The 'gutter' is the narrow grey column at the left of the TABmate window (where line numbers are usually shown).  The extent of an outermost loop is shown there by a navy blue line. 2nd level loops are marked by red lines; 3rd and subsequent by green. No marks will be shown unless TABmate finds an up-to-date INF file (which contains data about Loop statements) --  so you may need to use the TABLO Check button for the marks to become visible.

If you insert or delete lines in the TAB file, the Loop marks will no longer be up-to-date -- use the TABLO Check button to correct this.

The Options.. Code and other Options menu lets you switch this feature on and off.

 

back to TABLO language contents



URL of this topic: www.copsmodels.com/webhelp/tabmate/hc_loop.htm

Link to full GEMPACK Manual

Link to GEMPACK homepage