Lab - Lab Activity 1: Implement the Weibull Distribution in...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Page 1 of 5 Lab Activity 1: Implement the Weibull Distribution in Java The Weibull functions are functions not only of wind speed x , but also of their parameters α and β . Given an input x , we need to calculate the probability density f , ( x ) and its integral F ( x ). Each function can be broken down into more manageable pieces as illustrated below. Probability Density: PDF Cumulative Distribution: CDF f ! , " ( x ) = # x $ % ( ) * 1 # e * ( x / ) F , ( x ) = 1 # e # ( x / ) f , ( x ) = # x $ % ( ) * 1 # e * ( x / ) Complete this program to compute the Weibull density function f ( x ). public class WeibullDemo { public static void main ( String[] args ) { double alpha = 2, beta = 1; //Print out some values of f(x) as x ranges from 0 to 4 in steps of 0.1 for(int n = 0; n<=40; n++) { double x = ………………………………………………………………………… ; //1. Calculate x = n/10 double y = ………………………………………………………………………… ; //2. Calculate f(x). System.out.printf( "For x = %.2f, f(x) = %.9f\n", x,y ); } // end of for block } // end main method public static double weibullPDF (double x, double alpha, double beta) { double r = x/beta; double term1 = ………………………………………………………………………… ; //3. Calculate term1. double term2 = ………………………………………………………………………… ;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/17/2012 for the course ECE 203 taught by Professor Robincarr during the Fall '07 term at Drexel.

Page1 / 5

Lab - Lab Activity 1: Implement the Weibull Distribution in...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online