CS 170: Computing for the Sciences and MathematicsAdministriviaCS 170 Exam 2CS 170 Exam 2 – Study SuggestionsSlide 5Computational BackgroundComputational Tools: MapleEuler’s methodEuler’s MethodExampleRunge-Kutta 2 methodConcept of methodSlide 13Example: Cellular AutomataMr. von Neumann’s NeighborhoodExample: DiffusionExam 2 Review InfoCS 170:Computing for the Sciences and MathematicsAdministriviaLast timeLab TimeTodayHW#9 DueMonday is Exam 2In this roomGuest Host: Dr. Paul WagnerCS 170 Exam 2Monday, November 15th 4:00pm – 5:25pmFormat:Written/Short AnswerOpen textbook, Open notesCalculators allowedNo computers, cell phones, PDAs, etc.If you can use it to connect to outside (or someone else) Length < 75 minutesCS 170 Exam 2 – Study SuggestionsTextbookYes, its open bookIf you have to spend 20 minutes finding it, the book doesn’t really help!Book exercisesSlides and notes from lectureHomeworks!!Computational BackgroundAlgorithmsSeries of steps followed to accomplish some result. A sequence of steps taking place over time to calculate a result.Algorithms have only a handful of state-mutating manipulationsCore ManipulationsAssignment to variablesSequenceSelectionIterationComputational Tools: MapleMaple is a general-purpose commercial computer algebra systemImplements the basic components of a languageAlso includes powerful libraries for mathematical functionsIn math, used for many direct solution methodsSymbolic differentiation and integrationIn computational science, can also be used to implement numerical simulations.Euler’s methodSimplest simulation technique for solving differential equationIntuitiveSome other methods faster and more accurateError on order of ∆t Cut ∆t in half cut error by halfEuler’s MethodEuler’s Method is a simulation technique.Example: unconstrained growth dP/dt = 0.1P with P0 = 100P(t) = P(t - ∆t) + growth(t)∆t (new = old + change)growth(t) is dP/dt = 0.1P(t - ∆t) (change = r*Pold)ExampledP/dt = 0.1P with P0 = 100 and ∆t = 8Runge-Kutta 2 methodEuler's Predictor-Corrector (EPC) MethodBetter accuracy than Euler’s MethodPredict what the next point will be (with Euler) – then correct based on estimated slope.Error proportional to (∆t)2Concept of methodInstead of slope of tangent line at (tn-1, Pn-1), want slope of chordFor ∆t = 8, want slope of chord between (0, P(0)) and (8, P(8))Concept of methodSlope of chord ≈ average of slopes of tangents at P(0) and P(8)Example: Cellular AutomataStructureGrid of positionsInitial valuesRules to update at each timestepoften very simpleNew = Old + “Change”This “Change” could entail a diff. EQ, a constant value, or some set of logical rulesMr. von Neumann’s NeighborhoodOften in automata simulations, a cell’s “change” is dictated by the state of its neighborhoodExamples:Presence of something in the neighborhoodtemperature values, etc. of neighboring cellsExample: DiffusionDiffusion: movement of some property over timeFire SimulationMovement of fire through a forestSimulation varied parameters to affect the resultsHeat DiffusionDistribution of heat in an area over
View Full Document