\(\\\)
The Euler-Bernoulli beam is a mathematical model for a beam of material bending under stress represented by the equation \[EIy''''=f(x)\] where \( f(x)\) is the applied load (including the weight of the beam), \(y(x)\) is the function that represents the vertical displacement of the beam, where \(0\leq x\leq L\) and \(L\) is the length of the beam. The quantities \(E\) and \(I\) are the constant Young's modulus of the material and the constant area moment of inertia, respectively.
(1) In order to define the structure of our banded matrix \(A\), we hard-coded the fixed rows and implemented a nested for loop in Matlab to fill in the rows that depend on \(n\), where \(n\) is defined as the number of grid steps. Using MATLAB's \ command for matrix division, we solved our system of equations for the displacements \(y_i\) for \(n=10\), and plotted the approximate solution on the interval \([0,2]\).
(2) For part 2, we plotted our approximate solution against the correct solution \( y(x) \), as well as the absolute error over the domain of \(x\). Since the derivative approximations are exact in this case, the error is near machine roundoff.
(3) Tasked with determining the n value which minimizes error for \(n=2\times 10^{\, k}\) and \(k=1,\dots,10\), we proceeded by making a table of the errors corresponding to each \(n\) value. Based on our results, the error is minimal in the case \(n=20\), and strictly increases with the \(n\) values included in our program. Our accompanying table of the condition number of matrix \(A\), which shows that the condition number also increases with \(n\), indicates that the increased error associated with increasing \(n\) is attributed to rounding error as a result of our matrix becoming ill-conditioned as \(n\) increases.
\(n\) | errors | cond(A) |
20 | 4.0593e\(-15\) | 5.303e\(+05\) |
40 | 1.9687e\(-13\) | 8.4493e\(+06\) |
80 | 1.3385e\(-12\) | 1.3482e\(+08\) |
160 | 1.5524e\(-11\) | 2.1539e\(+09\) |
320 | 3.746e\(-10\) | 3.4435e\(+10\) |
640 | 8.2035e\(-10\) | 5.5073e\(+11\) |
1280 | 4.2696e\(-09\) | 8.8099e\(+12\) |
2560 | 1.7006e\(-07\) | 1.4094e\(+14\) |
5120 | 3.797e\(-06\) | 2.2549e\(+15\) |
10240 | 3.9358e\(-05\) | 3.6176e\(+16\) |