

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Computer Applications in Engineering and Construction Homework #2 Matlab Programming 1
Date distributed : 1.23. Date due : 1.30.2006 at 5:00 pm
Return your solution either in class or in my mail box (WERC Rm. 235H) by the date shown above. Please show all your work and follow the rules outlined in the course syllabus.
Write Matlab commands based on the standard order of operations using + - * / ^ () and the functions pi, exp, sqrt, log, and sin to evaluate the following expressions. Trust the order of operations rules and use a minimum number of parentheses. Use the Matlab interactive session to evaluate your expressions and use a hand-held calculator to check your results. Take the following parameter values when checking your results.
a = 15 b = ฯ c = exp (1) d =
t = 0. 0125
Example: y = (^12) bโ asin^2 (c) Answer: y = (12 - a)/b * sin(c)^2 evaluates in Matlab to y = -0.1611. Hand calculation agrees with Matlab.
c โ d^1 /a
(^2) +(cโd)โ 1 c t +โโ ln t
Do problem 1.10 on page 14 in Chapra (2005). Show all your work by hand.
Do problems 2.3, 2.4, and 2.6 on page 29 in Chapra (2005). Do the Matlab calculations either within a Matlab .m-file or a diary file. Turn in a copy of the file you create. For problem 2.6, turn in a copy of the graph as well. For each problem, use the minimum number of parentheses that are necessary. Do problem 2.8 on page 30 in Chapra (2005). Turn in a copy of your Matlab commands (diary of .m-file) and a print-out of the graph. Note that you can use hold on between two plotting commands in order to plot the second set of data on top of the first. Recall for all these problems that when you are manipulating vector data element-by- element, you must use the dot-operators: (.*, ./, and .^, and that addition, subtraction, and built-in Matlab functions do not require any special treatment.
Chapra, S. C. (2005), Applied Numerical Methods with MATLAB for Engineers and Scien- tists, First edn, McGraw Hill, Boston.