Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please code this in Matlab. Task 1 GOAL: Develop repetition flow constructs in MATLAB to identify, at a given speed, the maximum road grade where
Please code this in Matlab.
Task 1 GOAL: Develop repetition flow constructs in MATLAB to identify, at a given speed, the maximum road grade where the horsepower required to overcome aerodynamic drag (Aerodynamic HP), vehicle weight (Rolling Resistance HP) and grade effects (Hill Climbing HP) equals 50% of the base vehicle engine horsepower. Thus, half of your engine power is being used to overcome losses. Below is the definition of each of the power losses: HP Required = Aerodynamic Horsepower (AHp) + Rolling Resistance (HP) + Hill Climbing (HP) Aerodynamic Horse Power: Asp= (1/2 pV3CpAf)/550 -> 1 HP = 550 ft-lbf/sec where: Af = Frontal area of vehicle (ft) p = Density of air = 0.0022633 lbs sec?/ft? (@ Sea Level & 68 F) V = Vehicle Speed (mph) -> Convert to ft/sec Cp = Drag Coefficient (unitless) Below are ways to estimate the other two horsepower components: Rolling Resistance HP (approximate) = 1.5 HP required for each 1000 lbs of vehicle weight Hill Climbing HP (approximate) = 6 HP required for each 1000 lbs of vehicle weight * grade It can be assumed that the road grade ranges from 0 to 12% and should be entered as the percent value not the decimal. Thus, 1% would be 1 not 0.01. Write a MATLAB script that outputs for a given speed the grade where the horsepower required equals 50% of the base engine horsepower. The user should be prompted to input the Engine HP, Drag Coefficient, Frontal Area, Vehicle Weight and Vehicle speed. A test case is presented on the next page along with sample input values for various vehicles. Note: The speed for each test case is constant and based on a user input, the only variable is the % grade value. Helpful MATLAB commands that integrate well with repetition loops are continue, break, and round. It is not necessary to use these, but details are available via the MATLAB help command. The intent of this assignment is to use loops to identify the hill grade. We are aware that there is an algebraic solution to this problem. You can use the algebraic solution to verify your results, but please ENED 1120 - HW 4.2 - Spring 2020 - 1 make sure you are using a loop to go through the iteration process. Many equations in engineering do not have algebraic solutions, so being able to solve through an iterative process is very beneficial. Possible Test Case: Sample Inputs for Prius Engine Hp = 134 Cd = 0.25 Af = 27.81 ft2 Vehicle weight = 3072 lbs What is the speed of the Vehicle? 30 mph Outputs: HP Required = 67.0 Maximum Grade (%) = 3.36 It is also interesting to test the above case for various speeds to see how the maximum road grade changes with vehicle speed. Input values for the Prius (already in the Test case) and other vehicles are shown in the table below: Make Model Year Engine HP Frontal Area (Ap) Vehicle Weight (lbs) Toyota Prius 2015 134 0.25 27.81 3072 Chevrolet Camaro 2002 310 0.34 26.40 3577 Jeep Wrangler 2005 190 0.58 33.77 3977 Task 1 GOAL: Develop repetition flow constructs in MATLAB to identify, at a given speed, the maximum road grade where the horsepower required to overcome aerodynamic drag (Aerodynamic HP), vehicle weight (Rolling Resistance HP) and grade effects (Hill Climbing HP) equals 50% of the base vehicle engine horsepower. Thus, half of your engine power is being used to overcome losses. Below is the definition of each of the power losses: HP Required = Aerodynamic Horsepower (AHp) + Rolling Resistance (HP) + Hill Climbing (HP) Aerodynamic Horse Power: Asp= (1/2 pV3CpAf)/550 -> 1 HP = 550 ft-lbf/sec where: Af = Frontal area of vehicle (ft) p = Density of air = 0.0022633 lbs sec?/ft? (@ Sea Level & 68 F) V = Vehicle Speed (mph) -> Convert to ft/sec Cp = Drag Coefficient (unitless) Below are ways to estimate the other two horsepower components: Rolling Resistance HP (approximate) = 1.5 HP required for each 1000 lbs of vehicle weight Hill Climbing HP (approximate) = 6 HP required for each 1000 lbs of vehicle weight * grade It can be assumed that the road grade ranges from 0 to 12% and should be entered as the percent value not the decimal. Thus, 1% would be 1 not 0.01. Write a MATLAB script that outputs for a given speed the grade where the horsepower required equals 50% of the base engine horsepower. The user should be prompted to input the Engine HP, Drag Coefficient, Frontal Area, Vehicle Weight and Vehicle speed. A test case is presented on the next page along with sample input values for various vehicles. Note: The speed for each test case is constant and based on a user input, the only variable is the % grade value. Helpful MATLAB commands that integrate well with repetition loops are continue, break, and round. It is not necessary to use these, but details are available via the MATLAB help command. The intent of this assignment is to use loops to identify the hill grade. We are aware that there is an algebraic solution to this problem. You can use the algebraic solution to verify your results, but please ENED 1120 - HW 4.2 - Spring 2020 - 1 make sure you are using a loop to go through the iteration process. Many equations in engineering do not have algebraic solutions, so being able to solve through an iterative process is very beneficial. Possible Test Case: Sample Inputs for Prius Engine Hp = 134 Cd = 0.25 Af = 27.81 ft2 Vehicle weight = 3072 lbs What is the speed of the Vehicle? 30 mph Outputs: HP Required = 67.0 Maximum Grade (%) = 3.36 It is also interesting to test the above case for various speeds to see how the maximum road grade changes with vehicle speed. Input values for the Prius (already in the Test case) and other vehicles are shown in the table below: Make Model Year Engine HP Frontal Area (Ap) Vehicle Weight (lbs) Toyota Prius 2015 134 0.25 27.81 3072 Chevrolet Camaro 2002 310 0.34 26.40 3577 Jeep Wrangler 2005 190 0.58 33.77 3977Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started