0% found this document useful (0 votes)
75 views

Assignment 2

This document provides instructions for Assignment #2, which is due on October 17th. Students are asked to solve problems related to the deflection of a simply supported beam under a distributed load. They must determine: 1) The position x where the deflection is maximum, using bisection and Newton's methods. For Newton's method, students must write pseudo-code and a MATLAB function. 2) The maximum deflection and position x using Newton's method with tolerance 10^-14. They must also generate a convergence plot. 3) The maximum deflection and position x using MATLAB's built-in fzero function. Students are asked to submit their work, including code and outputs.

Uploaded by

guan wei
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

Assignment 2

This document provides instructions for Assignment #2, which is due on October 17th. Students are asked to solve problems related to the deflection of a simply supported beam under a distributed load. They must determine: 1) The position x where the deflection is maximum, using bisection and Newton's methods. For Newton's method, students must write pseudo-code and a MATLAB function. 2) The maximum deflection and position x using Newton's method with tolerance 10^-14. They must also generate a convergence plot. 3) The maximum deflection and position x using MATLAB's built-in fzero function. Students are asked to submit their work, including code and outputs.

Uploaded by

guan wei
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

SE 121A: Introduction to Computing for Engineers Oct.

11, 2019
Assignment #2 Due: Oct. 17, 2019 at 5:00 pm

5
 
Instructions: If you discuss the homework problems with other students, please refrain from
(? !8;!!2? ? 468,0!?
looking;,8)? ? )6(!?
at their code or 2? ? 6392?
+5 write-ups (or sharing your own). Ultimately, you must implement your
? )6(!? #,7?(,:!2?
own code=? 8)!?
and!598,32 ?
write up your own solution to be turned in. Your solution to the problems,
 5  



including

Gradescope
    

plots and requested output from your code for the assignment should be submitted via
as a pdf file. Upload any code you have written for the assignments on Gradescope
as well. You can access Gradescope on Canvas, where you can upload your solutions.
  1 ? ,7? 8)!? 4!61,88,:,8=? 327828? 2? ,7?
Problem: Consider a simply supported beam as shown below. The beam is loaded with a
68,0!? !8!61,2!? 8)!? ,782!? ,"?  5  ?
rectangular distributed load. The deflection, y, of the centerline of the beam as a function of the
,5 5
    ? 2? x,
position, 5is1? by the following equation:
given
? "928,32? !02!)&))25 8)8? ;7? !:!034!?
)?? 7868,2(? ,28!6:0? 3"? 
 𝑤! 𝑥
(7𝐿! − 10  𝐿! 𝑥 ! + 3𝑥 ! )
? '28,32? 2&0&))25 &31?630!1? #
𝑦=
360  𝐿𝐸𝐼
where L= 4 m is the length of the beam, E = 70 GPa is the elastic modulus, I=52.9×10-6 m4 is the
08,2? '28,32? 4.)5
moment of inertia, and w0= 20 kN/m.
!? !1? ,7? 03!? ;,8)? ? ,786,98!?


!8,32?  3"? 8)!? !28!6? 0,2!? 3"? 8)!? !1?
,32?
 ,7? (,:!2? =? 8)!? !598,32 ?

#
  

!2(8)?  5  ? ,7? 8)!? !078,? 139>


?
,7? 8)!? 131!28? 3"? ,2!68,? 2?
You are asked to find the position, x, at which the deflection of the beam is maximum and the
"# ;)!6!? 8)!? !$!8,32?
deflection3"?at8)!?
that!1?
point,7?
using the following
1<,191? methods: 8)!? !$!8,32? 8?
2? !8!61,2!?

1?!$!8,32? ,7?8? 8)!? 43,28? ;)!6!? # 5 ?


[Hint: the maximum"#
!"
deflection is at a point where !" = 0]
? "928,32? 31(%5(#5 (,:!2? ,2?630!1? #
? "928,32? &2))25
A) Carry(,:!2?
out 3,2? 63(61?
steps  # 7!?
(iterations) #
of the %6? ..5
bisection method#
on%6? 5 using a calculator (using 5
paper,
significant digits/figures is sufficient). You may start from the initial interval [0,L].
08,2? 4.)5 "928,32?Calculate the tolerance in the solution and tolerance in f(x) at each iteration. Use the last
value you obtain for x to calculate the maximum deflection in the beam.
),1!!7? 46,2,40!? 8)!? 93=2=? %6!? 8,2(?
B)$9,?
Write a MATLAB
83? 8+!?function
that implements Newton’s method to return the position x at

00=? ,11!67!? ,2? ? ,7? !590? ;!,()8?
which the deflection of the beam is maximum (note: Do NOT use MATLAB’s fzero or
368,32? 3"?8)!? 3-!8? 8)8? ,7? 791!6(!?
)??177?3"? 5 .(?2??,1!8!6?3"? #1?
5
roots function in your code). First, write a pseudo-code or step-by-step algorithm for your
code and include it in your submission.
!27,8=? 3"? 7!? ;8!6? ,7? 4463<,18!0=? *5 5  
8)!? 4368,32? 3"? 8)!? $38?
Your8)8?function
,7?3:!? ;8!6?have
should 2? the following form:
(?2?!598,32?8)8? !598!7?8)!? 177? 3"? 8)!? $38?
8)8? ,7?,740!?=? 8)!?4368,32?3"? 8)!?=$38?8)8?
function x_root newtonxx(x_est, tol, max_iter)
[…write the code here…]
end  #

,97?! # 8)!?:3091!?3"?? 4? 3"?!48)? ,7? (,:!2? = ?

 # !
#
 
#  
5 5
1  
7? 3"?* 2? 730:!? %6?*?
SE 121A: Introduction to Computing for Engineers Oct. 11, 2019
Assignment #2 Due: Oct. 17, 2019 at 5:00 pm

 
xx is your initials. x_est is the initial estimate in Newton’s method. tol is the maximum
acceptable value for the estimated relative error. max_iter is the maximum number of
times you allow for the iterations to take place. If the solution is not obtained with the
desired accuracy after max_iter number of iterations, the program should terminate and
print a message that notifies the user.
Use x=1 as your initial guess and run your code with tol = 10-14. Create a plot using
MATLAB that shows the estimated relative error versus iteration number with
logarithmic scale for y axis. This plot is called the convergence plot.

[Hint: to do this, you can store the relative error calculated at each iteration in a vector,
and use MATLAB’s Plot function or semilogy function]

For this part, you are asked to submit the following:

1. Your pseudo-code.
2. Your MATLAB code.
3. Position, x, at which the deflection of the beam is maximum (with tol = 10-14) and the
deflection at that point.
4. Convergence plot

C) Use MATLAB’s built-in fzero function and obtain position, x, at which the deflection of
the beam is maximum and the deflection at that point.
Submit all lines of code you have written for this part along with the output.

  2  

You might also like