Professional Documents
Culture Documents
Problem Statement:
= 0,1,2,3, ,
Write a subroutine that assumes N = 200 and then populates an Excel sheet with values of L and K in
columns A and B respectively.
Verification: When the subroutine has been run, the top left corner of your Excel sheet should look like
this:
2.
Problem Statement:
The square of the sine function can be represented by the following series approximation:
$
1 ! 2"!
2 2
+
=
sin =
2#!
4!
6!
%!
Write a user-defined function in VBA that accepts as an input and outputs the value of sin after the
series approximation converges sufficiently.
3.
Problem Statement:
A truck leasing company owns 12 delivery vans that are leased to several operators. Maintenance hours
for each truck are allocated using a maintenance rate multiplied by the total number of hours
accumulated by the entire fleet. The maintenance rate for each truck is determined from its percentage
of the total fleet hours and the following table:
Percent of Hours Maintenance Rate
0.00 - 9.99
0.02
10.00 - 24.99
0.04
25.00 - 100.00
0.06
The ID number and Hours for each truck are given by the following table:
ID
002
009
012
016
025
036
037
040
043
044
045
046
Hours
61
83
101
55
410
97
66
70
122
136
23
142
Record a macro or write a subroutine that will use the data given to convert each trucks hours to a
percentage of the total fleet hours, and compute its maintenance hours using the maintenance rate.
Round the calculated maintenance hours to the nearest hour to ensure that each truck is allotted a
minimum of one hour of maintenance each month. The results data and the results should be displayed
side by side in the original Excel sheet. The macro/subroutine should be recorded/written so that new
data can be recalculated each month with the push of a button.
Verification: After the macro/subroutine is executed, your Excel sheet should look like this:
4.
Problem Statement:
Raphson method is useful for finding roots of functions where the derivative is easily
The Newton-Raphson
derived. The method is iterative and will converge quickly. The Newton
Newton-Raphson
Raphson method can be viewed
as a fixed point iterative method where the following equation applies:
,
= ,
+,
+ - ,
Write a subroutine
broutine that uses the Newton
Newton-Raphson
Raphson Method to find a root of the following polynomial
and displays the root in a message box.
+
+ = 2 11.7 + 17.7 5
Verification: When your subroutine has executed, your message box should display one of the
th three
results below, depending on your initial guess.
5.
Problem Statement:
Write a user-defined function that accepts 4 inputs (a,b,c, and opt) where a,b,and c correspond to the
lengths of a right triangle and opt corresponds to an angle option (A,B,or C) chosen by the user. The
function should use the lengths of the sides of the triangle to calculate the specified angle in degrees.
Use the diagram below as a guide:
Expected Results
36.87
58.99
90
6.
Problem Statement:
You are designing a spherical tank to hold water for a small village in a developing country. The volume
of liquid it can hold can be computed as
/ = '
132 3
3
Where / = Volume (m3), = depth of water in tank (m), and 2 = the tank radius (m)
Write a user-defined function that accepts 3 values (R, a, b) where R is the tank radius. The values a and
b should be used as the bounds of a bisection method to find the value of h that satisfies the equation
where V = 30 m3.
Verification: Test your function with the input of R=3.5, a = 0, and b = 7. Your function should output a
value of 1.816 meters for the depth of the water.
7.
Problem Statement:
The resistance to flow in conduits and pipes is parameterized by a dimensionless number called the
friction factor. For turbulent flow, the Colebrook equation provides a means to calculate the friction
factor
1
4+
= 2.0 log 8
9
2.51
+
<
3.7: 2;4+
Write a user defined function that accepts 9, D, and Re (roughness factor, diameter, and Reynolds
Number respectively) as inputs and calculates the friction factor f.
8.
Problem Statement:
A manufacturer of office furniture makes conference tables in two styles, Premier and Executive. Each
style is available in either walnut or oak. Matching chairs are also manufactured in both styles, in either
walnut or oak.
The material and labor requirements for each product are given below. Assume there is no distinction
between walnut and oak in these requirements.
Premier Table
100
9
Executive Table
140
12
Premier Chair
16
4
Executive Chair
20
5
Premier Chair
$200
$180
Executive Chair
$250
$220
Walnut
Oak
Premier Table
$1200
$1000
Executive Table
$1500
$1200
Furniture-grade walnut costs $5 per square foot, and oak costs $4. Labor costs $18 per hour. Only 3000
hours of labor are available per week.
Develop a linear optimization model to determine the most profitable weekly production schedule using
Excel and Solver. (Could you write a VBA subroutine to do the same thing?)
Verification: The final answer is that you should make 332 Walnut Premier Tables and 1 Walnut
Executive Table for a maximum profit of $179,200 / week.
9.
Problem Statement:
You buy a $25,000 piece of equipment for nothing down and $5,500 per year for 6 years. What interest
rate are you paying? The formula relating present worth P, annual payments A, number of years n, and
interest rate i is
A=B
=1 + =
1 + = 1
Write a subroutine in VBA to solve this problem using any technique desired. Do not use any Excel
spreadsheets, only VBA coding. The result should be displayed in a message box.
1
2
2
1
50
2
1
0
3
75
Hours available
3
3
1
2
100
4
0.5
4
5
80
30
40
45
Determine how many units of each product the company should make to maximize its total profit using
Solver in Excel. (Hint: Product quantities must be positive integers).
Verification: There are two solutions to this problem where the maximum profit is $1425:
# of Product 1 = 0
# of Product 2 = 11
# of Product 3 = 6
# of Product 4 = 0
# of Product 1 = 2
# of Product 2 = 11
# of Product 3 = 5
# of Product 4 = 0
D D cos60 + D cos60 + D = 0
D sin60 + D sin60 = 0
D D cos60 = 0
D sin60 + 2 = 0
The objective is to determine the internal tensile forces (D! through DG ) and reactive forces (2! , 2 , and
2 ) when the external forces (H! and H ) and their angles (I! and I ) are specified.
Use any method desired to solve for the unknown forces assuming:
H! = 10,000 JKL
H = 7,000 JKL
I! = 75M
I = 45M
Verification:
T1
T2
T3
T4
T5
T6
T7
R1
R2
R3
-13563
-756.428
2409.453
-2409.45
1653.018
-3306.04
-5398.04
7537.931
11745.91
2863.111
From this diagram, the following mass balance equations can be derived (left), and the following
parameters are given (right):
N, = 180 VW QJ
S, = 710 VW QJ
P, = 740 VW QJ
T, = 3850 VW QJ
U, = 4720 VW QJ
N, = ONP QR
S, = OSP QS
ONP QN + OSP QS + P, = OPT QP
OPT QP + T, = OTU QT
OTU + U, = OUM QU
ONP = 67 V
OSP = 36 V
OPT = 161 V
OTU = 182 V
OUM = 212 V
Determine the concentration of chloride (QX ) exiting each of the Great Lakes by any method desired
using Excel or VBA.
Verification: The final result for concentrations of chloride that should be obtained:
Cs
Cm
CH
Ce
Co
2.69
19.72
10.12
30.11
48.11
B
Heat Flux (q)
0.1
5.32
7.8
8
8.03
6.27
3.54
Time (hours)
0
1
2
3
4
5
6
7
8
C
Heat Flux (q)
0.1
9.7
2.54
10.8
5.4
5.5
5.4
5.6
3.2
Y = 0.45 Z [A\]
_
>`Jab=;?
>V acb
A 1=3 >V
Y 1=3 >`Jab=;?
Verification:
A = 17500050 calories
B = 13059900 calories
C = 52119450 calories
Time (hours)
0
2
4
6
8
10
12
14
16
18
20
\d
= 4 0.3d 0.1d!
\
= d, + +, , d,