Problem 1 (20 points, Core Course Outcome #6)/MatlabGrader Develop a Matlab function mySimpson 38 that calculates I = fy(x)dr using the composite Simpson's 3/8 method for a set of discrete data points (x, y) that are equally spaced. If the number of subintervals is not divisible by 3 because there is 1 extra subinterval, calculate the integral of the last 4 subintervals using Simpson's 1/3 method. If there are 2 extra subintervals, calculate the integral for the last 2 subintervals using Simpson's 1/3 method. If the number of subintervals is zero (= 1 data point only), the function shall return a value of zero for the integral. If the number of subintervals is one (= 2 data points only), the function shall use the trapezoidal method on the single interval. If the vectors x and y are not of equal length, the function shall execute Matlab's function error("...") with an appropriate error message. As input the function shall take the column vectors x and y that contain the data points. As output the function shall give the calculated integral I. You may call/use any function developed in recitation, homework, and/or exams. Required submission: well commented function source code submitted to Matlab Grader using the Canvas link for Exam 6 - Problem 1 Problem 2 (35 points, Core Course Outcomes 6 & 11) A cantilevered beam of length L = 16 is made of a hybrid material that has a spatially varying product of the area moment of p(x) X El(x) L Figure 1: Sketch of cantilevered beam with varying load p(x) and varying EI(x). inertia and Young's modulus, EI(x,a), where a is a parameter describing the hybrid material composition with 2 ≤ a ≤5. The beam is subjected to a varying load p(x), see Figure 1 (positive values of p are pointing in the positive y direction). Recall that for the beam shown, the shear force F(x) at location r; is the bending moment M(r.) is F(x)= p(x)dx, the beam's slope (z;) as a result of the bending moment is and the beam's deflection y(r.) is 1 M(x)= -[" F(x)dx, 0(xi)= M(z) El(x,a) edz. y(x;) = 0 (x)dr. (1) (2) (3) (4) The load p(x) can be determined by calling the content hidden function loadbeam (x) available in the Canvas assignment. The input argument can be either a scalar value of a single location along the beam, or a column vector containing multiple locations. The output is p(x) at the given input location(s) as either a scalar (for a scalar input ) or a column vector. EI(x, α) can be determined by calling the content hidden function EIbeam (x, alpha) available in the Canvas assignment. Here alpha is the scalar value of a and the input argument x can be either a scalar value of a single location along the beam, or a column vector containing multiple locations. The output is EI(x, a) at the given input location(s) as either a scalar (for a scalar input) or a column vector. The content hidden Matlab function files loadbeam.p and EIbeam.p are available on Canvas in the exam assignment. For a = 3 and N = 32 equally sized intervals along the beam, determine the beam's deflection at it's end, y(L) using only integration methods covered in this class. Graph in separate plots the load p(x), the beam's shear force F(x), bending moment M(x), slope (2), and deflection y(x). Note that all quantities are dimensionless and Eq. (3) does require component-wise division ./ when calculating the integrand using vectors. Use column vectors throughout. State which integration method you have used. On Canvas, you will find a link to a MatlabGrader non-credit test for the script you code. The test let's you check whether your script will calculate the deflection at the beam's end correctly using Newton-Cotes integration techniques covered in class. It is entirely optional and will not earn any credit. Please see the description of the MatlabGrader problem for further details. Required submission to Gradescope: name of integration method used (named in code is not sufficient); beam's deflection at its end, y(L): 5 separate graphs showing p(x), F(x), M(x), 0(x), and y(x) respectively; printout of script and any additional functions not already submitted in prior homework/exams;

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

using Matlab code

Problem 1 (20 points, Core Course Outcome #6)/MatlabGrader
Develop a Matlab function mySimpson 38 that calculates I = fy(x)dr using the composite Simpson's 3/8 method for a set of
discrete data points (x, y) that are equally spaced. If the number of subintervals is not divisible by 3 because there is 1 extra
subinterval, calculate the integral of the last 4 subintervals using Simpson's 1/3 method. If there are 2 extra subintervals, calculate
the integral for the last 2 subintervals using Simpson's 1/3 method.
If the number of subintervals is zero (= 1 data point only), the function shall return a value of zero for the integral. If the number of
subintervals is one (= 2 data points only), the function shall use the trapezoidal method on the single interval. If the vectors x and y
are not of equal length, the function shall execute Matlab's function error("...") with an appropriate error message.
As input the function shall take the column vectors x and y that contain the data points. As output the function shall give the
calculated integral I. You may call/use any function developed in recitation, homework, and/or exams.
Required submission:
well commented function source code submitted to Matlab Grader using the Canvas link for Exam 6 - Problem 1
Problem 2 (35 points, Core Course Outcomes 6 & 11)
A cantilevered beam of length L = 16 is made of a hybrid material that has a spatially varying product of the area moment of
p(x)
X
El(x)
L
Figure 1: Sketch of cantilevered beam with varying load p(x) and varying EI(x).
inertia and Young's modulus, EI(x,a), where a is a parameter describing the hybrid material composition with 2 ≤ a ≤5. The
beam is subjected to a varying load p(x), see Figure 1 (positive values of p are pointing in the positive y direction). Recall that for
the beam shown, the shear force F(x) at location r; is
the bending moment M(r.) is
F(x)=
p(x)dx,
the beam's slope (z;) as a result of the bending moment is
and the beam's deflection y(r.) is
1
M(x)=
-[" F(x)dx,
0(xi)=
M(z)
El(x,a)
edz.
y(x;) = 0 (x)dr.
(1)
(2)
(3)
(4)
The load p(x) can be determined by calling the content hidden function loadbeam (x) available in the Canvas assignment. The
input argument can be either a scalar value of a single location along the beam, or a column vector containing multiple locations.
The output is p(x) at the given input location(s) as either a scalar (for a scalar input ) or a column vector.
EI(x, α) can be determined by calling the content hidden function EIbeam (x, alpha) available in the Canvas assignment. Here
alpha is the scalar value of a and the input argument x can be either a scalar value of a single location along the beam, or a
column vector containing multiple locations. The output is EI(x, a) at the given input location(s) as either a scalar (for a scalar
input) or a column vector.
The content hidden Matlab function files loadbeam.p and EIbeam.p are available on Canvas in the exam assignment.
For a = 3 and N = 32 equally sized intervals along the beam, determine the beam's deflection at it's end, y(L) using only
integration methods covered in this class. Graph in separate plots the load p(x), the beam's shear force F(x), bending moment
M(x), slope (2), and deflection y(x).
Note that all quantities are dimensionless and Eq. (3) does require component-wise division ./ when calculating the integrand
using vectors. Use column vectors throughout. State which integration method you have used.
On Canvas, you will find a link to a MatlabGrader non-credit test for the script you code. The test let's you check whether your
script will calculate the deflection at the beam's end correctly using Newton-Cotes integration techniques covered in class. It is
entirely optional and will not earn any credit. Please see the description of the MatlabGrader problem for further details.
Required submission to Gradescope:
name of integration method used (named in code is not sufficient);
beam's deflection at its end, y(L):
5 separate graphs showing p(x), F(x), M(x), 0(x), and y(x) respectively;
printout of script and any additional functions not already submitted in prior homework/exams;
Transcribed Image Text:Problem 1 (20 points, Core Course Outcome #6)/MatlabGrader Develop a Matlab function mySimpson 38 that calculates I = fy(x)dr using the composite Simpson's 3/8 method for a set of discrete data points (x, y) that are equally spaced. If the number of subintervals is not divisible by 3 because there is 1 extra subinterval, calculate the integral of the last 4 subintervals using Simpson's 1/3 method. If there are 2 extra subintervals, calculate the integral for the last 2 subintervals using Simpson's 1/3 method. If the number of subintervals is zero (= 1 data point only), the function shall return a value of zero for the integral. If the number of subintervals is one (= 2 data points only), the function shall use the trapezoidal method on the single interval. If the vectors x and y are not of equal length, the function shall execute Matlab's function error("...") with an appropriate error message. As input the function shall take the column vectors x and y that contain the data points. As output the function shall give the calculated integral I. You may call/use any function developed in recitation, homework, and/or exams. Required submission: well commented function source code submitted to Matlab Grader using the Canvas link for Exam 6 - Problem 1 Problem 2 (35 points, Core Course Outcomes 6 & 11) A cantilevered beam of length L = 16 is made of a hybrid material that has a spatially varying product of the area moment of p(x) X El(x) L Figure 1: Sketch of cantilevered beam with varying load p(x) and varying EI(x). inertia and Young's modulus, EI(x,a), where a is a parameter describing the hybrid material composition with 2 ≤ a ≤5. The beam is subjected to a varying load p(x), see Figure 1 (positive values of p are pointing in the positive y direction). Recall that for the beam shown, the shear force F(x) at location r; is the bending moment M(r.) is F(x)= p(x)dx, the beam's slope (z;) as a result of the bending moment is and the beam's deflection y(r.) is 1 M(x)= -[" F(x)dx, 0(xi)= M(z) El(x,a) edz. y(x;) = 0 (x)dr. (1) (2) (3) (4) The load p(x) can be determined by calling the content hidden function loadbeam (x) available in the Canvas assignment. The input argument can be either a scalar value of a single location along the beam, or a column vector containing multiple locations. The output is p(x) at the given input location(s) as either a scalar (for a scalar input ) or a column vector. EI(x, α) can be determined by calling the content hidden function EIbeam (x, alpha) available in the Canvas assignment. Here alpha is the scalar value of a and the input argument x can be either a scalar value of a single location along the beam, or a column vector containing multiple locations. The output is EI(x, a) at the given input location(s) as either a scalar (for a scalar input) or a column vector. The content hidden Matlab function files loadbeam.p and EIbeam.p are available on Canvas in the exam assignment. For a = 3 and N = 32 equally sized intervals along the beam, determine the beam's deflection at it's end, y(L) using only integration methods covered in this class. Graph in separate plots the load p(x), the beam's shear force F(x), bending moment M(x), slope (2), and deflection y(x). Note that all quantities are dimensionless and Eq. (3) does require component-wise division ./ when calculating the integrand using vectors. Use column vectors throughout. State which integration method you have used. On Canvas, you will find a link to a MatlabGrader non-credit test for the script you code. The test let's you check whether your script will calculate the deflection at the beam's end correctly using Newton-Cotes integration techniques covered in class. It is entirely optional and will not earn any credit. Please see the description of the MatlabGrader problem for further details. Required submission to Gradescope: name of integration method used (named in code is not sufficient); beam's deflection at its end, y(L): 5 separate graphs showing p(x), F(x), M(x), 0(x), and y(x) respectively; printout of script and any additional functions not already submitted in prior homework/exams;
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education