Sequences in Fortran
Discussion
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?
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?
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff



