AERO 300 Laboratory 5 Interpolation and Linear Regression The pre-lab assignment (Section 4) is due at the beginning of this lab (can be hand-written or typed). The lab (Section 5) will be due before...

1 answer below »

This lab covers concepts and methods used for interpolating polynomial and estimating functional relationships using linear regression.




AERO 300 Laboratory 5 Interpolation and Linear Regression The pre-lab assignment (Section 4) is due at the beginning of this lab (can be hand-written or typed). The lab (Section 5) will be due before your next lab section (.zip file submitted to polylearn). 1 Objectives This lab covers concepts and methods used for interpolating polynomial and estimating functional relationships using linear regression. In this lab, you will: • Create a surface which models a wing using interpolation and the surf() command • Load wind-tunnel data • Estimate the lift coefficient of the wing using linear regression 2 Introduction Interpolation and linear regression are two sides of the same coin. With interpolation, you are typically trying to find the coefficients of a polynomial that passes through a set of known points. Conversely, with linear regression, you are trying to find the coefficients of a polynomial that passes as close to (but not through) a set of known points. The table below summarizes the nature of each problem. Interpolation Linear Regression • ? ???? ?????? ⟹ ? ???????????? ?? ?? (? − 1)?ℎ ????? ?????????? • “Exact” fit • ? ???? ?????? ⟹ ? ???????????? ?? ?? (? − 1)?ℎ ????? ?????????? (? > ?) • “Best” fit In this lab, you will explore different ways to use interpolation and linear regression for representing and analyzing data. 2.1 Interpolation Interpolation techniques are used in solid modeling to define the shape of a surface that is constrained to pass through known points. In this way, every point on the surface does not have to be stored, only the coefficients of the polynomial which approximates a slice of the surface are stored. When the solid model is rendered (or shown on the screen) the polynomial can be evaluated as needed, and the resulting data displayed. In this lab, you will use Newton’s Divided Differences technique to find a polynomial to approximate the surface of an airfoil at two different span wise locations of a wing. 2.2 Linear Regression Once a solid model of a wing is created, we can import the surface into a grid generation program and run a Computational Fluid Dynamics code to solve for the flow properties. If we have wind tunnel data, we could compare the CFD results with the experimental results to validate our CFD analysis. In this lab, you will find the coefficients of a line used to model the angle of attack of a wing versus the lift coefficient of the wing. The physics of this model is based on thin airfoil theory. 2.3 This Airfoil Theory See this Wikipedia article for more information on thin airfoil theory https://en.wikipedia.org/wiki/Airfoil#Thin_airfoil_theory. If you concentrate in Aeronautics you will learn more about thin airfoil theory in Aero 306. Regardless of your concentration, the important result of thin airfoil theory states that the lift coefficient of an airfoil ??, is proportional to the angle of attack ?, of the airfoil for ‘small’ angles of attack. Figure 1 shows the geometry and other nomenclature used to describe airfoils. Figure 1 – A thin airfoil by Olivier Cleynen The physics used in thin airfoil results in ?? = 2??. This result is only good for an infinite and symmetric airfoil (no camber). If an airfoil is not symmetric, the airfoil will have some lift at zero angle of attack and the equation for the lift coefficient becomes, ?? = ??? + 2??. Finally, if an airfoil is not infinite, the proportionality coefficient is not 2?. Keep in mind, this result only applies when the angle of attack is measured in radians. 3 Help Potentially useful terms for this lab: • polyfit • polyval • linspace • QR • inv and ‘\’ • find • Zeros • ones • get • gca • plot • plot3 • surf • axis • grid • hold • legend • title • xlabel • ylabel 4 Pre-lab Assignment NOTE: This must be done before lab. If it is not completed, you will not be allowed into lab. https://en.wikipedia.org/wiki/Airfoil#Thin_airfoil_theory Use the polyfit() command to find the coefficients of a 3rd order polynomial that passes through the points (-5,4), (-2, -1), (4, 2), and (5,-5). Evaluate and plot the polynomial on the interval [-5:.1:5] using the polyval() command. Also, plot the points on the line from above using red x’s as data markers. Be sure to label your plot. Finally, comment on how is the polyfit() command similar to Newton’s Divided Difference method? 5 Lab Assignment Complete the following problems with a single script and custom functions as appropriate. Important lines of code should include descriptive comments. You are encouraged to work in groups, however the code you submit must be your own. All graphs/figures/sketches should include a grid, labels, legend (if necessary), and the appropriate fontsize/linewidth/markersize. 1. Plot the wing – Interpolation a. Import the data from the airfoil_1.txt document. This data contains the normalized y and z locations of an airfoil surface at 6 locations from trailing to leading edge at the root of the wing. Use the polyfit() command to find a 5th order polynomial that interpolates the airfoil. b. Import the data from the airfoil_2.txt document. This data contains the normalized y and z locations of an airfoil surface at 6 locations from trailing to leading edge at the tip of the wing. Use the polyfit() command to find a 5th order polynomial that interpolates the airfoil. c. Using both polynomials from part a and b, use the surf() command to plot the wing. Use the ‘lineStyle’ property to remove the grid from the surface. With the default colormap, you should get something that looks like the following: 2. Plot the wind tunnel data – Regression a. Import the data from the files ‘cl_data.txt’ and ‘cd_data.txt’. The data is formatted as, first column – angle of attack in degrees, second column – lift/drag coefficient. b. Plot the data from part a and label the figure. Remember the data in the files are data points. It is generally never appropriate to connect measured data points with a line. c. Use the polyfit() command to determine the zero angle of attack lift coefficient, ??? , and the proportionality constant between angle of attack and lift coefficient. In this case, not all the data fits are line. Be sure to limit your regression line to use only points applicable to thin airfoil theory. (Hint: you can use the find() command to help find the valid data points.) d. Use the polyfit() command to determine a quadratic fit to the angle of attack versus drag coefficient data. e. Plot both regression lines on the same figure as the data points. Label your figure and be sure to include a legend. 6 Material to be Submitted Submit the code for the lab assignment (titled: yourname_Lab5) into your lab sections Poly Learn Assignment before the start of the next laboratory. Zip all your code into one file and put your name on every piece of code you turn in. Do not forget the master file. 1 Objectives 2 Introduction 2.1 Interpolation 2.2 Linear Regression 2.3 This Airfoil Theory 3 Help 4 Pre-lab Assignment 5 Lab Assignment 6 Material to be Submitted
Answered 1 days AfterApr 28, 2021

Answer To: AERO 300 Laboratory 5 Interpolation and Linear Regression The pre-lab assignment (Section 4) is due...

Kshitij answered on Apr 29 2021
151 Votes
Aero/airfoil_1.txt
0.0000000e+00 0.0000000e+00
2.0000000e-01 5.7200000e-02
4.0000000e-01 5.8300000e-02
6.0000000e-01 4.5000000e-02
8.0000000e-01 2.5800000e-02
1.0000000e+00 1.3000000e-03
Aero
/airfoil_2.txt
2.0000000e-01 0.0000000e+00
3.4000000e-01 5.7200000e-02
4.8000000e-01 5.8300000e-02
6.2000000e-01 4.5000000e-02
7.6000000e-01 2.5800000e-02
9.0000000e-01 1.3000000e-03
Aero/cd_data.txt
-1.53 0.0183
-0.37 0.0141
1.10 0.0147
2.82 0.0161
4.38 0.0153
5.94 0.0165
7.60 0.0240
9.01 0.0300
10.18 0.0366
Aero/cl_data.txt
-5.44 -0.361 -0.0800
-4.15 -0.255 -0.0800
-2.90 -0.140 -0.0800
-1.98 -0.062 -0.0800
-1.08 0.021 -0.0800
0.12 0.140 -0.0800
0.95 0.225 -0.0800
2.16 0.329 -0.0800
3.18 0.449 -0.0800
4.03 0.552 -0.0800
5.24 0.697 -0.0800
6.34 0.863 -0.0800
7.17 0.961 -0.0800
8.34 1.037 -0.0800
9.23 1.082 -0.0800
10.40 1.086 -0.0800
11.23 1.032 -0.0800
12.37 1.028 -0.0800
13.18 0.928 -0.0800
14.28 0.834 -0.0800
15.09 0.843 -0.0800
16.23 0.878 -0.0800
17.40 0.990 -0.0800
18.28 1.078 -0.0800
19.18 0.998 -0.0800
17.75 0.989 -0.0800
16.86 0.926 -0.0800
15.79 0.877 -0.0800
14.75 0.877 -0.0800
13.89 0.854 -0.0800
12.87 0.904 -0.0800
11.88 1.083 -0.0800
10.86 1.124 -0.0800
10.03 1.103 -0.0800
9.01 1.058 -0.0800
7.94 1.003 -0.0800
6.97 0.960 -0.0800
5.96 0.827 -0.0800
4.90 0.710 -0.0800
3.87 0.562 -0.0800
2.85 0.452 -0.0800
1.77 0.348 -0.0800
0.78 0.267 -0.0800
-0.27 0.161 -0.0800
-1.42 0.040 -0.0800
-2.28 -0.040 -0.0800
-3.43 -0.143 -0.0800
-4.43 -0.244 -0.0800
-5.36 -0.335 -0.0800
Aero/Code_Lab_1.m
%% lab Assignment: interpolation
% clear data and figures
clc
clear
close all
%% import data from text airfoil1.txt
data1=importdata('airfoil_1.txt');
% extract data
y1=data1(:,1);
z1=data1(:,2);
% polyfit data
P1 = polyfit(y1,z1,5);
% find the value of 100 Z points
Y1 = linspace(min(y1),max(y1),100);
% Z
Z1=polyval(P1,Y1);
%% import data from airfoil_2.txt
data2=importdata('airfoil_2.txt');
%...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here