Matlab Program due in 24 hrs
MAE 3210 - Spring 2019 - Project 1
Project 1 is due online through Canvas by 11:59PM on Monday, February 25.
IMPORTANT REMARKS (Please read carefully):
• Projects are to be treated as take-home exams with NO collabo- ration or discussion with other students. Plagiarism will be monitored and considered as cheating. In addition to your project PDF, you are required to sign and submit an honor pledge which can be found adjacent to the project handout, under assignments in Canvas. Each project is worth 50 points, and a 10 point loss per day will apply to late projects.
• You are required to submit code for all functions and/or subroutines built to solve these problems, which is designed to be easy to read and understand, in your chosen programming language, and which you have written yourself. The text from your code should both be copied into a single PDF file submit- ted on canvas. Your submitted PDF must also include responses to any assigned questions, which for problems requiring programming should be based on output from your code. For example, if you are asked to find a numerical answer to a problem, the number itself should be included in your submission.
• In addition to what is required for homework submission, for each numerical answer you reach based on running code you have written yourself, your submitted project PDF must include a copy of a screenshot that shows your computer window after your code has been executed, with the numerical answer displayed clearly on the screen.
• Note that, in problem 2 below, you are asked to use code that you have already written for homework 3. You need to submit any code that you use for this project, including any code that you already wrote and submitted for homework 3.
• If you are asked to use code that you have written yourself to solve a given problem (e.g. in 1(c), 2(c),(d) below), but you are unable to get that code working, you may choose, instead, to submit numerical answers based on run- ning built-in functions (e.g. determinant computation, root finders, algebraic solvers already available in MATLAB), and you will receive partial credit. However, you are required to write all code yourself, without rely- ing on built-in functions, in order to get full points.
1. The general form of a three-dimensional stress field in a continuum material is represented in the standard coordinate system by a 3⇥3 matrix
� =
0
@ �
xx
�
xy
�
xz
�
xy
�
yy
�
yz
�
xz
�
yz
�
zz
1
A
where the diagonal terms represent tensile or compressive stresses and the o↵- diagonal terms represent shear stresses. The principal stresses �
1
, �
2
, and � 3
are defined as the eigenvalues of �, which correspond to the roots of the characteristic equation c(�) = 0, where c(�) = det(�I ��) is the characteristic polynomial and of �, and I is the 3⇥3 identity matrix.
(a) Write a program that takes the entries of a three-dimensional stress field � as input and outputs a
0
, a
1
, and a 2
, the coe�cients of the characteristic polynomial c(�) = det(�I � �) = �3 + a
2
�
2 + a 1
� + a 0
.
(b) Consider the three-dimensional stress field given in units of MPa by
� =
0
@ 9 13 24 13 6 14 24 14 15
1
A .
Use the program you wrote for problem 1(a) to obtain the characteristic equation c(�) = 0, and solve for the three principal stresses of � in two ways:
(i) Using the modified secant method (see page 161 of course text).
(ii) Using the fixed point method.
HINT: You may need to modify the equation c(�) = 0 nearby each root in order to force the fixed point method to converge. It may be useful to recall: what property does c0(�) need to satisfy nearby a given root in order for the fixed point method to converge?
(c) Draw (by computer or by hand) iteration cobwebs to illustrate that the fixed point method you applied in problem 1(b) converges, and attach these draw- ings to your submission.
2. Linear algebraic equations can arise in the solution of di↵erential equations. For example, the following heat equation describes the equilibrium temperature T = T(x) (oC) at a point x (in meters m) along a long thin rod,
d
2
T
dx
2
= h0(T � T a
), (1)
where T a
(oC) denotes the temperature of the surrounding air, and h0 (m�2) is a heat transfer coe�cient. Assume that the rod is 12 meters long (i.e. 0 x 12)
and has boundary conditions imposed at its ends given by T(0) = 20 oC and T(12) = 160 oC.
(a) Using standard ODE methods, which you do not need to repeat here, the general form of an analytic solution to (1) can be derived as
T(x) = A + Be�x + Ce��x, (2)
where A, B, C, and � are constants. With T a
= 10 oC and h0 = 0.02 m�2, plug the formula (2) into equation (1) and analyze the results to solve for A and �.
(b) Next, impose the boundary conditions T(0) = 20 oC and T(12) = 160 oC to derive a system of 2 linear algebraic equations for B and C. Provide the system of two equations you have derived.
(c) Use one of the numerical algorithms you developed for homework 3 (Gauss elimination or LU decomposition) to solve the algebraic system you derived in question 2(b) above, and obtain an analytic solution to (1) of the form (2). By analytic solution we mean an explicit solution to equation (1) which is valid for each x in the interval [0, 12].
(d) Next we will discuss how to obtain a numerical solution to (1). That is, we will seek to obtain an approximate solution to (1) which describes the value of T at 5 intermediate points inside the interval [0, 12]. More precisely, the equation (1) can be transformed into a linear algebraic system for the temperature at 5 interior points T
1
= T(2), T 2
= T(4), T 3
= T(6), T 4
= T(8), and T
5
= T(10) by using the following finite di↵erence approximation for the second derivative at the ith interior point,
d
2
T
i
dx
2
= T
i+1
� 2T i
+ T i�1
(�x)2 , (3)
where 1 i 5, T 0
= T(0) = 20 oC, T 6
= T(12) = 160 oC, and �x is the spacing between the interior points. With T
a
= 10 oC and h0 = 0.02 m�2, use (3) to rewrite (1) as a system of 5 linear algebraic equations for the unknowns T
1
, T
2
, T
3
, T
4
and T 5
. Provide the system of 5 equations you have derived.
(e) Use one of the numerical algorithms you developed for homework 3 (Gauss elimination or LU decomposition) to solve the system derived in question 2(d) above. Validate your numerical solution by comparison to the analytic solution that you obtained in 2(c).
(f) Write a function that takes as input the number of interior nodes n desired for your numerical solution (i.e. n = 5 in 2(d) above), and outputs the numerical solution to (1) in the form of the interior node values T
1
= T(�x), T
2
= T(2�x), . . ., T n
= T(n�x).
(g) Produce and submit three plots that compare your analytic solution to (1) derived in question 2(b) to the numerical solution generated in question 2(f) for n = 5, n = 10, and n = 20, respectively.