0% found this document useful (0 votes)
163 views5 pages

Matlab - Practice Problems

This document contains 20 practice problems related to optimization techniques in engineering. The problems cover topics like plotting functions in Matlab, solving systems of equations, linear programming, and unconstrained optimization. The goal is to find minimum or maximum values that satisfy given constraints. Students are asked to write Matlab code to solve each problem and visualize the results.

Uploaded by

Sudeesh Sudevan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
163 views5 pages

Matlab - Practice Problems

This document contains 20 practice problems related to optimization techniques in engineering. The problems cover topics like plotting functions in Matlab, solving systems of equations, linear programming, and unconstrained optimization. The goal is to find minimum or maximum values that satisfy given constraints. Students are asked to write Matlab code to solve each problem and visualize the results.

Uploaded by

Sudeesh Sudevan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

16ED654 Optimization Techniques in Engineering

Matlab Practice problems

1.
Plot (T1-T2) Vs ‘q’ for following values of (T1-T2) for a cylindrical solid wall shown below:

(T1-T2) C 0 10 20 30 40 50 60 70 80

Where ‘k’ is the thermal conductivity. Copper tube (k=401 Watts / o C / m) of length L=300 cm
with an outer radius of r2 =5 cm and an inner radius of r1= 3 cm.

2.
Sound level in units of decibels (dB) is determined by:

Where ‘p’ is the sound pressure of the sound, and P0 = 20 × 10 -6 Pa is a reference sound pressure
(the sound pressure when dB). The sound pressure (p) in the city environment during the day
time at some specific time interval varies as given below
p (dB) 1×10-2 5×10-2 10×10-2 15×10-2 10×10-2 5×10-2 2×10-2
Plot Lp Vs (p/p0) for the data given.

3.
Each of the five columns in matrix A represents the four exam grades for a student in a MATLAB
programming class:
A = [ 89 97 55 72 95; 100 92 63 85 91 ; 82 96 71 91 82 ; 90 98 48 83 70 ]
a) Give a command that sorts each student’s grades and returns a matrix with the sorted
grades.
b) Give a command that computes the mean of each student’s grades and returns a vector
with the results.
c) Give a command that computes the median of each student’s grades and returns a
vector with the results.
d) Give a single command that returns the overall mean grade for all five students in the
course. Now, change your view of matrix A. Assume that each of the four rows in
matrix A represents the five exam grades of a student. Note: Each row represents a
student.
e) Give a command that sorts each student’s grades and returns a matrix with the sorted
grades.

1 of 5
f) Give a command that computes the mean of each student’s grades and returns a vector
with the results.
g) Give a command that computes the median of each student’s grades and returns a
vector with the results.
h) Give a single command that returns the overall mean grade for all five students in the
course.
4.
Determine friction factor, f for air flow through a smooth, thin tube. It is known that = fluid’s
density = 1.23 kg/m3,  = dynamic viscosity = 1.79 ×105 N . s m2, Diameter of the pipe, D = 0.005
m, V = velocity of the flow = 40 m/s and =roughness = 0.0015mm. Friction factor, f varies from
0.008 to 0.08. Estimate the friction factor using Matlab by using Swammee-Jain equation and
Colebrook equation (exact solution)

Approximate estimate of friction is provided by Swammee-Jain equation given by


1.325 1.325
f  2
= 2
     0.0000015
5.74   5.74  
ln  3.7 D  Re 0.9  
ln   0.9  
  
  3.7(0.005) 13743  
VD 1.23(40)0.005
Re = Reynolds Number=  
 1.79  10 5

To find exact solution:

For turbulent flow, Colebrook equation is used to calculate the friction factor is given as follows:
1  0.0000015 2.51 
g( f )   2.0log   =0
f  3.7(0.005) 13.743 f 
 
Hint: fzero command may be used for finding ‘f’ value.

Also plot the function g(f) for the ‘f, value in the range 0.008 to 0.08

5.
A projectile is launched at an angle ‘’ and speed of V0. The projectile’s travel time, travel, maximum
travel distance, xmax, and maximum height, hmax are given by:

V0 V2 V2
t travel  2 sin  0 , x max  2 0 sin  0 cos 0 , hmax  2 0 sin 2  0
g g g
Consider the case where V0=600 ft/s and  =54 . Define V0 and  as MATLAB variables and
calculate projectile’s travel time, travel, maximum travel distance, xmax, and maximum height, hmax
( g=32 ft/s2).

2 of 5
6.
The Moment Magnitude Scale (MMS), denoted, which is used to measure the size of an
earthquake, is given by:
2
MW  log 10 M 0  10.7
3

Where ‘M0’ is the magnitude of the seismic moment in dyne-cm (measure of the energy released
during an earthquake). Determine how many times more energy was released from the
earthquake in Sumatra, Indonesia (MW = 8.5), in 2007 than the earthquake in San Francisco,
California (MW = 7.9), in 1906. Also plot ‘MW Vs M0’ for the values of ‘MW ’ ranging from 1 to 9 with
an increment of 0.5.

7.
The coefficient of friction, μ, can be determined in an experiment by measuring the force F
required to move a mass m. When F is measured and m is known, the coefficient of friction can
be calculated by:
F
Coefficient of Friction ,   , (g = 9.81 m/s ).
2

mg
Results from measuring F in six tests are given in the table below.
Test 1 2 3 4 5 6
Mass, m, Kg 2 4 5 10 20 50
Force, F, N 12.5 23.5 30 61 117 294

Determine the coefficient of friction in each test, and the average from all tests. Use Matlab
functions for computing average value of ‘’. Plot a) m Vs  and b) F Vs 

8.
An aluminum sphere ( r = 0.2 cm) is dropped in a glass cylinder filled with glycerin. The velocity
of the sphere as a function of time can be modeled by the equation

Where V is the volume of the sphere, g=9.81 m/s2 is the gravitational acceleration, k=0.0018 is a
constant, and al = 2700 kg/m3 and gl = 1670 kg/m3 are the density of aluminum and glycerin,
respectively. Determine the velocity of the sphere for t = 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, and 0.35
s. Note that initially the velocity increases rapidly, but then, due to the resistance of the glycerin,
the velocity increases more gradually. Eventually the velocity approaches a limit that is called the
terminal velocity. Also plot, t Vs v.

3 of 5
9.
Solve the following system of three linear equations:

10.
Solve the following system of five linear equations:

11.
Write a program to accept a numerical value ‘x’ from ‘0’ to ‘100’ as input. The program computes
and display the corresponding letter grade as per the following table.
Letter Grade Range
A x  90
B 80  x  89
C 70  x  79
D 60  x  69
E 50  x  59
F x  50

12.
Plot the function y  10 1  e  x / 4  over the interval 0  x  xmax using a while loop to determine the
value of xmax = 9.8. Properly label the plot. The variable ‘y’ represents the force in Newtons, and
variable ‘x’ represents the time in seconds.

13.
Obtain the contour plots for the function z   x 2  2 xy  3 y 2 . for 0  x  6 and 0  y  6

14.
Plot the contours of the function f ( x, y )  8 x  x 2  12 y  4 y 2  2 xy
The values of ‘x’ varying from 0 and 6. The values of ‘y’ varying from -3 and +3

15.
Find the roots of the following polynomial equation:
(x7 + 2x4 - 5) × 3x

4 of 5
16.
Find the roots of the following polynomial equation:

x 5 + 5x 4 − 20x 2 − 10x + 2

17.
Solve the following LPP problem:
Minimize C = 2x1 + 10x2 + 8x3
Subject to x1 + x2 + x3 ≥ 6
x2 + 2x3 ≥ 8
−x1 + 2x2 + 2x3 ≥ 4
x1, x2, x3 ≥ 0

18.
Solve the following LPP problem:
Maximize z = x1 + 2 x2 + 3 x3
Subject to
x1 + x2 − x3 = 1
−2 x1 + x2 + 2 x3 ≥ −5
x1 − x2 ≤ 4
x2 + x3 ≤ 5
x1 ≥ 0 , x2 ≥ 0 .

19.
Solve the following unconstrained optimization problem with the starting point of ‘0.6’.
0. 5  0. 5 
Minimize f     1   2 1  2 

1  2
 1  
Find the optimum value of ‘’ and minimum function value. Also Plot the Iteration Vs function
value.

20.
Solve the following unconstrained optimization problem with the starting point of ‘r=10’.
  159  10 3  
Minimize f r   102r  2
  2r 2 
  r  
Find the optimum value of ‘r’ and minimum function value. Also Plot the Iteration Vs function
value.

$$$

5 of 5

You might also like