Quiz9_Solution

# Quiz9_Solution - fully call the function with the constants...

This preview shows page 1. Sign up to view the full content.

Quiz 9: Functions 2 Name: ASE 201 Write a function that calculates the range of an aircraft according to the Breguet Range Equation given by Range = ±² L D ³ Isp ln ² W i W f ³´ V for velocities, V , varying from V min to V max by an increment dV . Your function should: 1. Have V min, V max and dV as inputs 2. Have the constants LD (L/D), W ( W i /W f ) and Isp as global variables 3. Output an array of the calculated range values Note that you may not use array arithmetic for any of the calculations. Once you have written the function, write the code you would need in the command window to success-
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: fully call the function with the constants LD = 10, Isp = 1000 and W = 2 and the values V min = 100, V max = 200 and dV = 10. Solution: function [range] = quiz9(V_min,V_max,dv); global LD W Isp range = ; for V = V_min:dv:V_max r = (LD*Isp*log(W))*V; range = [range;r]; end end------------------------------------------>> global LD W Isp >> LD = 10; W = 2; Isp = 1000; >> range = quiz9(100,200,10)...
View Full Document

## This note was uploaded on 02/14/2010 for the course ASE 201 taught by Professor Hayes during the Spring '07 term at University of Texas.

Ask a homework question - tutors are online