Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

File for adv_graph.txt is located at this link: https://www.4shared.com/office/s

ID: 3812485 • Letter: F

Question

File for adv_graph.txt is located at this link:   https://www.4shared.com/office/sm8j0fMAca/adv_graph.html

Let me know if the link does not work, or if you know of a better file sharing site.

2. The experimental data from a wind tunnel test has been saved to a file called adv graph.txt. This file contain performance characteristics for an airfo it lists velocity (ft/s), Reynolds number, angle of attack (deg), lift coefficient, pressure drag coefficient and moment coefficient, respectively. Plot the Lift coefficient vs angle of attack on the left axis and Moment Coefficient vs angle of attack on the right axis

Explanation / Answer

# Since you have not specified which program to code in, I am assuming it to be irrelavant and therefore coding in python

import re;
import numpy as np
import matplotlib.pyplot as plt

velocity = []
reynoldNum = []
angleOfAttack = []
liftCoefficient = []
dragCoefficient = []
momentumCoefficient = []

fileInstance = open("adv_graph.txt",'r');
fileText = fileInstance.read();

recordSplits = fileText.split(" ");
for record in recordSplits :
        if record == "" :
            continue;
        wordSplits = re.split(" | ", record.strip());
        newData = [];
        for word in wordSplits :
            if word.strip() == "" :
                continue
            newData.append(word.strip());

        velocity.append(float(newData[0].strip()));
        reynoldNum.append(float(newData[1].strip()));
        angleOfAttack.append(float(newData[2].strip()));
        liftCoefficient.append(float(newData[3].strip()));
        dragCoefficient.append(float(newData[4].strip()));
        momentumCoefficient.append(float(newData[5].strip()));

fig, left_axis = plt.subplots();
right_axis = left_axis.twinx();
left_axis.plot(angleOfAttack, liftCoefficient, 'g-');
right_axis.plot(angleOfAttack, momentumCoefficient, 'b-');

left_axis.set_xlabel('Angle Of Attack')
left_axis.set_ylabel('Lief Coefficient', color='g')
right_axis.set_ylabel('Momentum Coefficient', color='b')

plt.show();

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote