User:Egm6341.s11.team4.fields/HW6.9

=Problem 6.9: Identify the Basis Functions Ni(s) for i = 1,2,3,4 and Plot Them=

Refer to lecture slide [[media:nm1.s11.mtg37.djvu|37-3]] for the problem statement.

Given

 * {| style="width:70%" border="0" align="center"

\begin{Bmatrix} c_0 \\ c _1 \\ c _2 \\ c_3 \end{Bmatrix} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ -3 & -2 & 3 & -1 \\ 2 & 1 & -2 & 1 \end{bmatrix} \begin{Bmatrix} Z_i \\ Z_i^' \\ Z_{i+1} \\ Z_{i+1}^' \end{Bmatrix} =\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ -3 & -2 & 3 & -1 \\ 2 & 1 & -2 & 1 \end{bmatrix} \begin{Bmatrix} \overline{d}_1 \\ \overline{d}_2 \\ \overline{d}_3 \\ \overline{d}_4 \\ \end{Bmatrix} $$     (9.1)
 * $$\displaystyle
 * $$\displaystyle
 * 
 * }
 * }

Where:


 * {| style="width:70%" border="0"

\begin{Bmatrix} Z_i \\ Z_i^' \\ Z_{i+1} \\ Z_{i+1}^' \end{Bmatrix} = \begin{Bmatrix} \overline{d}_1 \\ \overline{d}_2 \\ \overline{d}_3 \\ \overline{d}_4 \\ \end{Bmatrix} = \begin{Bmatrix} d_1 \\ hd_2 \\ d_3 \\ hd_4 \end{Bmatrix} $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

And equation (1) on lecture slide [[media:nm1.s11.mtg37.djvu|37-1]]:


 * {| style="width:70%" border="0" align="center"

$$     (9.2)
 * $$\displaystyle Z(s) = \sum_{i=0}^3 c_i s^i = \sum_{i=1}^4 \overline{N}_i(s)d_i
 * $$\displaystyle Z(s) = \sum_{i=0}^3 c_i s^i = \sum_{i=1}^4 \overline{N}_i(s)d_i
 * 
 * }
 * }

Objective
a.) Identify the Basis Functions Ni(s) for i = 1,2,3,4

b.) Plot the Basis Functions Ni(s) for i = 1,2,3,4

a.) Basis Functions Ni(s) for i = 1,2,3,4
Expanding the Matrix equation given in (9.1) we get:


 * {| style="width:70%" border="0" align="center"

$$     (9.3)
 * $$\displaystyle c_0 = Z_i
 * $$\displaystyle c_0 = Z_i
 * 
 * }
 * }


 * {| style="width:70%" border="0" align="center"

$$     (9.4)
 * $$\displaystyle c_1 = Z_i^'
 * $$\displaystyle c_1 = Z_i^'
 * 
 * }
 * }


 * {| style="width:70%" border="0" align="center"

$$     (9.5)
 * $$\displaystyle c_2 = -3Z_i - 2Z_i^' + 3Z_{i+1} - Z_{i+1}^'
 * $$\displaystyle c_2 = -3Z_i - 2Z_i^' + 3Z_{i+1} - Z_{i+1}^'
 * 
 * }
 * }


 * {| style="width:70%" border="0" align="center"

$$     (9.6)
 * $$\displaystyle c_3 = 2Z_i + Z_i^' - 2Z_{i+1} + Z_{i+1}^'
 * $$\displaystyle c_3 = 2Z_i + Z_i^' - 2Z_{i+1} + Z_{i+1}^'
 * 
 * }
 * }

By expanding equation (9.2) and then plugging the above values for Ci into the expanded equation we obtain the following:


 * {| style="width:70%" border="0" align="center"

$$     (9.7)
 * $$\displaystyle N_1(s)d_1 + N_2(s)d_2 + N_3(s)d_3 + N_4(s)d_4 = C_0s^0 + C_1s^1 + C_2s^2 + C_3s^3
 * $$\displaystyle N_1(s)d_1 + N_2(s)d_2 + N_3(s)d_3 + N_4(s)d_4 = C_0s^0 + C_1s^1 + C_2s^2 + C_3s^3
 * 
 * }
 * }


 * {| style="width:70%" border="0" align="center"

$$     (9.8)
 * $$\displaystyle N_1(s)d_1 + N_2(s)d_2 + N_3(s)d_3 + N_4(s)d_4
 * $$\displaystyle N_1(s)d_1 + N_2(s)d_2 + N_3(s)d_3 + N_4(s)d_4
 * 
 * }
 * }


 * {| style="width:70%" border="0" align="center"

= Z_i + (Z_i^')s^1 + (-3Z_i - 2Z_i^' + 3Z_{i+1} - Z_{i+1}^')s^2 + (2Z_i + Z_i^' - 2Z_{i+1} + Z_{i+1}^')s^3 $$
 * $$\displaystyle
 * $$\displaystyle


 * }
 * }

Rearranging the right side of equation (9.8) we get the following:


 * {| style="width:70%" border="0" align="center"

$$     (9.9)
 * $$\displaystyle N_1(s)d_1 + N_2(s)d_2 + N_3(s)d_3 + N_4(s)d_4
 * $$\displaystyle N_1(s)d_1 + N_2(s)d_2 + N_3(s)d_3 + N_4(s)d_4
 * 
 * }
 * }


 * {| style="width:70%" border="0" align="center"

= (1 -3s^2 + 2s^3)Z_i + (s - 2s^2 + s^3)z_i^' + (3s^2 - 2s^3)Z_{i+1} + (-s^2 + s^3)Z_{i+1}^' $$
 * $$\displaystyle
 * $$\displaystyle


 * }
 * }

By comparing the left and right sides of equation (9.9) we obtain the following basis functions:


 * {| style="width:70%" border="0" align="center"

$$     (9.10)
 * $$\displaystyle N_1(s) = 1 -3s^2 + 2s^3
 * $$\displaystyle N_1(s) = 1 -3s^2 + 2s^3
 * 
 * }
 * }


 * {| style="width:70%" border="0" align="center"

$$     (9.11)
 * $$\displaystyle N_2(s) = s - 2s^2 + s^3
 * $$\displaystyle N_2(s) = s - 2s^2 + s^3
 * 
 * }
 * }


 * {| style="width:70%" border="0" align="center"

$$     (9.12)
 * $$\displaystyle N_3(s) = 3s^2 - 2s^3
 * $$\displaystyle N_3(s) = 3s^2 - 2s^3
 * 
 * }
 * }


 * {| style="width:70%" border="0" align="center"

$$     (9.13)
 * $$\displaystyle N_4(s) = -s^2 + s^3
 * $$\displaystyle N_4(s) = -s^2 + s^3
 * 
 * }
 * }

b.) Plots of the Basis Functions Ni(s) for i = 1,2,3,4
The following Matlab code was used to create the figure below.

>> s = linspace(0,1,100); >> N1 = 1 - 3.*s.^2 + 2.*s.^3; >> N2 = s - 2.*s.^2 + s.^3; >> N3 = 3.*s.^2 - 2.*s.^3; >> N4 = -s.^2 + s.^3; >> plot(s,N1,s,N2,s,N3,s,N4)