- #1
gfd43tg
Gold Member
- 950
- 50
Homework Statement
We want to determine the coefficients of a polynomial of the form:
##p(x)=c_{1}x^2 +c_{2}x+c_{3}##The polynomial ##p(x)## must satisfy the constraint ##p(1)=1##.
We would also like ##p(x)## to satisfy the following 4 constraints:
##p(−1)=5##
##p(0)=−1##
##p(2)=6##
##p(3)=12##However, this is not possible, since the system of equations is over-determined. Instead, we wish to minimize the error, ##E##, as shown below, using least squares.
##E = (p(-1)-5)^2 +(p(0)+1)^2 +(p(2)-6)^2 +(p(3)-12)^2##
part 1
Solve for ##c_{3}## in terms of ##c_{1}## and ##c_{2}## such that the constraint, ##p(1)=1##, holds. Which of the following expressions is ##c_{3}## equal to?
part 2
If you substitute the expression for ##c_{3}## into the polynomial, ##p(x)##, what is the new polynomial?
part 3
Put the new polynomial and the 4 constraints you would like to satisfy into the ##Az=b## form where ##x = \left[ \begin{array}{c} c_1 \\ c_2 \end{array} \right]## . Using Matlab find the least squares solution of this system of equations. What is the value for ##x##?
Homework Equations
The Attempt at a Solution
I am having a lot of difficulty parsing this problem. I don't really understand what to do. The equation must satisfy ##p(1) = 1## and we attempt to satisfy the following
##p(-1) = 5##
##p(0) = -1##
##p(2) = 6##
##p(3) = 12##
Since one of the equations must be satisfied, and the other ones are ''try our best to satisfy'', I don't know how to set up a least square to solve this. Do I not include the one that must be satisfied, or include all? How do I make it so that it guarantees that specific one to be satisfied, but the other ones don't have to be. Very confused about this. Even how to set up ## c_{3}## in terms of ##c_{1}## and ##c_{2}##.
##E =min \underset x \in \mathbb R] \hspace{0.05 in} \|\left[ \begin{array}{x} 1 & -1 & 1 \\ 0 & 0 & 1 \\ 4 & 2 & 1 \\ 9 & 3 & 1 \end{array} \right] \left[\begin{array}{c} c_{1} \\ c_{2} \\ c_{3} \end{array} \right] - \left[\begin{array}{y} 5 \\ -1 \\ 6 \\ 12 \end{array} \right]\|##
how do I get the x is an element of R to be under the min?? And taller || to show that it is the norm
Attachments
Last edited: