Class08 - Class meeting#8 Monday Sept 20th GEEN 1300...

This preview shows page 1 - 6 out of 25 pages.

1GEEN 1300Introduction to Engineering ComputingClass meeting #8Monday, Sept 20thcircular calculations and the iterative solversolving nonlinear equationslive solution using bisectionspherical tank problemTABLE function applicationSpreadsheet Problem Solving1Homework #4, due WednesdaySection Test 1, next Monday, Sept 27th, 7–9pm,HUMN 1B50 and RAMY C250Coverage: Class #1 through #8 today, Labs 1-5Text, pages 1-274Section Test 1, next Monday, Sept 27th, 7–9pm,HUMN 1B50 and RAMY C250Coverage: Class #1 through #8 today, Labs 1-5Text, pages 1-274REMINDERText, pages 1 274HUMN 1B50 (cap’y 284)Sections 101, 102, 103, 104, 105, 106 (139 students)RAMY C250 (cap’y 204)Sections 107, 109, 110, 111, 112 (109 students)2Bring only calculator (spare batteries), two pencilsand eraser
2What is a circular calculation?Calculation involvingone or many formulasAnswer“x”Estimate“x”for the solution to be correct,the estimatex” going into thecalculation has to be equal tothe answerx” coming out ofthe calculation3the calculationA simple example:1xsin xestimateanswerThis is also calledanproblemxg xor a substitution problemor a fixed-point iterationproblemNote: by rearranging the above toxgx0we get a standard equation-solving problemf04fxxg x0or anfx0problemand we use different methods to solve it (later!)
3For our simple example,1xsin xestimateanswerCircular Calculation of x=1/sin(x)EstimateAnswer0.52.0861.1492.0861.0961.1241.1491.096Circular Calculation of x=1/sin(x)1.0001.5002.0002.500x value51.1091.1171.1131.1151.1241.1091.1171.1130.0000.50012345678tryExcel-based solution using formula copyingCopy formulas down6
4Excel-based solution using the iterative solverFile ButtonOptionsFormulasSet up Excel for iterative solving firstDefault settingsTiltti7Default settingsTypical settingsthen click OKSetting up the iterative calculation on the spreadsheetInitial estimatefor xg(x) based onwhat’s in B2the result of thefirst tryenter a “pointer” formula to88enter a “pointer” formula tocell B3 in place of the initialestimatethis “closes the loop” on the circular calculation
5as soon as you press Enter,the calculation proceeds byone iterationand “Calculate” is shown onthe Status bar to indicate thatthe Status bar to indicate thatyou are in an iterative situationNote: the spreadsheet willnot update automaticallynow you have toforce it to re-calculate withPressing the F9 key afew times will causethe calculation toconverge to the correct(it l )9the F9 [ Calculate ] keyanswer (approximately)since “estimate” x agreeswith “answer” x, the equationis solved, numericallyThere are (at least) a couple issues here:1)if you want to reset the calculation to the startingestimate (0 5) and run through it again you haveestimate (0.5) and run through it again, you haveto replace the pointer formula in B2 with 0.5, andthen put the pointer formula back in --not convenient!

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture