User:Egm4313.s12.team14.steiner

= Problem 7 =

Given
Vector $$\mathbf v, \mathbf b_1 , $$ and $$\mathbf b_2 $$ as shown
 * {| style="width:100%" border="0" align="left"

\mathbf v = 4 \mathbf e_1 + 2 \mathbf e_2 = c_1 \mathbf b_1+ c_2 \mathbf b_2 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (1)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\mathbf b_1 = 2 \mathbf e_1 + 7 \mathbf e_2 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (2)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\mathbf b_2 = 1.5 \mathbf e_1 + 3 \mathbf e_2 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (3)
 * }
 * }

Find
The components $$c_1, c_2 $$ using the Gram matrix. Verify the result with the given vector.

Solution
Begin by verifying the $$\mathbf b_1 $$ and $$\mathbf b_2 $$ are linearly independent by showing that the determinant of the components is non-zero.
 * {| style="width:100%" border="0" align="left"

\mathbf A = \begin{bmatrix} 2 & 7 \\ 1.5 & 3 \end{bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (4)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

det \mathbf A = 2*3 - 7*1.5 \ne 0 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (5)
 * }
 * }

Then assemble the Gram matrix equation.

The Gram matrix:
 * {| style="width:100%" border="0" align="left"

\boldsymbol \Gamma := \begin{bmatrix} \langle \mathbf b_1, \mathbf b_1 \rangle & \langle \mathbf b_1, \mathbf b_2 \rangle \\ \langle \mathbf b_2 , \mathbf b_1 \rangle & \langle \mathbf b_2 , \mathbf b_2 \rangle \end{bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (6)
 * }
 * }

Components $$\mathbf c $$:
 * {| style="width:100%" border="0" align="left"

\mathbf c = \begin{Bmatrix} \mathbf c_1 \\ \mathbf c_2 \end{Bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (7)
 * }
 * }

Components $$\mathbf d $$:
 * {| style="width:100%" border="0" align="left"

\mathbf d = \begin{Bmatrix} \langle \mathbf b_1, \mathbf v \rangle \\ \langle \mathbf b_2 , \mathbf v \rangle \end{Bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (8)
 * }
 * }

These are related by the following equation:
 * {| style="width:100%" border="0" align="left"

\boldsymbol \Gamma \mathbf c = \mathbf d$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (9)
 * }
 * }

The scalar products for the Gram matrix are computed as follows:
 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_1, \mathbf b_1 \rangle = 2*2 + 7*7 = 53$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (10)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_1, \mathbf b_2 \rangle = 2*1.5 + 7*3 = 24$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (11)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_2, \mathbf b_1 \rangle = 1.5*2 + 3*7 = 24$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (12)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_2, \mathbf b_2 \rangle = 1.5*1.5 + 3*3 = 11.25$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (13)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\boldsymbol \Gamma = \begin{bmatrix} 53 & 24 \\ 24 & 11.25 \end{bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (14)
 * }
 * }

The scalar product for the $$\mathbf d $$ components are computed as follows:
 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_1, \mathbf v \rangle = 2*4 + 7*2 = 22$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (15)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_2, \mathbf v \rangle = 1.5*4 + 3*2 = 12$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (16)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\mathbf d = \begin{Bmatrix} 22 \\ 12 \end{Bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (17)
 * }
 * }

Substituting back into equation 2 and solving for the component $$\mathbf c $$ yields the following:
 * {| style="width:100%" border="0" align="left"

\mathbf c = \boldsymbol \Gamma^{-1} \mathbf d = \begin{bmatrix} 0.5556 & -1.1852 \\ -1.1852 & 2.6173 \end{bmatrix} \begin{Bmatrix} 22 \\ 12 \end{Bmatrix} = \begin{Bmatrix} -2 \\ \frac{16}{3} \end{Bmatrix}$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (18)
 * }
 * }

Substituting the previous values back into (1) verifies the result.
 * {| style="width:100%" border="0" align="left"

-2(2 \mathbf e_1 + 7 \mathbf e_2) + \frac{16}{3}(1.5 \mathbf e_1 + 3 \mathbf e_2) = 4 \mathbf e_1 + 2 \mathbf e_2 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (ANS)
 * }
 * }

= Problem 9 = = Problem 9 =

Given
Differential equation and initial conditions as shown
 * {| style="width:100%" border="0" align="left"

y'' - 3 y' + 2 y = r(x) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (1)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

r(x) = log(1 + x) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (2)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

y(-\frac{3}{4}) = 1, y'(-\frac{3}{4}) = 0 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (3)
 * }
 * }

Find
Projected $$r(x)$$ on the polynomial basis $$ \{b_j(x) = x^j, j = 0, 1\} $$ for n = 0 and 1. Plot the $$r(x)$$ and projections on the same graph.

Taylor Series expansion about $$ x = 0$$ for n = 0, and 1. In a separate plot, place the Taylor series expansion along with $$ r(x)$$ and the projections.

Find the solution to (1) for $$ r(x) $$ equal to the following: both projections, both Taylor series expansions, and the original excitation given in (2).

Solution
Projections: For n = 0: The Gram matrix:
 * {| style="width:100%" border="0" align="left"

\boldsymbol \Gamma := \begin{bmatrix} \langle \mathbf b_0, \mathbf b_0 \rangle \end{bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (4)
 * }
 * }

Components $$\mathbf c $$:
 * {| style="width:100%" border="0" align="left"

\mathbf c = \begin{Bmatrix} \mathbf c_0 \end{Bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (5)
 * }
 * }

Components $$\mathbf d $$:
 * {| style="width:100%" border="0" align="left"

\mathbf d = \begin{Bmatrix} \langle \mathbf b_0, r(x) \rangle \end{Bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (6)
 * }
 * }

These are related by the following equation:
 * {| style="width:100%" border="0" align="left"

\boldsymbol \Gamma \mathbf c = \mathbf d$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (7)
 * }
 * }

The scalar products for the Gram matrix are computed as follows:
 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_0, \mathbf b_0 \rangle = \int_{-3/4}^3 1 dx = 3.75$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (8)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\boldsymbol \Gamma = \begin{bmatrix} 3.75 \end{bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (9)
 * }
 * }

The scalar product for the $$\mathbf d $$ components are computed as follows:
 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_0, r(x) \rangle = \int_{-3/4}^3 log(1+x) dx = 2.14$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (10)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\mathbf d = \begin{Bmatrix} 2.14 \end{Bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (11)
 * }
 * }

Substituting back into equation 2 and solving for the component $$\mathbf c $$ yields the following:
 * {| style="width:100%" border="0" align="left"

\mathbf c = \boldsymbol \Gamma^{-1} \mathbf d = \begin{bmatrix} .2667 \end{bmatrix} \begin{Bmatrix} 2.14 \end{Bmatrix} = \begin{Bmatrix} .571 \end{Bmatrix}$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (12)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

r_{proj0} = .571 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (ANS1)
 * }
 * }

For n = 1: The Gram matrix:
 * {| style="width:100%" border="0" align="left"

\boldsymbol \Gamma := \begin{bmatrix} \langle \mathbf b_0, \mathbf b_0 \rangle & \langle \mathbf b_0, \mathbf b_1 \rangle \\ \langle \mathbf b_1 , \mathbf b_0 \rangle & \langle \mathbf b_1 , \mathbf b_1 \rangle \end{bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (13)
 * }
 * }

Components $$\mathbf c $$:
 * {| style="width:100%" border="0" align="left"

\mathbf c = \begin{Bmatrix} \mathbf c_0 \\ \mathbf c_1 \end{Bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (14)
 * }
 * }

Components $$\mathbf d $$:
 * {| style="width:100%" border="0" align="left"

\mathbf d = \begin{Bmatrix} \langle \mathbf b_0, r(x) \rangle \\ \langle \mathbf b_1 , r(x) \rangle \end{Bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (15)
 * }
 * }

These are related by the following (7).

The scalar products for the Gram matrix are computed as follows:
 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_0, \mathbf b_0 \rangle = \int_{-3/4}^3 1 dx = 3.75$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (16)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_0, \mathbf b_1 \rangle = \int_{-3/4}^3 x dx = 4.22$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (17)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_1, \mathbf b_0 \rangle = \int_{-3/4}^3 x dx = 4.22$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (18)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_1, \mathbf b_1 \rangle = \int_{-3/4}^3 x^2 dx = 9.14$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (19)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\boldsymbol \Gamma = \begin{bmatrix} 3.75 & 4.22 \\ 4.22 & 9.14 \end{bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (20)
 * }
 * }

The scalar product for the $$\mathbf d $$ components are computed as follows:
 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_0, r(x) \rangle = \int_{-3/4}^3 log(1+x) dx = 2.14$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (21)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\langle \mathbf b_1, r(x) \rangle = \int_{-3/4}^3 x*log(1+x) dx = 5.01$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (22)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\mathbf d = \begin{Bmatrix} 2.14 \\ 5.01 \end{Bmatrix} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (23)
 * }
 * }

Substituting back into equation 2 and solving for the component $$\mathbf c $$ yields the following:
 * {| style="width:100%" border="0" align="left"

\mathbf c = \boldsymbol \Gamma^{-1} \mathbf d = \begin{bmatrix} .5551 & -.2563 \\ -.2563 & .2277 \end{bmatrix} \begin{Bmatrix} 2.14 \\ 5.01 \end{Bmatrix} = \begin{Bmatrix} -.0961 \\ .5925 \end{Bmatrix}$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (24)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

r_{proj1} = .5925x -.0961 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (ANS2)
 * }
 * }

Taylor Series
The Taylor series is given as follows


 * {| style="width:100%" border="0" align="left"

r(x) = \sum_{n=0}^\infty \frac{r^{(n)}(a)}{n!}(x - a)^n $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (25)
 * }
 * }

For n = 0:
 * {| style="width:100%" border="0" align="left"

r_{tay0} = r(0) = 0$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (ANS3)
 * }
 * }

For n = 1:
 * {| style="width:100%" border="0" align="left"

r_{tay1} = r(0) + r'(0)x = x $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (ANS4)
 * }
 * }