Skip to content
Marc & Structures
Index

Save your progress

Enter your email and we will send a secure sign-in link. There is no password and the first link creates your account.

Demonstration ~10 min · ~32 min remaining

CSV and automatic selection

Write m09_results.csv from the driver and select the feasible min(beam_h).

Step 3 — CSV as a decision table

*CFOPEN,m09_results,csv
*VWRITE
('case_id,beam_h,...,validation_pass,feasible')
*DO,i,1,n_cases
  *VWRITE,i,h_store(i),...,val_pass_store(i),feasible_store(i)
*ENDDO
*CFCLOS

Only the driver writes the CSV. If each submacro writes its own file, the last iteration overwrites the preceding ones and the selection loses its meaning.

Step 4 — Select the smallest suitable design

selected_case=0
selected_h=0
*DO,i,1,n_cases
  *IF,feasible_store(i),EQ,1,THEN
    *IF,selected_case,EQ,0,THEN
      selected_case=i
      selected_h=h_store(i)
    *ELSE
      *IF,h_store(i),LT,selected_h,THEN
        selected_case=i
        selected_h=h_store(i)
      *ENDIF
    *ENDIF
  *ENDIF
*ENDDO

For the base sweep, the expected selection is selected_case=3, selected_h=0.12 m. Also check the trend: |uy(i+1)| < |uy(i)| as height increases.