diff --git a/final_project/README.md b/final_project/README.md new file mode 100644 index 0000000..cee3ee3 --- /dev/null +++ b/final_project/README.md @@ -0,0 +1,103 @@ +# ME 3255 - Final Project +## Due May 1 by 11:59pm + +In this project you are going to solve for the shape of a beam under different loading +conditions. The shape of the beam varies along the x-axis and as a function of time. + +Notes: Label the plots with legends, x- and y-axis labels and make sure the plots are easy +to read (you can use the `setdefaults.m` script we have used in class). All functions +should have a help file and your README.md should describe each file in your repository +and provide a description of each problem and each solution (use `#`-headings in your file +to show the start of new problems) + +You will be graded both on documentation and implementation of the solutions. + +![Diagram of beam and loading conditions](beam.png) + +We will use the Euler-Bernoulli beam equation to describe the shape of the beam, the +differential equation that governs the solution is: + +$\frac{\partial^4 w}{\partial x^4}-\frac{P}{EI}\frac{\partial^2 w}{\partial +x^2}+\frac{\rho A}{EI}\frac{\partial^2 w}{\partial t^2}=q(x)$ (1) + +Where w(x,t) is the displacement of the beam away from the neutral axis as a function of +position along the beam, x, and time, t, P is the transverse loading of the beam, E is the +Young's modulus, I is the second moment of Inertia of the beam, $\rho$ is the density, A +is the cross-sectional area, and q(x) is the transverse distributed load (for a uniform +pressure, it is the applied pressure times the width of the beam, in units of +force/length). + +We can separate the function $w(x,t)=w(x)e^{i\omega t}$, now equation (1) becomes + +$\left(\frac{\partial^4 w}{\partial x^4}-\frac{P}{EI}\frac{\partial^2 w}{\partial +x^2}-\frac{\rho A \omega^{2}}{EI}w\right)e^{i\omega t}=\frac{q(x)}{EI}$ (2) + +For the simply-supported beam shown in Figure 1, the boundary conditions are: + +$w(0)=w(L)=0$ + +$w''(0)=w''(L)=0$ + +The material is aluminum, E=70 GPa, $\rho$=2700 kg/m$^3$. The bar is 1-m-long with a base +width, b=0.1 m, and height, h=0.01 m, and the second moment of inertia, +I=$\frac{bh^3}{12}$. + +1. Analytically solve for the shape of the beam if q(x)=cst, P=0, and $\omega$=0 and +create a function called `shape_simple_support.m` that returns the displacement w(x) given +q and x + +``` +w=shape_simple_support(x,q); +``` + +a. Plot q vs the maximum deflection, $\delta x$, of the beam + +b. Use a Monte Carlo model to determine the mean and standard deviation for the +maximum deflection $\delta x$ if b and h are normally distributed random variables +with 0.1 % standard deviations at q=50 N/m. + +3. Now use the central difference approximation to set up a system of equations for the +beam for q(x)=cst, P=0, and $\omega=0$. Use the boundary conditions with a numerical +differentiation to determine the valuea of the end points + + a. set up the system of equations for 6 segments as a function of q + + b. set up the system of equations for 10 segments as a function of q + + c. set up the system of equations for 20 segments as a function of q + + d. solve a-c for q=1,10,20,30,50 and plot the numerical results of q vs $\delta x$ + + e. Comment on the results from the analytical and numerical approaches (if you used + functions then provide help files, if you used scripts, then describe the steps used) + +4. Now set up the system of equations using a central difference method if P>0 and +$\omega=0$ + + a. set up the system of equations for 6 segments as a function of q and P + + b. set up the system of equations for 10 segments as a function of q and P + + c. set up the system of equations for 20 segments as a function of q and P + + d. solve a-c for q=1,10,20,30,50 and plot the numerical results of q vs $\delta x$ for + P=0, 100, 200, 300 (4 lines, labeled as P=0,P=100,...) + +5. Now set up an eigenvalue problem to solve for the natural frequencies of the simply +supported beam if P=0 and q=0. + + a. set up the system of equations for 6 segments + + b. set up the system of equations for 10 segments + + c. set up the system of equations for 20 segments + + d. solve for the natural frequencies ($\omega_{1}$, $\omega_{2}$,...) + + e. Plot the shape of the beam for the first 3 natural frequencies + +6. (Bonus 5pt) Create a function to return the system of equations for the eigenvalue +problem as a function of P, if P>0. Then, plot the lowest natural frequency vs the applied +load P. + + diff --git a/final_project/beam.png b/final_project/beam.png new file mode 100644 index 0000000..271d614 Binary files /dev/null and b/final_project/beam.png differ diff --git a/final_project/beam.svg b/final_project/beam.svg new file mode 100644 index 0000000..b02b62d --- /dev/null +++ b/final_project/beam.svg @@ -0,0 +1,615 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + q(x) + P + P + + + w(x) + + + x + y + + diff --git a/final_project/rubric.md b/final_project/rubric.md new file mode 100644 index 0000000..08248bd --- /dev/null +++ b/final_project/rubric.md @@ -0,0 +1,27 @@ +# Grading Rubric + +| Component | Grade | Description | +| --------- |------ |--------------------------------- | +|Solutions | 50 % | Problems are solved correctly and solution makes sense | +|Documentation| 30 % | All files have comments and all functions have help files | +|Problem Statements | 10% | Descriptions of each problem and the approach | +|Team Work | 10% | Each group member made commits to repository| +|Github Bonus | 5% | If a group member opens an [issue](https://guides.github.com/features/issues/) and you commit code to close it| + +The Documentation and Problem Statements will be assessed based upon the included m-files +and the main README.md documentation. This is a final report, so make sure the README.md +is easy to understand with headers (`#`, `##`, ...) to start each problem and sub-problem. + +The Solutions will be graded based upon correctness and the approach. The plots will be +graded based upon the axis labels, titles, legend, correctness, and design. +If you are asked to solve for a value, you can choose to put it in a table or in a +paragraph, but it must be easy to read/understand. + +The Team Work section is meant to demonstrate working knowledge of Github (now as a +collaborative project). If everyone makes commits to the project, then you will receive +credit. + +The Github Bonus requires extra reading. Create an issue and tag your group member. That +group member can then respond and *fix* the issue with a commit. This is a bonus 5pts (on +an individual basis, for everyone to get credit, everyone in the group would need to close +an issue) diff --git a/lecture_20/lecture_20.ipynb b/lecture_20/lecture_20.ipynb index 50f858a..da8c4ac 100644 --- a/lecture_20/lecture_20.ipynb +++ b/lecture_20/lecture_20.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 152, "metadata": { "collapsed": true }, @@ -13,7 +13,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 153, "metadata": { "collapsed": true }, @@ -97,17 +97,19 @@ "source": [ "# Integrals in practice\n", "\n", - "### Example: Compare toughness of two steels\n", + "### Example: Compare toughness of Stainless steel to Structural steel\n", "\n", "![Stress-strain plot of steel](steel_psi.jpg)\n", "\n", + "### Step 1 - G3Data to get points \n", + "\n", "Use the plot shown to determine the toughness of stainless steel and the toughness of structural steel.\n", "\n" ] }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 154, "metadata": { "collapsed": false }, @@ -162,7 +164,7 @@ }, { "cell_type": "code", - "execution_count": 147, + "execution_count": 155, "metadata": { "collapsed": false }, @@ -347,7 +349,7 @@ }, { "cell_type": "code", - "execution_count": 148, + "execution_count": 156, "metadata": { "collapsed": false }, @@ -429,7 +431,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 157, "metadata": { "collapsed": true }, @@ -448,7 +450,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 159, "metadata": { "collapsed": false }, @@ -457,12 +459,12 @@ "name": "stdout", "output_type": "stream", "text": [ - "ans = 3.5000\r\n" + "ans = 6.6250\r\n" ] } ], "source": [ - "gauss_1pt(f1,2,3)" + "gauss_1pt(f2,2,3)" ] }, { @@ -496,7 +498,7 @@ }, { "cell_type": "code", - "execution_count": 149, + "execution_count": 164, "metadata": { "collapsed": false }, @@ -507,7 +509,13 @@ "text": [ "ans = 6.6667\n", "ans = 6.6667\n", - "ans = 6.6667\n" + "ans = 6.6667\n", + "f_c =\n", + "\n", + "@(x) cosh (x / 30) + exp (-10 * x) .* erf (x)\n", + "\n", + "ans = 2.0048\n", + "ans = 2.0048\n" ] } ], @@ -515,7 +523,11 @@ "% integral of quadratic\n", "quad(f2,2,3)\n", "quadl(f2,2,3)\n", - "f3(3)-f3(2)" + "f3(3)-f3(2)\n", + "f_c=@(x) cosh(x/30)+exp(-10*x).*erf(x)\n", + "\n", + "quad(f_c,1,3)\n", + "quadl(f_c,1,3)" ] }, { @@ -531,7 +543,7 @@ }, { "cell_type": "code", - "execution_count": 82, + "execution_count": 165, "metadata": { "collapsed": false }, @@ -682,7 +694,7 @@ "\t\n", "\tgnuplot_plot_2a\n", "\n", - "\t\n", + "\t\n", "\t\n", "\n", "\n", @@ -713,7 +725,7 @@ }, { "cell_type": "code", - "execution_count": 98, + "execution_count": 166, "metadata": { "collapsed": false }, @@ -767,31 +779,36 @@ "\n", "\n", "\t\t\n", + "\t\t-2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", "\t\t-1.5\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t-1\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t-0.5\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t0\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t0.5\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t1\n", "\t\n", "\n", @@ -860,11 +877,11 @@ "\n", "\n", "\n", - "\t\n", + "\t\n", "\t\n", "\tgnuplot_plot_2a\n", "\n", - "\t\n", + "\t\n", "\t\n", "\n", "\n", @@ -919,7 +936,7 @@ }, { "cell_type": "code", - "execution_count": 99, + "execution_count": 168, "metadata": { "collapsed": false }, @@ -973,31 +990,36 @@ "\n", "\n", "\t\t\n", + "\t\t-2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", "\t\t-1.5\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t-1\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t-0.5\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t0\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t0.5\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t1\n", "\t\n", "\n", @@ -1070,7 +1092,7 @@ "\t\n", "\n", "\n", - "\t\n", + "\t\n", "\t\n", "\tno change\n", "\n", @@ -1079,7 +1101,7 @@ "\t\n", "\n", "\n", - "\t\n", + "\t\n", "\t\n", "\n", "\n", @@ -1110,7 +1132,7 @@ }, { "cell_type": "code", - "execution_count": 100, + "execution_count": 169, "metadata": { "collapsed": false }, @@ -1119,7 +1141,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "a = 0.99838\r\n" + "a = 1.0007\r\n" ] }, { @@ -1259,11 +1281,11 @@ "\n", "\n", "\n", - "\t\n", + "\t\n", "\t\n", "\tgnuplot_plot_2a\n", "\n", - "\t\n", + "\t\n", "\t\n", "\n", "\n", @@ -1554,39 +1576,7 @@ }, { "cell_type": "code", - "execution_count": 120, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "a =\n", - "\n", - " 1 2 3 4 5\n", - "\n", - "pa =\n", - "\n", - " 2 1 1 2 3 4 5 5 4\n", - "\n", - "ans =\n", - "\n", - " 1 9\n", - "\n" - ] - } - ], - "source": [ - "a=[1,2,3,4,5]\n", - "pa=[a(4/2:-1:1) a a(end:-1:end-4/2+1)]\n", - "size(pa)" - ] - }, - { - "cell_type": "code", - "execution_count": 137, + "execution_count": 170, "metadata": { "collapsed": false }, @@ -1738,111 +1728,111 @@ "\n", "\n", "\n", - "\t\n", + "\t\n", "\t\n", "\tgnuplot_plot_2a\n", "\n", "\t \n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", "\n", "\t\n", "\n", @@ -1879,7 +1869,7 @@ }, { "cell_type": "code", - "execution_count": 138, + "execution_count": 171, "metadata": { "collapsed": false }, @@ -1933,31 +1923,36 @@ "\n", "\n", "\t\t\n", + "\t\t-2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", "\t\t-1.5\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t-1\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t-0.5\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t0\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t0.5\n", "\t\n", "\n", "\n", - "\t\t\n", + "\t\t\n", "\t\t1\n", "\t\n", "\n", @@ -2026,113 +2021,113 @@ "\n", "\n", "\n", - "\t\n", + "\t\n", "\t\n", "\tgnuplot_plot_2a\n", "\n", - "\t\n", + "\t\n", "\t\n", "\tgnuplot_plot_3a\n", "\n", "\t \n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", - "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", "\n", "\t\n", "\n",