Question about a problem

I have a textfile which I've already unpacked into a vector.
Each value (units: lbs) in the textfile is a minute of fuel consumption of a airplane's flight. So as an example, the 50th value (let's the value is 325 lbs) is the 50th minute value, and the plane's total consumption from beginning of takeoff to 50th minute is 325 lbs.
Now here is the question being asked.
I am asked to find how long the takeoff portion of the flight lasts. The following is the information I am given.
I am told to use the first half of the dataset.
FirstHalf = A(1:length(A)/2,:)
Next, I have found the average total consumption rate (simply took the last value in the text file/divided by total minutes). I am told the average total consumption rate is 1.5 times the average rate at takeoff. So simple maths gives us AvgTakeoff = AvgTotal/1.5. Now I have the average takeoff rate (in units of lbs/min), but I need to find out how long does the takeoff last (in minutes)? Can i do this using For Loops or If statements?

2 个评论

This is inconsistent: "Each value (units: lbs) in the textfile is a minute of fuel consumption of a airplane's flight. So as an example, the 50th value (let's the value is 325 lbs) is the 50th minute value, and the plane's total consumption from beginning of takeoff to 50th minute is 325 lbs."
You said the value is the fuel consumption during that minute of flight. So the value at element 50 of 325 would mean that during minute #50, 325 lbs of fuel were used. But then you say that 325 means it was the "total consumption from beginning" of the flight. So, which is it? Consumption during only that minute, or total consumption since the flight started? You can't have it both ways.
It's the total consumption since the flight started.

请先登录,再进行评论。

回答(2 个)

Walter Roberson
Walter Roberson 2018-10-18
编辑:Walter Roberson 2018-10-18

0 个投票

size() will tell you how many entries are in FirstHalf, which in turn will tell you how many minutes it lasted.
Or is the question about looking through the data to find the point at which FirstHalf >= AvgTakeoff ?

2 个评论

Your first response is exactly what I thought but I suppose it's not what is being asked.
I believe it is the second part. Here is the exact question:
The rate of fuel consumption is much higher when the aircraft is taking off and climbing
to cruising altitude. Assuming the fuel flow rate is at least 1.5 times the average rate
during takeoff and climb, how many minutes did the takeoff and climb phase of the flight
last? You will want to restrict this search to the first half of the dataset.
And we know the fuel flow rate and average takeoff rate.
diff() the total-fuel-used readings to figure out how much fuel was used in that minute. Find the first location where that is less than 1.5 times the average over the whole flight; that will be the minute at which the climb is already ended.

请先登录,再进行评论。

Image Analyst
Image Analyst 2018-10-19

0 个投票

Since part of the first half is take-off, you don't want to include that in the average fuel consumption. You want to take, like the average of the last 10% of first half, something like this

instantaneousFuelConsumption = diff(FirstHalf);
index = 0.9 * length(instantaneousFuelConsumption);
averageCruisingConsumption = mean(instantaneousFuelConsumption(index:end));

Now you need to find out which elements of instantaneousFuelConsumption are more than 1.5 times averageCruisingConsumption. Easy - give it a try.

2 个评论

Can this be done using 'if' statements or for loops?
Yes, it could be, if you didn't want to use find() like a typical MATLAB programmer would.

请先登录,再进行评论。

类别

提问:

2018-10-18

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by