MathcadHW2_quality_loss2

MathcadHW2_quality_loss2 - resistors we manufactured. Set...

Info iconThis 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
Background image of page 1

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

View Full DocumentRight 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
Background image of page 2
Background 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

This note was uploaded on 11/08/2011 for the course AERO 16.851 taught by Professor Ldavidmiller during the Fall '03 term at MIT.

Page1 / 3

MathcadHW2_quality_loss2 - resistors we manufactured. Set...

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

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