The electricity generated by wind turbines annually in kilowatt-hours per year is given in a file. The amount of electricity is determined by, among other factors, the diameter of the turbine blade (in feet) and the wind velocity in mph. The file stores on each line the blade diameter, wind velocity, and the approximate electricity generated for the year. For example,

5 5 406
5 10 3250
5 15 10970
5 20 26000
10 5 1625
10 10 13000
10 15 43875
10 20 104005

Required:
Determine how to graphically display this data.

Respuesta :

Answer:

Steps:

1. Create a text file that contains blade diameter (in feet), wind velocity (in mph) and the approximate electricity generated for the year

2.  load the data file for example, in matlab, use ('fileame.txt') to load the file

3. create variables from each column of your data

  for example, in matlab,  

     x=t{1}

     y=t{2}

4. plot the wind velocity and electricity generated.

   plot(x, y)

5. Label the individual axis and name the graph title.

    title('Graph of wind velocity vs approximate electricity generated for the year')

     xlabel('wind velocity')

     ylabel('approximate electricity generated for the year')

Answer:

This problem is solved using Matlab, code along with step-by-step explanation and output results are provided below.

Matlab Code with Explanation:

% load the .txt file named data in which data is stored and store the data in a variable D

D=load('data.txt')  

% the 2nd column of data contains speed of the wind turbine so store it in a variable named speed

speed=D(:,2);

% the first 4 data points are for 5 feet blade diameter so extract and store them in variable speed_5

speed_5=speed(1:4);

% from the 5th data point to the end of vector contains data for 10 feet blade diameter so extract and store them in variable speed_10.

speed_10=speed(5:end);

% the 3rd column of data contains generated electricity of the wind turbine so store it in a variable named kwh

kwh=D(:,3);

% the first 4 data points are for 5 feet blade diameter so extract and store them in variable kwh_5

kwh_5=kwh(1:4);

% from the 5th data point to the end of vector contains data for 10 feet blade diameter so extract and store them in variable kwh_10.

kwh_10=kwh(5:end);

% Plot the speed _5 on x-axis and corresponding kwh_5 on y-axis

plot(speed_5,kwh_5,'LineWidth',2)

% hold on means we want to plot another curve in the same graph so wait

hold on

% Plot the speed _10 on x-axis and corresponding kwh_10 on y-axis

plot(speed_10,kwh_10,'LineWidth',2)

% legend command provides visual aid to distinguish between the two curves

legend('5 feet blade','10 feet blade')

% set the title of the graph, x-axis and y-axis labels

title('Generated Electricty Vs Wind speed')

xlabel('Wind speed (mph)')

ylabel('Generated Electricity (kWh)')

Output:

As you can see in the attached graph, 2 curves are being plotted one for 5 feet blade diameter and 2nd for 10 feet blade diameter of the wind turbine.

The generated electricity corresponding to 10 feet blade diameter is way more than the 5 feet blade diameter.

Ver imagen nafeesahmed