Fix things?

This commit is contained in:
Cal Wing 2024-08-29 01:21:31 +10:00
parent 0c6d48283a
commit 31aeb58d56

58
main.py
View File

@ -257,9 +257,7 @@ if __name__ == '__main__':
pressure = this_data[0]
# Extrapolate Aerofoil Tip
p1 = (PITOT_PLACEMENT[9], pressure.iloc[9])
p2 = (PITOT_PLACEMENT[18], pressure.iloc[18])
pN = (0.9*CHORD_LEN, p2[1] + (p1[1]-p2[1])/2)
p1, p2, pN = this_data[-3]
plts = (
{"x": PITOT_PLACEMENT[:10], "y":pressure[:10], "colour": c["color"]},
@ -296,9 +294,7 @@ if __name__ == '__main__':
pressure = this_data[0]
# Extrapolate Aerofoil Tip
p1 = (PITOT_PLACEMENT[9], pressure.iloc[9])
p2 = (PITOT_PLACEMENT[18], pressure.iloc[18])
pN = (0.9*CHORD_LEN, p2[1] + (p1[1]-p2[1])/2)
p1, p2, pN = this_data[-3]
plts = (
{"x": PITOT_PLACEMENT[:10], "y":pressure[:10], "colour": c["color"]},
@ -318,34 +314,34 @@ if __name__ == '__main__':
makeGraph(graph, False, figSavePath="./images/pressure/__{0}.png")
if True:
aoa = [a[-2] for a in cp_pain_data][1::2]
forces = [a[-1] for a in cp_pain_data][1::2]
# Force Graphs
graph = {
"title": f"All Total, Lift & Drag Forces\nfor a Clark Y 14% Aerofoil at:\n{raw_data["rpm"]:d}rpm - {raw_data["airSpeed"]:.1f}m/s)",
"windowTitle": f"All Total, Lift and Drag Forces for a Clark Y 14 Percent Airfoil - {raw_data["rpm"]:d}rpm - {raw_data["airSpeed"]:.1f}m_s",
"xLabel": "Attack Angle [$\\alpha$]",
"yLabel": "Force [N]",
"grid": True,
"ledgLoc": 1,
"plots": [
{"x":aoa, "y":[f[0] for f in forces], "label":"Total Force"},
{"x":aoa, "y":[f[1] for f in forces], "label":"Lift"},
{"x":aoa, "y":[f[2] for f in forces], "label":"Drag"},
]
}
if True:
aoa = [a[-2] for a in cp_pain_data][1::2]
forces = [a[-1] for a in cp_pain_data][1::2]
# Force Graphs
graph = {
"title": f"All Total, Lift & Drag Forces\nfor a Clark Y 14% Aerofoil at:\n{raw_data["rpm"]:d}rpm - {raw_data["airSpeed"]:.1f}m/s)",
"windowTitle": f"All Total, Lift and Drag Forces for a Clark Y 14 Percent Airfoil - {raw_data["rpm"]:d}rpm - {raw_data["airSpeed"]:.1f}m_s",
"xLabel": "Attack Angle [$\\alpha$]",
"yLabel": "Force [N]",
"grid": True,
"ledgLoc": 1,
"plots": [
{"x":aoa, "y":[f[0] for f in forces], "label":"Total Force"},
{"x":aoa, "y":[f[1] for f in forces], "label":"Lift"},
{"x":aoa, "y":[f[2] for f in forces], "label":"Drag"},
]
}
makeGraph(graph, False, figSavePath="./images/{0}.png", closeFig=True)
makeGraph(graph, False, figSavePath="./images/{0}.png", closeFig=True)
print("\n\n")
print(raw_data["rpm"])
print("AoA Total Lift Drag ---- Upper Force Lower Force ")
for aoa, force in [(a[-2], a[-1]) for a in cp_pain_data]:
print(f"{aoa:d}\\textdegree & {force[0]:.3f} & {force[1]:.3f} & {force[2]:.3f} -- {force[4]:.3f} {force[5]:.3f} \\\\")
print("-"*50)
print("\n\n")
print("\n\n")
print(raw_data["rpm"])
print("AoA Total Lift Drag ---- Upper Force Lower Force ")
for aoa, force in [(a[-2], a[-1]) for a in cp_pain_data]:
print(f"{aoa:d}\\textdegree & {force[0]:.3f} & {force[1]:.3f} & {force[2]:.3f} -- {force[4]:.3f} {force[5]:.3f} \\\\")
print("-"*50)
print("\n\n")
print("Generating Cp Graphs")