Error Propagation in a Simple Function Evaluation

Sean Rodby, Luke Snyder, Autar Kaw
University of South Florida
United States of America
kaw@eng.usf.edu
Website: http://numericalmethods.eng.usf.edu
Version: Mathematica 6; Last Revised: August 28, 2008

Initialization

Clearing the definitions of all symbols in the current context:

ClearAll[Evaluate[Context[]<>"*"]]

Introduction

The following worksheet illustrates how error propagates in a simple function evaluation. This is due largely to the fact that relative error calculations are based on round-off errors or/and measurement errors that exist inherently in simple devices used to take measurements. The user will enter force, length or width of the cross section, and Young's Modulus data in the Input section of the program, as well as the corresponding relative measurement error for each input. From here, Mathematica will be used to demonstrate how this error propagates. The formula used for illustration is Strain = (F/((h^2)E)).

Section 1: Input Data

This is the only section where the user interacts with the program.

Enter inputs to calculate strain based on the formula Strain = (F/((h^2)E)).

Enter Force (in N)

Force=72;

Enter relative measurement error in percentage for force

RMEForce=2.5;

Enter length or width of cross section (in m):

h=4×(10^(-3));

Enter relative measurement error in percentage for h

RMEh=2.5;

Enter Young's Modulus (in Pa)

Ε=70×(10^9);

Enter relative measurement error in percentage for Modulus

RMEYoung=2.5;

This is the end of the user section. All information must be entered before proceeding to the next
section. RE-EVALUATE THE NOTEBOOK.

Section 2: Procedure

Calculating the measurement error for each input.

MeasErrorForce=Force*(RMEForce/100)
MeasErrorh=h*(RMEh/100)
MeasErrorYoung=Ε*(RMEYoung/100)

First we must calculate the strain given by the equation ε = (F/((h^2)E)).

strain=(Force/((h^2)Ε))

Using the formula for maximum possible error to derive the maximum possible error in the measured strain. Note that different variable names are used because the previous variable names represented actual numbers. Meaning that if the partial differential is taken, in all cases it will be zero. The With command is then used to input the values given by the user into the partial differential equation.

strain1=F/((h1^2) Ε1);
partialForce:=Abs[D[strain1,F]];
partialwrtForce=With[{Ε1=Ε,h1=h},Evaluate[partialForce] ];
partialh:=Abs[D[strain1,h1]];
partialwrth=With[{h1=h,F=Force, Ε1=Ε},Evaluate[partialh] ];
partialYoung:=Abs[D[strain1,Ε1]];
partialwrtYoung=With[{F=Force,h1=h, Ε1=Ε},Evaluate[partialYoung] ];

Calculating the range of value for each measured quantity based in the RME percentages given.

RangeForce=((RMEForce/100)) Force;
Rangeh=((RMEh/100)) h;
RangeYoung=((RMEYoung/100)) Ε;

Calculating the maximum possible error by adding the absolute value of the partial differential equations multiplied by their respective range of variation in the measured value. Then calculating the individual error contributions due to Force, Area, and the length or width dimension respectively.

(*With respect to force*)
ErrorForce=partialwrtForce*RangeForce

(*With respect to h*)
Errorh=partialwrth*Rangeh

(*With respect to Young's Modulus*)
ErrorYoung=partialwrtYoung*RangeYoung

(*Calculating total error by adding all the individual contributions given by the user defined inputs.*)
TotError=ErrorForce+Errorh+ErrorYoung

(*Calculating the percent contribution of force error to the total error.*)
RelForceError=((ErrorForce*100)/TotError)

(*Calculating the percent contribution of h error to the total error.*)
RelhError=((Errorh*100)/TotError)

(*Calculating the percent contribution of Young's Modulus error to the total error.*)
RelYoungError=((ErrorYoung*100)/TotError)

(*Calculating the effective range that the axial strain could be within using the total error calculation.*)
Lowstrain=strain-TotError
Highstrain=strain+TotError

(*Calculating the maximum percent relative measurement error for strain.*)
RMEstrain=((100*TotError)/strain)

Conclusion

If a calculation is made with numbers that are not exact, then the calculation itself will have an error. Since the final results of an experiment are not usually directly measured but are some function of one or more of the measured quantities, it is important to understand and utilize propagation of error concepts to better interpret and represent experimental results.

References

Propagation of Errors.
See: http://numericalmethods.eng.usf.edu/nbm/gen/01aae/nbm_gen_aae_txt_propagationoferrors.pdf

Legal Notice: The copyright for this application is owned by the author(s). Neither Wolfram Research nor the author(s) are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the author for permission if you wish to use this application in for-profit activities.