MATLAB for Engineers, 5th Edition Solution Manual
- Electrical Engineering & Electronics
- 606 pages
- Shared May 2025
Unlock the answers to every textbook problem with MATLAB for Engineers, 5th Edition Solution Manual, making studying more efficient and effective.
Preview 16 of 606 pages
See the first 16 pages exactly as they appear in the document.
Page 1 Read page 1 as text
Example 1.1 The text book version of this problem was performed in the command window. This version of the problem is solved using a Live Script E = 385e24 %Define the rate of energy consumption in J/sec E = 3.85e+26 E = E*366*24 %Find the energy consumed in one day, in J E = 3.3818e+30 c = 3.0e8 % Define the speed of light in m/s c = 300000000 m = E/c^2 % Calculate the mass consumed using Einstein's equation m = 3.7576e+13
Page 2 Page 3 Read page 3 as text
EXAMPLE 2.1 SCALAR OPERATIONS Wind tunnels (see Figure 2.6) play an important role in our study of the behavior of high-performance aircraft. In order to interpret wind tunnel data, engineers need to understand how gases behave. The basic equation describing the properties of gases is the ideal gas law, a relationship studied in detail in freshman chemistry classes. The law states that PV = nRT where P = pressure in kPa, V = volume in m3, n = number of kmoles of gas in the sample, R = ideal gas constant, 8.314 kPa m3/kmol K, and T = temperature, expressed in kelvins (K). In addition, we know that the number of kmoles of gas is equal to the mass of the gas divided by the molar mass (also known as the molecular weight) or n = m/MW where m = mass in kg and MW = molar mass in kg/kmol. Different units can be used in the equations if the value of R is changed accordingly. Figure 2.6 Wind tunnels are used to test aircraft designs. (Louis Bencze/Getty Images Inc., Stone Allstock.) Now suppose you know that the volume of air in the wind tunnel is 1000 m3. Before the wind tunnel is turned on, the temperature of the air is 300 K, and the pressure is 100 kPa. The average molar mass (molecular weight) of air is approximately 29 kg/kmol. Find the mass of the air in the wind tunnel. To solve this problem, use the following problem-solving methodology: 1. State the Problem When you solve a problem, it is a good idea to restate it in your own words: Find the mass of air in a wind tunnel. 2. Describe the Input and Output Input Volume V = 1000 m3 Temperature T = 300 K Pressure P = 100 kPa Molecular weight MW = 29 kg/kmol
Page 4 Read page 4 as text
Gas constant R = 8.314 kPa m3/kmol K Output Mass m = ? kg 3. Develop a Hand Example Working the problem by hand (or with a calculator) allows you to outline an algorithm, which you can translate to MATLAB® code later. You should choose simple data that make it easy to check your work. In this problem, we know two equations relating the data: PV = nRT ideal gas law n = m / MW relationship between mass and moles Solve the ideal gas law for n , and plug in the given values: n = PV/RT = 40.0930 kmol Convert moles to mass by solving the conversion equation for the mass m and plugging in the values: m = n × MW = 40.0930 kmol × 29 kg/mol m = 1162.70 kg 4. Develop a MATLAB® Solution First, clear the screen and memory: clear, clc Now perform the following calculations in the command window: P = 100 P = 100 T = 300 T = 300 V = 1000 V = 1000 MW = 29 MW = 29 R = 8.314
Page 5 Read page 5 as text
R = 8.314 n = (P*V)/(R*T) n = 40.093 m = n*MW m = 1162.7 There are several things you should notice about this MATLAB® solution. First, because no semicolons were used to suppress the output, the values of the variables are repeated after each assignment statement. Notice also the use of parentheses in the calculation of n . They are necessary in the denominator, but not in the numerator. However, using parentheses in both makes the code easier to read. 5. Test the Solution In this case, comparing the result with that obtained by hand is sufficient. More complicated problems solved in MATLAB® should use a variety of input data, to confirm that your solution works in a variety of cases. The MATLAB® screen used to solve this problem is shown in Figure 2.7.
Page 6 Read page 6 as text
Figure 2.7 MATLAB®screen used to solve the ideal gas problem. Notice that the variables defined in the command window are listed in the workspace window. Notice also that the command history lists the commands executed in the command window. If you were to scroll up in the command history window, you would see commands from previous MATLAB® sessions. All of these commands are available for you to move to the command window.
Page 7 Read page 7 as text
Example 2.2 clear, clc lbf = [0:100:1000]; N = lbf * 4.44822; [lbf',N'] ans = 1.0e+03 * 0 0 0.1000 0.4448 0.2000 0.8896 0.3000 1.3345 0.4000 1.7793 0.5000 2.2241 0.6000 2.6689 0.7000 3.1138 0.8000 3.5586 0.9000 4.0034
Page 8 Read page 8 as text
Example 2.3 Calculating Drag clear,clc % Find the drag coefficient drag = 20000; density = 0.000001; velocity = 100*0.4470; area = 1; cd = drag*2/(density*velocity^2*area) cd = 2.0019e+07 Find drag for a range of velocities velocity = 0:20:200; velocity = 100*velocity; drag = cd*density*velocity.^2*area/2; my_table = [velocity',drag'] my_table = 1.0e+09 * 0 0 0.0000 0.0400 0.0000 0.1602 0.0000 0.3603 0.0000 0.6406 0.0000 1.0010 0.0000 1.4414 0.0000 1.9619 0.0000 2.5624 0.0000 3.2431
Page 9 Read page 9 as text
clear,clc % Example 2.4 % Find the possible acceleration of the Voyager 1 % and Voyager 2 Spacecraft using the on board power % generator format shortg mass = 721.9; % mass in kg power = 335; % power in watts velocity = [3.5 3.15]; % velocity in AU/year % change the velocity to m/sec velocity = velocity*150e9/365/24/3600 % Calculate the acceleration acceleration = power./(mass.*velocity)
Page 10 Read page 10 as text
Example 3.1 Using the Clausius Clapeyron Equation, find the saturation vapor pressure for water at different temperatures % clear,clc TempF = [-60:10:120]; %Define temp matrix in F TempK = (TempF + 459.6)/1.8; %Convert temp to K Delta_H = 2.45e6; %Define latent heat of vaporization R_air = 461; %Define ideal gas constant for air % Calculate the Vapor Pressures Vapor_Pressure = 6.11*exp((Delta_H/R_air)*(1/273 - 1./TempK)); Display the results in a table my_results = [TempF',Vapor_Pressure'] my_results = -60 0.06979 -50 0.12521 -40 0.21845 -30 0.37138 -20 0.61633 -10 1 0 1.5888 10 2.4749 20 3.7847 30 5.688 40 8.4102 50 12.246 60 17.575 70 24.881 80 34.773 90 48.01 100 65.526 110 88.461 120 118.19
Page 11 Read page 11 as text
Example 3_2 clear, clc % Define the input Force =[100, 200, 50]; theta = [-90, +90, +30]; %convert angles to radians theta = theta*pi/180; %Find the x components ForceX = Force.*cos(theta); %Sum the x components ForceX_total = sum(ForceX); %Find and sum the y components in the same step ForceY_total = sum(Force.*sin(theta)); %Find the resulting angle in radians result_angle = atan(ForceY_total/ForceX_total); %Find the resulting angle in degrees result_degrees = result_angle*180/pi result_degrees = 70.893 %Find the magnitude of the resulting force Force_total = ForceX_total/cos(result_angle) Force_total = 132.29
Page 12 Read page 12 as text
Example 3.3 - Weather Data In this example we will find the total precipitation for each month, and for the entire year, using a data file We will also find the month and day on which the precipitation was the maximum clc load weatherdata %Find the sum of each row, which is the sum for each month monthly_total=sum(weatherdata,2,'omitnan')/100; monthly_total' ans = 8.48 5.15 3.85 4.74 3.21 6.33 3.17 2.78 2.49 5.66 4.68 2.86 %Find the annual total yearly_total = sum(monthly_total) yearly_total = 53.4 %Find the annual maximum, and the day on which it occurs [max_precip,month]=max(max(weatherdata,[],2,'omitnan')) max_precip = 272 month = 1 %Find the annual maximum, and the month in which it occurs [max_precip,day]=max(max(weatherdata,[],1,'omitnan')) max_precip = 272 day = 3
Page 13 Read page 13 as text
Example 3.4 Climatological Data In this example we find the mean daily precipitation for each month and the mean daily precipitation for the year. We also find the standard deviation of the data clear, clc % Changing the format to shortg, often makes the output % easier to read format shortg % By saving the variable weatherdata from the last example, it is % available to use in this problem load weatherdata Average_daily_precip_monthly = mean(weatherdata','omitnan') Average_daily_precip_monthly = 27.355 18.393 12.419 15.8 10.355 21.1 10.226 8.9677 8.3 18.258 15.6 9.2258 Average_daily_precip_yearly = mean(weatherdata(:),'omitnan') Average_daily_precip_yearly = 14.63 Now calculate the standard deviation Monthly_Stdeviation = std(weatherdata','omitnan') Monthly_Stdeviation = 63.779 36.499 20.401 49.73 26.648 51.176 30.626 30.77 27.447 42.079 54.174 21.012 Yearly_Stdeviation = std(weatherdata(:),'omitnan') Yearly_Stdeviation = 39.948
Page 14 Read page 14 as text
Example 3.5 Noise load handel %Load the music data file sound(y,Fs) %Play the music data file pause %Pause to listen to the music % Be sure to hit enter to continue after playing the music % Add random noise noise=randn(length(y),1)*0.1; sound(y+noise,Fs) % Plot the first 200 data points in each file t=1:length(y); noisy=y+noise; plot(t(1,1:200),y(1:200,1),t(1,1:200),y(1:200,1)+noisy(1:200,1),':') title('Handel''s Messiah') xlabel('Element Number in Music Array') ylabel('Frequency')
Page 15 Read page 15 as text
Example 4.1 In this example we extract data from a large matrix, and use the data analysis functions to find the mean high and mean low temperatures for the year, and to find the high temperature and the low temperature for the year clear, clc load the data matrix from a file load asheville_1999 extract the mean high temperatures from the large matrix mean_max = asheville_1999(1:12,2); % extract the mean low temperatures from the large matrix mean_min = asheville_1999(1:12,3); % Calculate the annual means annual_mean_max = mean(mean_max) annual_mean_max = 68.05 annual_mean_min = mean(mean_min) annual_mean_min = 46.325 % extract the high and low temperatures from the large matrix high_temp = asheville_1999(1:12,8); low_temp = asheville_1999(1:12,10); % Find the max and min temperature for the year max_high = max(high_temp) max_high = 96 min_low = min(low_temp) min_low = 9 % Create an new matrix with just the temperature information new_table =[mean_max, mean_min, high_temp, low_temp] new_table = 51.4 31.5 78 9 52.6 32.1 66 16 52.7 32.5 76 22 70.1 48.2 83 34 75 51.5 83 40 80.2 60.9 90 50 85.7 64.9 96 56 86.4 63 94 54 79.1 54.6 91 39 67.6 45.5 78 28 62.2 40.7 76 26
Page 16 Read page 16 as text
53.6 30.5 69 15
590 more pages in the full document
Unlock it once and it stays in your library, ready to chat with or turn into flashcards.
Unlock the full documentMore Electrical Engineering & Electronics study materials
See all
Textbook GuidesSolution Manual for Microwave Circuit Design A Practical Approach Using ADS, 1st Edition
Electrical Engineering & Electronics
121 pages154downloadsFeb 2025
Exam GuidesPower System Analysis And Design, 6th Edition Test Bank
Electrical Engineering & Electronics
40 pages132downloadsFeb 2025
Textbook GuidesSolution Manual For Electronics Fundamentals: A Systems Approach, 1st Edition
Electrical Engineering & Electronics
278 pages93downloadsFeb 2025
Textbook GuidesSolution Manual for Fundamentals of Electromagnetics with Engineering Applications, 1st Edition
Electrical Engineering & Electronics
56 pagesMay 2025
DocumentHW4_Solution
Electrical Engineering & Electronics
17 pagesFeb 2026
Class NotesElectronic Commerce, 12th Edition Class Notes
Electrical Engineering & Electronics
196 pagesMay 2025
Textbook GuidesElectronic Commerce, 12th Edition Solution Manual
Electrical Engineering & Electronics
134 pagesMay 2025
Solved AssignmentsBridge Rectifier and its Analysis: A Study of Output Voltage and Ripple Effects
Electrical Engineering & Electronics
3 pagesMay 2025
Study this document with CramX
Once it is in your library, every tool can work from it.

