Assignment 1 - (Wind - Turbine)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

ASSIGNMENT 1

MONTE CARLO SIMULATION AND


MSPE ANALYSIS

Diksha Tiwari (S5210086)


Rashid Khan (S5152104)
Malav Patel (S5672581)
Assignment_1(ADDMS).rar

We will look at the Monte Carlo method to estimate the uncertainties in wind turbine energy
production.
We used MATLAB and Excel programs to solve the problem. In this example, we were provided
with the MC simulation scenario to solve the problem, as well as an Excel spreadsheet in which
we inserted our data to calculate the MSPE and its relative graph.

Task (1)
Our first problem requires us to "determine the mean value, standard deviation, and PDF of the
input data associated with wind speed."
The input wind speed data are presented in an Excel spreadsheet named Wind Velocity with 62,132
values(data): to estimate the mean and standard deviation, it is important to understand what statistical
distribution the data correspond to. The MATLAB program was used for this purpose.
The data from Wind Velocity excel sheet has been imported in MATLAB by a script called
nonzeros_velocity. We used this script to load wind speed data, which were then placed in vector v.
MATLAB can then generate a PDF (probability density function) using the distribution fitting
function.
Zero speed values are present in this file. To prevent measurement errors, all zero values can be deleted.
This has been done by nonzeros function.
V = nonzeros(v).
The wind speed data in the PDF looks like this

Figure 1 PDF for the wind velocity (V)

1
Task (2)

Fit the PDF of wind velocity v with at least 3 different distribution functions. Make a comparison
between the different fits, describe their characteristics, and select the one that approximates
better the distribution of v.

Having completed all the steps above, we can generate a PDF and look for a distribution that correlates
with our data. The different distribution functions that fit the PDF of wind velocity are which is clearly
seen in figure 2:
 Loglogistic
 Weibull
 lognormal

Figure 2 PDF for the wind velocity (V)

2
Comparison Table of Distribution with three different function and their characteristics

Distribution Log logistic Weibull Lognormal

Log Likehood -302372 -301766 -301602

Domain -Inf<y<Inf 0 < y < Inf 0 < y < Inf

Mean 67.8782 67.0846 70.1029

Variance 1598.3 1137.93 2288.54

Mu (log A
4.09611 0.00209335 75.7393 0.154106 4.06881 0.00219278
Parameter location) (Scale)
Estimate
Std. Err. Sigma
B
(log 0.3011 0.00101489 (Shape)
2.0881 0.0062621 4.06881 0.00219278
scale)
mu sigma A B mu sigma
Estimated covariance -6.08062e- -2.87806e-
mu 4.38212e-0 A 0.0237488 0.000313515 mu 4.80829e-06
of parameter 08 19
estimates -6.08062e- 1.02999e-
sigma B 2.08811 3.92139e-05 sigma 2.87806e-19 2.4042e-06
08 06

Figure 3 Weibull distribution applied to the wind velocity

3
Determined the data.
Where;
 v is the wind speed
 B is a shape parameter
 A is a scale parameter

The scale parameter A indicates how windy a wind location. While,the shape parameter B indicates
how peaked the wind distribution is(i.e. if the wind speeds tend to be very close to a certain value, the
distribution will have a high B value and be very peaked). The main limitation of the Weibull density
function is that it does not accurately represent the probabilities of observing zero or very low wind
speeds .However, for the purpose of estimating wind potential for the commercial use of wind turbines,
this is usually unnecessary as the energies available at low wind speeds are negligible and below the
operating range of wind turbines. Also, lognormal and loglogistic does not fit the data well as clearly
seen in figure 2.
Past research has proven that the Weibull distribution function fits a wide collection of recorded wind
data. And the precision of the Weibull distribution is adequate.

Weibull Analysis is an effective method of determining reliability characteristics and trends of a


population using a relatively small sample size of data. As seen from the figure 2 weibull pdf fits the
best from rest of the fits. Also, from the characteristics Weibull has the less variance and appropriate
mean when compared with the other pdf.

Task (3)

Run MC simulations to estimate the electric power P generated by the wind turbine. Consider
the inputs reported in the table above with three different numbers of samples (10, 103, 105). To
generate random values of v, use the best PDF fit selected in #2.

For each run of MC, compute the power mean μP and standard deviation σP, and plot the
corresponding PDFs. Analyzing the result to determine which number of samples are the
optimal for the MC simulation, considering both accuracy and computational time.

Solution: In the second task we must determine the average power deviation of the turbine. In this
case we must run the Monte Carlo simulator 3 times (10,1000 and 100000). To obtain the output data
we have written the code of the output function consisting of wind speed and air density as input
parameters and area, efficiency as unchangeable parameters in MC.m script.

The first stochastic variable input is air density rho, which has (μ=1.226, σ=0.02) The second stochastic
input variable v is the wind speed, taken from the Weibull distribution that we chose in the second
task. From this data, the program generates random parameters for wind density and wind speed, which
we use to calculate the power value.

4
According to given group data:

Cp = 0.42
A = 100 m2

Formula used: P = Cp* ½*rho*A*v^3

Where:

 cp is the coefficient of performance [-]


 ρ is the air density [kg/m3]
 A is the area swept by the turbine rotor blades [m2]
 v is the wind velocity [m/s]

For generating random values of v: we saved the Weibull fit object into the workspace from the
Distribution fitter app used it to generate random wind data with the MATLAB function random.
We used “random (Weibull)” function in command Window.

Ans 35.4506

A PDF with the mean value (A) and the standard deviation (B) relating to the wind turbine
power obtained with 10 samples is given below:

Figure 4 PDF for the power turbine with 10 number of samplings.

5
P 40.368540905837340
Mean P 46.721004864076440
Sigma P 3.674902798985640

A PDF with the mean value (A) and the standard deviation (B) relating to the wind turbine
power obtained with 10^3 samples is given below:

Figure 5: PDF for the power turbine with 10^3 number of sampling.

P 46.815305325196746
Mean P 47.570906701605280K
Sigma P 3.058181547693049

A PDF with the mean value (A) and the standard deviation (B) relating to the wind turbine
power obtained with 10^5 samples is given below:

6
Figure 6: PDF for the power turbine with 10^5 number of sampling.

P 53.146152510731240
Mean P 47.503650391130330
Sigma P 3.109905434261171

Comparison Table of The Power Turbine With 10, 10^3 and 10^5 number of sampling

10 number of 10^3 number of 10^5 Number of


Sampling Sampling sampling
P 40.368540905837340 46.815305325196746 53.146152510731240
Mean P 46.721004864076440 47.570906701605280K 47.503650391130330
Sigma P 3.674902798985640 3.058181547693049 3.109905434261171

We can see clearly that with 10 samples the distribution of values is probably not very well defined
compared to the other two cases.
With Tic Toc function in MC.m script, we get to know the elapsed time with every number of samples.
Therefore, elapsed time for 10^3 samples was 0.021949 seconds whereas 10^5 samples it was
1.570439 seconds.
Since mean_P is nearly same from 10^3 and 10^5 samples. But computational time of 10^3 samples
is less when compared with 10^5 samples. Therefore, certainly f=10^5 is the one most precise.

7
Generally using more samples will lead to a more accurate and precise estimate,but it will also require
more computational resources.
However f=10^3 is accurate enough to determine a reasonably good statistical distribution after
comparing the computation time and accuracy.

Task (4)

Considering only the optimal number of samples determined in #3, fit the corresponding PDF of
power P with at least 3 different distribution functions. Make a comparison between the different
fits, describe their characteristics, and select the one that approximates better the distribution
of P.

PDF of power P with at least 3 different distribution functions that fits well are as clearly seen
from the figure 7 :
 Normal
 Log_Logistic
 Burr
After selecting the 10^3 samples from task 3.

Figure 7: PDF for the power turbine with 10^3 number of sampling with the 3 different
functions that fits the PDF

8
Comparison Table of Normal, Log Logistic and Burr Distribution with their characteristics

Distribution Normal Log-Logistic Burr

Log Likelihood -2558.01 -2565.96 -2563.59

Domain -Inf < y < Inf 0 < y < Inf 0 < y < Inf

Mean 47.5397 47.5852 47.5256

Variance 9.76831 10.5693 10.2823

Mu 47.5397 0.0988348 3.8602 0.0020757 Alpha 48.3388 0.451582


Paramete
r Estimate C 24.2534 1.1994
Std. Err. Sigm
3.12543 0.0699392 0.037562 0.000984494
a k 1.35365 0.199017

mu sigma mu sigma Alpha C K


A
l
Estimated -3.90909e- -1.99885e- -
mu 0.00976831 mu 4.30855e-06 p 0.203926 0.0876222
covariance of 17 08 0.456882
h
parameter a
estimates -
c 1.43856 -0.203547
-3.90909e- sig 9.69228e- 0.456882
sigma 0.00489149 -1.99885e-08
17 ma 07 0.087622 -
k 0.0396077
2 0.203547

After comparing with all three fits, selecting the Normal pdf since it has less variance and it best fits
the data when compared with the other Distributions.

Figure 8 : Normal distribution fits well the PDF of 10^3 no. of samples

9
Referring to the MC simulations carried out in #3 to estimate the power P generated by the wind
turbine, perform a mean square pure error (MSPE) analysis. Discuss the results obtained by this
analysis to verify if the number of samples selected in #3 was evaluated correctly.
In conclusion, Monte Carlo methods have been used in this exercise, and the minimum number of
runs needed to get a good estimate of the mean and the standard deviation also it has less variance than
the other pdfs which has been determined using MSPE

MSPE analysis is performed using MSPE_2022 excel.

Figure 9 :MSPE Analysis of 10^3 no. of samples

As clearly seen from the fig that 10^3 number of samples AVG_MSPE and STD _MSPE does not
stabilize so 10^3 number of samples is not adequate to perform MSPE analysis. So 10^5 number of
samples is more precise and suited for this monte Carlo simulations.

AVG_MSPE and STD _MSPE, these two parameters, taken together, allow choosing the numbers of
runs needed to obtain an unbiased evaluation of the experimental error affecting the objective function.
As it is well known, the larger are the samples; the better is the description of the population. the two
MSPEs evolving in the runs would crash on the X-axis (MSPE = 0).

10
MSPE Analysis
0.0080
0.0075
0.0070
0.0065
0.0060
0.0055
0.0050
0.0045
0.0040
0.0035 AVG
0.0030 STD
0.0025
0.0020
0.0015
0.0010
0.0005
0.0000

number of samples

Figure 10 :MSPE Analysis of 10^5 no. of samples

But it’s obvious from the above fig for samples 10^5.
It is clearly seen that after 20000 samples both the parameters AVG_MSPE and STD_MSPE crashes
to zero. That means for N (number of samples)> 20000, both MSPE are almost negligible.

11

You might also like