Fixed spar plotting

Commit
9a033eb0777c63537334c5cbff1fc6499b7f7650
Author
Marius Peter <blendoit@gmail.com>
Author date
Committer
Marius Peter <blendoit@gmail.com>
Committer date
Changed files
creator.py
index d5ff3ec3..b1a58a99 100644..100644
@@ -242,7 +242,7 @@
242 242 def __init__(self):
243 243 super().__init__(parent.chord, parent.semi_span)
244 244
245 Removed: def add_spar(self, coordinates, material, spar_x):
245 Added: def add_spar(self, coordinates, spar_x):
246 246 """
247 247 Add a single spar at the % chord location given to function.
248 248
@@ -271,7 +271,6 @@
271 271 self.y_u.append(y_u[spar_x_u])
272 272 self.x_l.append(x_l[spar_x_l])
273 273 self.y_l.append(y_l[spar_x_l])
274 Removed: self.spar_material = material
275 274 return None
276 275
277 276
@@ -286,7 +285,7 @@
286 285 self.stringer_y_l = []
287 286 self.stringer_mat = []
288 287
289 Removed: def add_stringers(self, material, *density):
288 Added: def add_stringers(self, *density):
290 289 """
291 290 Add stringers to the wing from their distribution density between spars.
292 291 First half of density[] concerns stringer distribution on
@@ -347,8 +346,8 @@
347 346 # Plot spars
348 347 try:
349 348 for _ in range(0, len(spar.x_u)):
350 Removed: x = (spar.spar_x_u[_], spar.spar_x_l[_])
351 Removed: y = (spar.spar_y_u[_], spar.spar_y_l[_])
349 Added: x = (spar.x_u[_], spar.x_l[_])
350 Added: y = (spar.y_u[_], spar.y_l[_])
352 351 plt.plot(x, y, '.-', color='b', label='spar')
353 352 plt.legend()
354 353 except:
main.py
index a6e75a3d..f62a88aa 100644..100644
@@ -19,7 +19,7 @@
19 19 import time
20 20 start_time = time.time()
21 21
22 Removed: CHORD_LENGTH = 40
22 Added: CHORD_LENGTH = 100
23 23 SEMI_SPAN = 200
24 24
25 25 POP_SIZE = 1
@@ -41,7 +41,8 @@
41 41 # Create spar instance
42 42 af.spar = creator.Spar()
43 43 # Define the spar coordinates
44 Removed: af.spar.add_spar(af.coordinates, 'aluminium', 0.15)
44 Added: af.spar.add_spar(af.coordinates, 0.15)
45 Added: af.spar.add_spar(af.coordinates, 0.55)
45 46 # Print coordinates of af.spar to terminal
46 47 af.spar.print_coord(4)
47 48 # Plot components with matplotlib