ENGR 240 – Computational Methods for Engineering – Class AssignmentsAll problems must follow the format provided in the class. One file per lecture. In Matlab one problem per
section. Use clc, clear, format short and format compact. Use the given variables. Only show answers, inputs
must have ; In Excel one problem per worksheet. All Excel plots must be done in a separate sheet labeled PlotProblem #. All plots must include Title, axis labels, units and legends. All calculations must be done in
Matlab. Do not use calculator
Lecture 12 – Solving Single Equations
Problem 1
In order to determine the temperature distribution within a one-dimensional solid, engineers must often solve the
equation xtan x = c, where c is a known positive constant, in this case c = 2. For this equation determine the two
smallest positive and two largest negative roots (i.e., the two negative roots closest to the origin) using the following
methods:
a. Graphically either in Excel or Matlab.
Enter smallest positive values here: __________________ and __________________
Enter largest negative values here: __________________ and __________________
b. Solver in Excel
c. Fzero and an anonymous function in Matlab
Problem 2
Determine the real root for the equation x + cos(x) = 1.5+sin(x), using the following methods:
a. Graphically either in Excel or Matlab – Enter value here: ______________________
b. Solver in Excel.
c. Fzero and an anonymous function in Matlab
Problem 3
Determine the largest negative root of the equation – x2 + 5xsin(-3x) = 3, using the following methods:
a. Graphically either in Excel or Matlab – Enter value here: ______________________
b. Solver in Excel.
c. Fzero and an anonymous function in Matlab
d. Solve and symbolic math in Matlab
Problem 4 – Matlab
A paper cup shaped as a cone is designed to have a volume of 250 cm3. Determine the radius R and
height h such that the least amount of paper will be used for making the cup.
(Hint: Use formulas for volume and surface area of the cone – Disregard to top portion, since there is no paper)
21
ENGR 240 – Computational Methods for Engineering – Class Assignments
Problem 5 – Excel
A horizontal beam of length L is supported at each end (x = 0 and
F
x = L), as shown below. Suppose an external vertical force F is
applied to the beam at location a, where a is measured from the
left end of the beam (note that a + b = L). Then the vertical
a
deflection of the beam at some point x, x ≤ a, is determined by
b
the expression
𝐹𝑏𝑥
𝑦 = 6𝐸𝐼𝐿 (𝑥 2 + 𝑏 2 − 𝐿2 )
for a ≤ x ≤ L
where y is the vertical deflection, E is the modulus of elasticity (also known as Young’s modulus), and I is the moment
of inertia of the cross-sectional area of the beam. (Note that E depends only on the beam material, and it depends only
on the beam geometry.) Suppose a 10-ft beam is made of steel (E = 30 × 106 psi), and the moment of inertia is I = 5 in4.
If a vertical force of 15,000 lb is applied at a = 4 ft, determine:
a. Location at which maximum deflection takes place, given by 𝑥 = √
𝐿2 −𝑏2
3
b. The maximum deflection, which occurs at value obtained in part a.
c. Value of 0.75 times the maximum deflection.
d. Location to the left of the vertical force (solve for x < a) at which deflection is equal to the value obtained in part c.
Remember to use consistent units (convert ft to inches).
e. Location to the right of the vertical force (solve for x > a) at which deflection is equal to the value obtained in part c.
Remember to use consistent units (convert ft to inches).
Problem 6 – Matlab
Solve Lecture 12 – Problem 5 using Matlab.
22
ENGR 240
Computational Methods for Engineering
Class Assignments
Lecture 12 – Solving Single Equations
Problem 1
In order to determine the temperature distribution within a one-dimensional solid, engineers must often solve the
equation xtan x = c, where c is a known positive constant, in this case c = 2. For this equation determine the two
smallest positive and two largest negative roots (i.e., the two negative roots closest to the origin) using the following
methods:
a. Graphically either in Excel or Matlab.
Enter smallest positive values here: __________________ and __________________
Enter largest negative values here: __________________ and __________________
b. Solver in Excel
c. Fzero and an anonymous function in Matlab
Problem 2
Determine the real root for the equation x + cos(x) = 1.5+sin(x), using the following methods:
a. Graphically either in Excel or Matlab
Enter value here: ______________________
b. Solver in Excel.
c. Fzero and an anonymous function in Matlab
Problem 3
Determine the largest negative root of the equation
a. Graphically either in Excel or Matlab
x2 + 5xsin(-3x) = 3, using the following methods:
Enter value here: ______________________
b. Solver in Excel.
c. Fzero and an anonymous function in Matlab
d. Solve and symbolic math in Matlab
Problem 4 – Matlab
A paper cup shaped as a cone is designed to have a volume of 250 cm 3. Determine the radius R and
height h such that the least amount of paper will be used for making the cup.
(Hint: Use formulas for volume and surface area of the cone
Disregard to top portion, since there is no paper)
21
ENGR 240
Computational Methods for Engineering
Class Assignments
Problem 5 – Excel
A horizontal beam of length L is supported at each end (x = 0 and
F
x = L), as shown below. Suppose an external vertical force F is
applied to the beam at location a, where a is measured from the
left end of the beam (note that a + b = L). Then the vertical
a
b
the expression
for a
x
L
of inertia of the cross-sectional area of the beam. (Note that E depends only on the beam material, and it depends only
on the beam geometry.) Suppose a 10-ft beam is made of steel (E = 30 × 10 6 psi), and the moment of inertia is I = 5 in 4.
If a vertical force of 15,000 lb is applied at a = 4 ft, determine:
a. Location at which maximum deflection takes place, given by
b. The maximum deflection, which occurs at value obtained in part a.
c. Value of 0.75 times the maximum deflection.
d. Location to the left of the vertical force (solve for x < a) at which deflection is equal to the value obtained in part c.
Remember to use consistent units (convert ft to inches).
e. Location to the right of the vertical force (solve for x > a) at which deflection is equal to the value obtained in part c.
Remember to use consistent units (convert ft to inches).
Problem 6 – Matlab
Solve Lecture 12
Problem 5 using Matlab.
22