MathcadHW2_quality_loss2 - resistors we manufactured Set up...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
s := 1 some plots below. Supplement to 16.881 Homework#2 This is required for Exploration of the Quadratic Loss Function Dan Frey, 6 JUN 98 The areas I expect you'll need to change to do homework#2 are highlighted. ORIGIN := 1 Let 1 be the first index in any vector. A o := 10 Cost to scrap the resistor [cents] m := 100 Nominal value of the resistance (in ohms) D o := 5% m Allowable variation in the diameter is +/- 5% A o k 1 := 2 D o k 2 A o D o 2 := L(y) := k 1 (y - m) 2 if y > m Define the quadratic loss function k 2 (y - m) 2 if y £ m D o y := m - 1.2 �D o , m - 1.2 �D o + .. m + 1.2 �D o Define a range over y for the purpose 10 of plotting Quadratic Loss Function 10 L(y) 5 0 94 96 98 100 102 104 106 y m D o - m D o + 1
Image of page 1

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

View Full Document Right Arrow Icon
Create a Monte Carlo simulation of the manufacture of the resistors. n := 1000 Number of resistors to be manufactured m m 1.5 s + := s D o 6 := R := rnorm ( n ,m,s ) Create a vector with all of the resistance values of the
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: resistors we manufactured. Set up the format for a histogram of the data. number_of_bins := 20 4 D o width_of_bins := number_of_bins j := 1 .. number_of_bins + 1 Define a vector with the start and end points of bin j := m -2 D o + width_of_bins j the bins. rel_freq := hist( bin , R) Compute the relative frequency distribution n over interval. bin_center := bin + 0.5 width_of_bins 2 Simulation Results for the Resistors m D o -m D o + L (y) 1 A o rel_freq 0.5 90 95 100 105 110 115 y , bin_center 1 Average_quality_loss n := L ( R i ) = n i 1 Average_quality_loss = 0.845 in cents How does this compare to the theoretically derived figure? m + 2 D o Ø Œ -(y-m ) 2 ø œ k 1 (y -m) 2 Œ Œ 1 e 2 s 2 œ œ dy = 0.903 in cents º s 2 p ß ı m-2 D o 3...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern