Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nesting do-loops

Status
Not open for further replies.

ZegersSander

Civil/Environmental
Oct 27, 2004
12
Hi,

I need to nest a couple of do-loops to vary multiple parameters. It seems only 5 do-loops can be nested and I need to vary 6 parameters.

Is this correct? Are there other (better) ways of varying parameters?

Thanx in advance
 
Replies continue below

Recommended for you

Check the help file; 20 levels of nesting are allowed for the *do. What does your code look like? What are trying to do with it?
 
It want to calculated the natural frequency of a single beam and varying the relevant parameters (in all combinations)

this is the code snippet in which I vary 6 parameters. However it seems to only loop through the first five, and not the sixth:

*DO,rekEmodulusTemp,Emodulus,Emodulusmax,(Emodulusmax-Emodulus)/Emodulusstap
*DO,rekAkomTemp,Akom,Akommax,(Akommax-Akom)/AkomStap
*DO,rekMassa,massa,massamax,(massamax-massa)/massaStap
*DO,rekBlength,Blength,Blengthmax,(Blengthmax-Blength)/BlengthStap
*DO,rekRotatiestijfheidLinks,RotatiestijfheidLinks,RotatiestijfheidLinksmax,(RotatiestijfheidLinksmax-RotatiestijfheidLinks)/RotatiestijfheidLinksStap
*DO,rekRotatiestijfheidRechts,RotatiestijfheidRechts,RotatiestijfheidRechts,(RotatiestijfheidRechtsmax-RotatiestijfheidRechts)/RotatiestijfheidRechtsStap

*USE,MODEL

*ENDDO
*ENDDO
*ENDDO
*ENDDO
*ENDDO
*ENDDO
 
Try and put the *use statement outside the looping - it will be more efficient and may also cure your problem (which you haven't described).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor