Exercise_2_98F

# Exercise_2_98F - 1 Exersise_2_1.nb Exercises in Note#2...

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Exersise_2_1.nb Exercises in Note #2 MEAM501 Matrix Methods in Mechanical Enginnering and Applied Mechanics, September 16, 1998 à Exercise 1 : Trigonometric and Polynomial Basis Ÿ setting up the basis functions and functions given As an example, we set up m=5 and n=7, and we shall consider only the case of (a) which involves both trigonometric and polynomial basis functions. Because of the choice of the basis functions, the boundary conditions are automatically satisfies, and then we need not consider them in this example. First we define Fj and Yj using Table, and then these functions are plotted by Plot. Then we plot the right hand side f( x,t) and the initial displacement condition u0. m = 5; n = 7; L = 1; Fj = [email protected]@j Pi x • LD, 8j, 1, n<D; Yi = [email protected] HL - xL x ^ Hi - 1L, 8i, 1, m<D; f = [email protected] * [email protected] x • LD; u0 = [email protected] x • LD; [email protected]@FjD, 8x, 0, L<, Frame -> True, GridLines -> Automatic, AxesLabel -> 8"x", "F"<D [email protected]@YiD, 8x, 0, L<, Frame -> True, GridLines -> Automatic, AxesLabel -> 8"x", "Y"<D [email protected], 8x, 0, L<, 8t, 0, 5<, AxesLabel -> 8"x", "t", "f"<D [email protected], 8x, 0, L<, Frame -> True, GridLines -> Automatic, AxesLabel -> 8"x", "u0"<D 1 0.5 0 x -0.5 -1 0 … Graphics … 0.2 0.4 0.6 0.8 1 2 Exersise_2_1.nb 0.25 0.2 0.15 0.1 0.05 0 0 0.2 0.4 0.6 0.8 1 … Graphics … 0.4 0.2 f 0 -0.2 -0.4 0 5 4 3 2 0.2 t 0.4 x 1 0.6 0.8 10 … SurfaceGraphics … 1 0.8 0.6 0.4 0.2 0 0 … Graphics … 0.2 0.4 0.6 0.8 1 3 Exersise_2_1.nb Ÿ Case (a) We evaluate the components of the mass matrix M and the stiffness matrix K by using numerical integration methods, NIntegral in Mathematica. Here we introduce Block and Do commands to make looped caculation. Ÿ Evaluate a discrete form of the equation of motion M = 1; T = 1; Mij = [email protected], 8i, 1, m<, 8j, 1, n<D; Kij = [email protected], 8i, 1, m<, 8j, 1, n<D; [email protected], j<, [email protected]@@i, jDD = [email protected] * [email protected]@iDD * [email protected]@jDD, 8x, 0, L<D; DFjj = [email protected]@@jDD, xD; DYii = [email protected]@@iDD, xD; [email protected]@i, jDD = [email protected] * DYii * DFjj, 8x, 0, L<D, 8j, 1, n<, 8i, 1, m<DD [email protected] [email protected] i 0.129006 6.93889 ´ 10-18 0.00477801 -1.35525 ´ 10-20 0.00103205 3.40239 ´ 10-18 j j j 0.0645031 j -0.0241887 0.002389 -0.00302358 0.000516025 -0.000895876 j j j j 0.0366566 j -0.0241887 0.00652152 -0.00302358 0.00149788 -0.000895876 j j j j 0.0227333 -0.0199974 0.00858778 -0.0036485 0.00198881 -0.00114407 j j j -0.0158062 0.0089356 -0.00427342 0.00233526 -0.00139227 k 0.015027 i 1.27324 1.66533 ´ 10-16 j j j 0.63662 j -0.95493 j j j j 0.361786 -0.95493 j j j j 0.224369 j -0.789467 j j j 0.14831 -0.624003 k 0.424413 3.05311 ´ 10-16 0.212207 -0.477465 0.579284 -0.477465 0.762822 -0.576148 0.793717 -0.674831 0.000376111 0.000188056 0.000554834 0.000738224 0.000894194 0.254648 2.22045 ´ 10-16 0.181891 0.127324 -0.31831 0.0909457 0.369587 -0.31831 0.268324 0.490719 -0.406496 0.357013 0.576203 -0.494681 0.432442 We evaluate the right hand side that is a function of time, and then it cannot be evaluated by NIntegrl, since it contains symbolics too. Here we apply analytical integration because of integration in only one variable. Similarly, we evaluate the initial displacement vector. Exersise_2_1.nb 4 Ÿ Evaluate the right hand side of the equation of motion and the initial condition fi = [email protected], 8i, 1, m<D; u0i = [email protected], 8i, 1, m<D; [email protected]<, [email protected]@@iDD = [email protected] * [email protected]@iDD, 8x, 0, L<D; [email protected]@iDD = [email protected] * [email protected]@iDD, 8x, 0, L<D; [email protected]"fH", i, "L = ", [email protected]@iDDD; [email protected]"u0H", i, "L = ", [email protected]@iDDD, 8i, 1, m<DD fi u0i fH1L = 0 u0H1L = 0.129006 - 12 E-t E-t fH2L = €€€€€€€€€€€€€€€€€€€€€€ + €€€€€€€€€€ p4 p2 u0H2L = 0.0645031 - 12 E-t E-t fH3L = €€€€€€€€€€€€€€€€€€€€€€ + €€€€€€€€€€ p4 p2 u0H3L = 0.0366566 120 E-t E-t H120 - 36 p2 + p4 L fH4L = €€€€€€€€€€€€€€€€€€€€€ + €€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ p6 p6 u0H4L = 0.0227333 480 E-t 60 E-t E-t fH5L = €€€€€€€€€€€€€€€€€€€€€ - €€€€€€€€€€€€€€€€€€ + €€€€€€€€€€ p6 p4 p2 u0H5L = 0.015027 12 E-t E-t 12 E-t E-t 120 E-t E-t H120 - 36 p 2 + p 4 L 480 E-t 60 E-t E-t 90, - €€€€€€€€€€€€€€€€€€ + €€€€€€€€€€ , - €€€€€€€€€€€€€€€€€€ + €€€€€€€€€€ , €€€€€€€€€€€€€€€€€€€€€€ + €€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ , €€€€€€€€€€€€€€€€€€€€€€ - €€€€€€€€€€€€€€€€€€ + €€€€€€€€€€ = € € € p4 p2 p4 p2 p6 p6 p6 p4 p2 80.129006, 0.0645031, 0.0366566, 0.0227333, 0.015027< Ÿ Exercise 2 : Lagrange Polynomials Here we are taking the Lagrange polynomials with the points including the both boundary points. Thus the basis functions need not satisfy the zero boundary condition a priori. To construct the Lagrange polynomials, we have applied If command in Mathematica. 5 Exersise_2_1.nb Ÿ Problem (a), (b), and (c) n = 7; L = 1; Fj = [email protected], 8j, 1, n<D; xj = [email protected] - 1L * L • Hn - 1L, 8j, 1, n<D [email protected], k<, [email protected] = 1; [email protected] = Fjj * [email protected] != j, Hx - [email protected]@kDDL • [email protected]@jDD - [email protected]@kDDL, 1D, 8k, 1, n<D; [email protected]@jDD = Fjj, 8j, 1, n<DD [email protected]@FjD, 8x, 0, L<D g = [email protected] + [email protected] * Pi * x • LD gj = [email protected] •. x -> [email protected]@jDD, 8j, 1, n<D gn = gj . Fj; [email protected], gn<, 8x, 0, L<, AxesLabel -> 8"x", "g & gn"<D eI = [email protected]@Hg - gnL ^ 2, 8x, 0, L<DD 1 1 1 2 5 90, €€€€€ , €€€€€ , €€€€€ , €€€€€ , €€€€€ , 1= 6 3 2 3 6 1 0.5 0.2 0.4 0.6 0.8 1 -0.5 -1 … Graphics … E-x + [email protected] p xD •++++ •++++ •++++ •++++ 3 1 3 1 1 3 1 3 1 1 91, €€€€€€€€€€€ + €€€€€€€€€€€€ , €€€€€€€€€€€ + €€€€€€€€€€€€ , €€€€€€€€€€€ , - €€€€€€€€€€€ + €€€€€€€€€€€€ , - €€€€€€€€€€€ + €€€€€€€€€€€€ , €€€€€ = € € € € € •++++ 2 E1•6 2 E1•3 2 E2•3 2 E5•6 E E 6 Exersise_2_1.nb g & gn 1.5 1 0.5 x 0.2 0.4 0.6 0.8 1 -0.5 … Graphics … 0.0077784 Ÿ Problem (d) m = 5; L = 1; Yi = [email protected], 8i, 1, m<D; xi = [email protected] - 1L * L • Hm - 1L, 8i, 1, m<D [email protected], k<, [email protected] = 1; [email protected] = Yii * [email protected] != i, Hx - [email protected]@kDDL • [email protected]@iDD - [email protected]@kDDL, 1D, 8k, 1, m<D; [email protected]@iDD = Yii, 8i, 1, m<DD [email protected]@YiD, 8x, 0, L<D 1 1 3 90, €€€€€ , €€€€€ , €€€€€ , 1= 4 2 4 1 0.75 0.5 0.25 0.2 -0.25 -0.5 … Graphics … 0.4 0.6 0.8 1 7 Exersise_2_1.nb Ÿ Matrices M & K for the State Equation M = 1; T = 1; Mij = [email protected], 8i, 1, m<, 8j, 1, n<D; Kij = [email protected], 8i, 1, m<, 8j, 1, n<D; [email protected], j<, [email protected]@@i, jDD = [email protected] * [email protected]@iDD * [email protected]@jDD, 8x, 0, L<D; DFjj = [email protected]@@jDD, xD; DYii = [email protected]@@iDD, xD; [email protected]@i, jDD = [email protected] * DYii * DFjj, 8x, 0, L<D, 8j, 1, n<, 8i, 1, m<DD [email protected] [email protected] 0.0818182 -0.0688312 0.0505051 -0.0224026 0.00181818 -0.00252525 i 0.0373954 j j 0.0234343 j 0.232727 0.0467532 0.0646465 -0.0675325 0.0498701 0.00565657 j j j j -0.0151515 -0.109091 j 0.144156 0.0935065 0.144156 -0.109091 -0.0151515 j j j j 0.00565657 j 0.0498701 -0.0675325 0.0646465 0.0467532 0.232727 0.0234343 j j 0.0373954 k -0.00252525 0.00181818 -0.0224026 0.0505051 -0.0688312 0.0818182 3.3 -1.85143 0.49746 y i 6.26889 -7.33714 2.95714 -3.83492 j z j -10.0851 19.7486 -12.6857 10.1587 -13.3714 8.77714 -2.54222 z z j z j z j z j j 5.86095 -19.3371 z j 19.8 -12.6476 19.8 -19.3371 5.86095 z z j z j j z j -2.54222 8.77714 -13.3714 10.1587 -12.6857 19.7486 -10.0851 z z j z j z j 3.3 -3.83492 2.95714 -7.33714 6.26889 { k 0.49746 -1.85143 à Exercise 3 : Finite Element Like Piecewise Polynomials The piecewise linear polynomial functions are constructed by using nested If statements. It is also noted that these basis functions does satisfy the zero boundary condition at the end points. Thus, we have large interpolation error in the vicinity of the two boundary points, since the original function is not vanished at these points. Furhermore, we have not evaluated the components of the mass and stiffness matrices M and K. Please extend the result in the previous two examples. In[150]:= n = 9; L = 1; xj = [email protected] - 1L * L • Hn + 1L, 8j, 1, n + 2<D fjj = [email protected] < [email protected]@jDD, 0, [email protected] < [email protected]@j + 1DD, Hx - [email protected]@jDDL • [email protected]@j + 1DD - [email protected]@jDDL, [email protected] < [email protected]@j + 2DD, [email protected]@j + 2DD - xL • [email protected]@j + 2DD - [email protected]@j + 1DDL, 0DDD Fj = [email protected] •. j -> k, 8k, 1, n<D; [email protected]@FjD, 8x, 0, L<D g = [email protected] + [email protected] * Pi * x • LD gj = [email protected] •. x -> [email protected]@jDD, 8j, 2, n + 1<D gn = gj . Fj; [email protected], gn<, 8x, 0, L<, AxesLabel -> 8"x", "g & gn"<D eI = [email protected]@Hg - gnL ^ 2, 8x, 0, L<DD Out[150]= 90, €€€€€€€€ , €€€€€ , €€€€€€€€€ , €€€€€ , €€€€€ , €€€€€ , €€€€€€€€€ , €€€€€ , €€€€€€€€ , 1= € € 1 10 1 5 3 10 2 5 1 2 3 5 7 10 4 5 9 10 Part::pspec : Part specification j is neither an integer nor a list of integers. 8 Exersise_2_1.nb Out[151]= IfAx < 90, €€€€€€€€€ , €€€€€ , €€€€€€€€ , €€€€€ , €€€€€ , €€€€€ , €€€€€€€€ , €€€€€ , €€€€€€€€€ , 1=PjT, 0, € € 1 10 1 5 3 2 1 3 7 4 9 10 5 2 5 10 5 10 x - xjPjT xjPj + 2T - x IfAx < xjPj + 1T, €€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ , IfAx < xjPj + 2T, €€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ , 0EEE € xjPj + 1T - xjPjT xjPj + 2T - xjPj + 1T 1 0.8 0.6 0.4 0.2 0.2 0.4 0.6 0.8 1 Out[152]= … Graphics … Out[153]= E-x + [email protected] p xD ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ 1 1 1 1 1 1 1 1 1 •++++ •++++ •++++ € € Out[154]= 9 €€€€€ \$ €€€€€ I5 - 5 M + €€€€€€€€€€€€€€ , €€€€€ \$ €€€€€ I5 + 5 M + €€€€€€€€€€€€ , €€€€€ \$ €€€€€ I5 + 5 M + €€€€€€€€€€€€€€ , 2 E3•10 2 E1•5 2 2 E1•10 2 2 ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ 1 1 1 1 1 1 1 1 1 1 •++++ •++++ •++++ € € €€€€€ \$ €€€€€ I5 - 5 M + €€€€€€€€€€€€ , €€€€€€€€€€€ , - €€€€€ \$ €€€€€ I5 - 5 M + €€€€€€€€€€€€ , - €€€€€ \$ €€€€€ I5 + 5 M + €€€€€€€€€€€€€€ , •++++ E7•10 2 E3•5 2 2 2 E2•5 2 2 E ++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++ 1 1 1 \$1 1 \$1 •++++ •++++ € €€€€€ I5 - 5 M + €€€€€€€€€€€€€€ = - €€€€€ €€€€€ I5 + 5 M + €€€€€€€€€€€€ , - €€€€€ E9•10 E4•5 2 2 2 2 g & gn 1.5 1 0.5 x 0.2 -0.5 Out[155]= … Graphics … Out[156]= 0.197435 0.4 0.6 0.8 1 ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online