May-19-2019, 12:17 PM
For the first Columns it is already working very well.
so actually i have it like this now:
Do you have an Idea here?
I would like to have the possibility to count in this column from o tu L_max and than to -L_max.
So should look like this:
so actually i have it like this now:
import numpy as np import math import sys import argparse B = 0.30 # Layer thickness # inputdata m = 3 # numbers of Layer s = 10 # Steps for one Layer Z = 0.30 # Z-value z1= 0.30 z2= B*m i=1 # variable for Lines n=1 # Layer counter Typ = 0 L1_max = 2 L1_Step = L1_max/s S_2 = s whole_table = np.zeros([0, 5]) # 3 columns, 0 rows while n<= m: #for g in range(1, m, 1): I = np.linspace(i , S_2 , s, dtype=int) # L1 = np.linspace(0 , L1_max, s) #?? #L1 = np.linspace(2 , -L1_max, s) #?? L1 = np.linspace(-2 , +L1_max, s) table = np.zeros((s, 5) ) # np.zeros(shape, dtype=float, order='C') table[:,0] = I table[:,1] = Z table[:,2] = L1 table[:,3] = n table[:,4] = Typ whole_table = np.concatenate( (whole_table, table), axis=0) n += 1 Z += B # added lines i += s S_2 += s print(whole_table) fmt = ['%i'] + ['%.1f'] + ['%.4f'] + ['%i'] * 2 np.savetxt("Loop.txt", whole_table, fmt = fmt )Output:
Output:[[ 1. 0.3 -2. 1. 0. ]
[ 2. 0.3 -1.55555556 1. 0. ]
[ 3. 0.3 -1.11111111 1. 0. ]
[ 4. 0.3 -0.66666667 1. 0. ]
[ 5. 0.3 -0.22222222 1. 0. ]
[ 6. 0.3 0.22222222 1. 0. ]
[ 7. 0.3 0.66666667 1. 0. ]
[ 8. 0.3 1.11111111 1. 0. ]
[ 9. 0.3 1.55555556 1. 0. ]
[10. 0.3 2. 1. 0. ]
[11. 0.6 -2. 2. 0. ]
[12. 0.6 -1.55555556 2. 0. ]
[13. 0.6 -1.11111111 2. 0. ]
[14. 0.6 -0.66666667 2. 0. ]
[15. 0.6 -0.22222222 2. 0. ]
[16. 0.6 0.22222222 2. 0. ]
[17. 0.6 0.66666667 2. 0. ]
[18. 0.6 1.11111111 2. 0. ]
[19. 0.6 1.55555556 2. 0. ]
[20. 0.6 2. 2. 0. ]
[21. 0.9 -2. 3. 0. ]
[22. 0.9 -1.55555556 3. 0. ]
[23. 0.9 -1.11111111 3. 0. ]
[24. 0.9 -0.66666667 3. 0. ]
[25. 0.9 -0.22222222 3. 0. ]
[26. 0.9 0.22222222 3. 0. ]
[27. 0.9 0.66666667 3. 0. ]
[28. 0.9 1.11111111 3. 0. ]
[29. 0.9 1.55555556 3. 0. ]
[30. 0.9 2. 3. 0. ]]
But the third column seems to be a little bit more difficult.Do you have an Idea here?
I would like to have the possibility to count in this column from o tu L_max and than to -L_max.
So should look like this:
Output: 1. 0.3 0.000 1. 0.
2. 0.3 0.222 1. 0.
3. 0.3 0.444 1. 0.
4. 0.3 0.667 1. 0.
5. 0.3 0.889 1. 0.
6. 0.3 1.111 1. 0.
7. 0.3 1.333 1. 0.
8. 0.3 1.556 1. 0.
9. 0.3 1.778 1. 0.
10. 0.3 2.000 1. 0.
11. 0.6 2.000 2. 0.
12. 0.6 1.778 2. 0.
13. 0.6 1.556 2. 0.
14. 0.6 1.333 2. 0.
15. 0.6 1.111 2. 0.
16. 0.6 0.889 2. 0.
17. 0.6 0.667 2. 0.
18. 0.6 0.444 2. 0.
19. 0.6 0.222 2. 0.
20. 0.6 0.000 2. 0.
21. 0.9 0.000 3. 0.
22. 0.9 -0.222 3. 0.
23. 0.9 -0.444 3. 0.
24. 0.9 -0.667 3. 0.
25. 0.9 -0.889 3. 0.
26. 0.9 -1.111 3. 0.
27. 0.9 -1.333 3. 0.
28. 0.9 -1.556 3. 0.
29. 0.9 -1.778 3. 0.
30. 0.9 -2.000 3. 0.