*ARCHIVED* development moved to aircraft-studio.
all plots coherent
Changed files
creator.py
@@ -232,7 +232,7 @@
232
232
y_chord = [0, 0]
233
233
plt.plot(x_chord, y_chord, linewidth='1')
234
234
# Plot quarter chord
235
Removed:
plt.plot(self.chord / 4, 0, '.', color='g')
235
Added:
plt.plot(self.chord / 4, 0, '.', color='g', markersize=24)
236
236
# Plot mean camber line
237
237
plt.plot(self.x_c, self.y_c,
238
238
'-.', color='r', linewidth='2',
@@ -255,12 +255,12 @@
255
255
for _ in range(0, len(self.stringer.x_u)):
256
256
x = self.stringer.x_u[_]
257
257
y = self.stringer.z_u[_]
258
Removed:
plt.plot(x, y, '.', color='y')
258
Added:
plt.plot(x, y, '.', color='y', markersize=12)
259
259
# Lower stringers
260
260
for _ in range(0, len(self.stringer.x_l)):
261
261
x = self.stringer.x_l[_]
262
262
y = self.stringer.z_l[_]
263
Removed:
plt.plot(x, y, '.', color='y')
263
Added:
plt.plot(x, y, '.', color='y', markersize=12)
264
264
265
265
# Graph formatting
266
266
plt.xlabel('X axis')
@@ -271,9 +271,7 @@
271
271
plt.ylim(- (1.10 * plot_bound / 2), (1.10 * plot_bound / 2))
272
272
plt.gca().set_aspect('equal', adjustable='box')
273
273
plt.grid(axis='both', linestyle=':', linewidth=1)
274
Removed:
plt.draw()
275
Removed:
plt.pause(1)
276
Removed:
# plt.close()
274
Added:
plt.show()
277
275
return None
278
276
279
277
evaluator.py
@@ -95,10 +95,6 @@
95
95
'Was the full path passed to the function?')
96
96
return None
97
97
98
Removed:
# def get_mass_total(airfoil):
99
Removed:
# total_mass = airfoil.mass + airfoil.spar.mass + airfoil.stringer.mass
100
Removed:
# return total_mass
101
Removed:
102
98
# All these functions take integer arguments and return lists.
103
99
104
100
def get_lift_rectangular(self, lift):
@@ -134,7 +130,9 @@
134
130
return F_x
135
131
136
132
def get_centroid(self):
133
Added:
'''Return the coordinates of the centroid.'''
137
134
area = self.airfoil.stringer.area
135
Added:
138
136
x_stringers = self.airfoil.stringer.x_u + self.airfoil.stringer.x_l
139
137
x_centroid = sum([x * area for x in x_stringers]) / \
140
138
(len(x_stringers) * area)
@@ -165,7 +163,8 @@
165
163
y_chord = [0, 0]
166
164
plt.plot(x_chord, y_chord, linewidth='1')
167
165
# Plot quarter chord
168
Removed:
plt.plot(self.chord / 4, 0, '.', color='g', markersize=24)
166
Added:
q = self.chord / 4
167
Added:
plt.plot(q, 0, '.', color='g', markersize=24, label='quarter-chord')
169
168
# Plot upper surface
170
169
plt.plot(self.x_u, self.z_u,
171
170
'', color='b', linewidth='1')
@@ -179,22 +178,21 @@
179
178
y = (self.spar.z_u[_], self.spar.z_l[_])
180
179
plt.plot(x, y, '.-', color='b')
181
180
182
Removed:
# Plot stringers
183
Removed:
# Upper stringers
181
Added:
# Plot upper stringers
184
182
for _ in range(0, len(self.stringer.x_u)):
185
183
x = self.stringer.x_u[_]
186
184
y = self.stringer.z_u[_]
187
185
plt.plot(x, y, '.', color='y', markersize=12)
188
Removed:
# Lower stringers
186
Added:
# Plot lower stringers
189
187
for _ in range(0, len(self.stringer.x_l)):
190
188
x = self.stringer.x_l[_]
191
189
y = self.stringer.z_l[_]
192
190
plt.plot(x, y, '.', color='y', markersize=12)
193
191
194
Removed:
# Centroid
192
Added:
# Plot centroid
195
193
x = self.centroid[0]
196
194
y = self.centroid[1]
197
Removed:
plt.plot(x, y, '.', color='r', markersize=24)
195
Added:
plt.plot(x, y, '.', color='r', markersize=24, label='centroid')
198
196
199
197
# Graph formatting
200
198
plt.xlabel('X axis')
main.py
@@ -32,7 +32,11 @@
32
32
STRINGER_MASS = 5 # lbs
33
33
34
34
# Area
35
Removed:
STRINGER_AREA = 0.1 # sqin
35
Added:
STRINGER_AREA = 1 # sqin
36
Added:
TOP_STRINGERS = 4
37
Added:
BOTTOM_STRINGERS = 6
38
Added:
NOSE_TOP_STRINGERS = 4
39
Added:
NOSE_BOTTOM_STRINGERS = 7
36
40
37
41
# population information
38
42
POP_SIZE = 1
@@ -73,7 +77,11 @@
73
77
# Create stringer instance
74
78
af.stringer = creator.Stringer()
75
79
# Compute the stringer coordinates from their quantity in each zone
76
Removed:
af.stringer.add_coord(af.coord, af.spar.coord, 4, 7, 5, 6)
80
Added:
af.stringer.add_coord(af.coord, af.spar.coord,
81
Added:
NOSE_TOP_STRINGERS,
82
Added:
TOP_STRINGERS,
83
Added:
NOSE_BOTTOM_STRINGERS,
84
Added:
BOTTOM_STRINGERS)
77
85
af.stringer.add_area(STRINGER_AREA)
78
86
af.stringer.add_mass(STRINGER_MASS)
79
87
# af.stringer.info_print(2)