Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Construction of Temperature Profiles by Least Squares Polynomials ) Among the important inputs in weather forecasting models are data sets consist - ing of temperature

Construction of Temperature Profiles by Least
Squares Polynomials) Among the important inputs
in weather forecasting models are data sets consist-
ing of temperature values at various parts of the
atmosphere. These values are either measured dir-
ectly using weather balloons or inferred from remote
soundings taken by weather satellites. A typical set
of RAOB (weather balloon) data is given next. The
temperature T in kelvins may be considered as a
function of p, the atmospheric pressure measured in
decibars. Pressures in the range from 1 to 3 decibars correspond to the top of the atmosphere, and those User
p 12345678910
T 222227223233244253260266270266
in the range from 9 to 10 decibars correspond to the
lower part of the atmosphere.
(a) Enter the pressure values as a column vector p
by setting p=[1:10]^('), and enter the tem-
perature values as a column vector T. To find
the best least squares fit to the data by a linear
function c_(1)x+c_(2), set up an overdetermined sys-
tem Vc=T. The coefficient matrix V can be
generated in MATLAB by setting
V=[p, ones (10,1)]
or, alternatively, by setting
A=vander(p);,V=A(;,9:10)
Note For any vector x=(x_(1),x_(2),dots,x_(n+1))^(T),
the MATLAB command vander(x) generates
a full Vandermonde matrix of the form
([x_(1)^(n),x_(1)^(n-1),cdots,x_(1),1],[x_(2)^(n),x_(2)^(n-1),cdots,x_(2),1],[vdots,],[x_(n+1)^(n),x_(n+1)^(n-1),cdots,x_(n+1),1])
For a linear fit, only the last two columns of
the full Vandermonde matrix are used. More
information on the vander function can be
obtained by typing help vander. Once V
has been constructed, the least squares solu-
tion c of the system can be calculated using the
MATLAB "" operation.
(b) To see how well the linear function fits the data,
define a range of pressure values by setting
q=1:0.1:10;
The corresponding function values can be de-
termined by setting
z=polyval(c,q);
We can plot the function and the data points with
the command
(c) Let us now try to obtain a better fit by us-
ing a cubic polynomial approximation. Again
we can calculate the coefficients of the cubic
polynomial
c_(1)x^(3)+c_(2)x^(2)+c_(3)x+c_(4)
that gives the best least squares fit to the data
by finding the least squares solution of an over-
determined system Vc=T. The coefficient
matrix V is determined by taking the last four
columns of the matrix A= vander(p). To see
the results graphically, again set
z=polyral(c,q)
and plot the cubic function and data points, us-
ing the same plot command as before. Where do
you get the better fit, at the top or bottom of the
atmosphere?
solve with mathlap code and expline every thing with code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions