Skip to content

TEST #29

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

TEST #29

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions HW5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*Include all work as either an m-file script, m-file function, or example code included
with \`\`\` and document your code in the README.md file*

1. Create a new github repository called 'linear_algebra'.
1. Create a new github repository called 'linear_algebra'.

a. Add rcc02007 and pez16103 as collaborators.

Expand All @@ -13,7 +13,7 @@ with \`\`\` and document your code in the README.md file*
2. Create an LU-decomposition function called `lu_tridiag.m` that takes 3 vectors as inputs
and calculates the LU-decomposition of a tridiagonal matrix. The output should be 3
vectors, the diagonal of the Upper matrix, and the two off-diagonal vectors of the Lower
and Upper matrices.
and Upper matrices.

```[ud,uo,lo]=lu_tridiag(e,f,g);```

Expand All @@ -26,7 +26,7 @@ the backslash solver `\`, create an algebraic solution*

4. Test your function on the matrices A3, A4, ..., A10 generated with `test_arrays.m`
Solving for `b=ones(N,1);` where N is the size of A. In your `README.md` file, compare
the norm of the error between your result and the result of AN\b.
the norm of the error between your result and the result of AN\b.

```
| size of A | norm(error) |
Expand All @@ -40,10 +40,10 @@ the norm of the error between your result and the result of AN\b.
5. In the system shown above, determine the three differential equations for the position
of masses 1, 2, and 3. Solve for the vibrational modes of the spring-mass system if k1=10
N/m, k2=k3=20 N/m, and k4=10 N/m. The masses are m1=1 kg, m2=2 kg and m3=4 kg. Determine
the eigenvalues and natural frequencies.
the eigenvalues and natural frequencies.

6. The curvature of a slender column subject to an axial load P (Fig. P13.10) can be
modeled by
modeled by

$\frac{d^{2}y}{dx^{2}} + p^{2} y = 0$

Expand All @@ -54,7 +54,7 @@ about its neutral axis.

This model can be converted into an eigenvalue problem by
substituting a centered finite-difference approximation for the second derivative to give
$\frac{y_{i+1} -2y_{i} + y_{i-1} }{\Delta x^{2}}+ p^{2} y_{i}$
$\frac{y_{i+1} -2y_{i} + y_{i-1} }{\Delta x^{2}}+ p^{2} y_{i}$

where i = a node located at a position along the rod’s interior, and $\Delta x$ = the
spacing between nodes. This equation can be expressed as $y_{i-1} - (2 - \Delta x^{2}
Expand All @@ -66,11 +66,11 @@ Determine the eigenvalues for a 5-segment (4-interior nodes), 6-segment (5-inter
nodes), and 10-segment (9-interior nodes). Using the modulus and moment of inertia of a
pole for pole-vaulting (
[http://people.bath.ac.uk/taf21/sports_whole.htm](http://people.bath.ac.uk/taf21/sports_whole.htm))
E=76E9 Pa, I=4E-8 m^4, and L= 5m.
E=76E9 Pa, I=4E-8 m^4, and L= 5m.

Include a table in the `README.md` that shows the following results:
What are the largest and smallest eigenvalues for the beam? How many eigenvalues are
there?
there?

```
| # of segments | largest | smallest | # of eigenvalues |
Expand Down
Binary file added Pull.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions extra_credit_1/data.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
radius (cm), angle (degrees)
0, 0
2.25, 62
3.81, 140
6.35, 116
.635, 88
7.62, 12
1.27, 180
3 changes: 1 addition & 2 deletions lecture_01/lecture_01.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,5 @@ plot(t,v_analytical,'-',t,v_numerical,'o-')

![plot of
velocities](https://github.uconn.edu/rcc02007/ME3255S2017/blob/master/lecture_01/output_10_0.svg)
<img
src="https://github.uconn.edu/rcc02007/ME3255S2017/blob/master/lecture_01/output_10_0.svg">
<img src="https://github.uconn.edu/rcc02007/ME3255S2017/blob/master/lecture_01/output_10_0.svg">

27 changes: 14 additions & 13 deletions lecture_07/lecture_07.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1435,22 +1435,23 @@
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Octave",
"language": "octave",
"name": "octave"
"display_name": "Python [conda root]",
"language": "python",
"name": "conda-root-py"
},
"language_info": {
"file_extension": ".m",
"help_links": [
{
"text": "MetaKernel Magics",
"url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
}
],
"mimetype": "text/x-octave",
"name": "octave",
"version": "0.19.14"
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions lecture_07/mod_secant.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
% ea = approximate relative error (%)
% iter = number of iterations
if nargin<3,error('at least 3 input arguments required'),end
if nargin<4 || isempty(es),es=0.0001;end
if nargin<4 || isempty(es),es=0.0001;end
if nargin<5 || isempty(maxit),maxit=50;end
iter = 0;
iter = 0
while (1)
xrold = xr;
dfunc=(func(xr+dx)-func(xr))./dx;
xr = xr - func(xr)/dfunc;
xr = xr - func(xr)/dfunc; %calculate as an approximation
iter = iter + 1;
if xr ~= 0
ea = abs((xr - xrold)/xr) * 100;
Expand Down
4 changes: 3 additions & 1 deletion lecture_10/GaussNaive.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
% forward elimination
for k = 1:n-1
for i = k+1:n
factor = Aug(i,k)/Aug(k,k);
factor = Aug(i,k)/Aug(k,k);
%this is naive because if a coefficient in the matrix is zero
%then divide by zero errot.
Aug(i,k:nb) = Aug(i,k:nb)-factor*Aug(k,k:nb);
end
end
Expand Down
Empty file removed lecture_15/ष
Empty file.
Empty file removed lecture_15/�&�
Empty file.