Sequences in Fortran
Author
Discussion

magnum

Original Poster:

161 posts

275 months

Tuesday 22nd November 2005
quotequote all
A bit of background first:

I'm trying to come up with a Fortran code to analyse stacking sequences in composites. This involves coming up with every combination of ply angles and analysing each one (each layer can sit at a different angle: +45deg, -45deg, 0deg or 90deg). If a laminate has 20 layers then there are about 4^20 different combinations (thats about 1100000000000 combinations).

What i'm trying to do is come up with a code that will generate every possible sequence for a number of layers that the user inputs. If we call +45: 1, -45: -1, 0: 0, and 90: 2, then for a two layer laminate the possible combinations are:

-1 -1
0 -1
1 -1
2 -1
-1 0
0 0
1 0
2 0
-1 1
0 1
1 1
2 1
-1 2
0 2
1 2
2 2

and so on for more layers. The problem i'm having is putting this into a general code. Something called Tree Programming has been mentioned to me by a maths professor but i'm not much of a mathematician or programmer so i'm basically stuck. Any suggestions?

JonRB

80,078 posts

302 months

Tuesday 22nd November 2005
quotequote all
magnum said:
Any suggestions?
Find someone who is over 50 years of age and still remembers how to program in Fortran?
I remember doing a bit at Uni about 15 years ago and it was considered archaic even then!

jinx

12,021 posts

290 months

Tuesday 22nd November 2005
quotequote all
Google - "Tree Programming" or "Evolutionary Programming".
Google - "Fortran"

Read all of it. Then put the two together.