Download presentation
Presentation is loading. Please wait.
Published byProsper Thompson Modified over 8 years ago
1
CS122 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Winter 2013
2
Review of Lab 3 Cycle –Major Lab 3 concepts to remember Use of Maple proc to create shapes – triangles, boxes, pickets and fences Use of table variables in conjunction with “for” loop build a fence from pickets Maple plot features –- line plotting –- display – plot multiple graphs on same grid
3
Administrative Notes Please contact your instructor immediately if you are eligible for extended time for the Proficiency Exam A comprehensive preview for the proficiency exam was sent as an attachment in last Thursday’s weekly communication email. Please also review your bbLearn Lab and Quiz grades and report any discrepancies to your instructor As with cs121, there will be an opportunity to earn a 2% bonus for submitting a student evaluation. Details to follow!
4
Proficiency Exam Preview Same logistics as in cs121 –Proctored format –A quiz pair: 6 point and 9 point quizzes (about 25 and 70 minutes) –Sign-in and score verification on exit –No access to bbLearn or any other non course sites – will have access to all course site materials To be conducted during week of March 11 (week 10) in class for your regularly scheduled lab session Practice – week of March 4 (week 9) –All 4 quizzes and quizlets taken throughout the term will be re-posted on Tuesday, 3/5 – note that quiz 4 will take place during week 9 –A special quiz containing some problems not included in regular quizzes will also be issued – these questions are candidates for inclusion –Full quiz week (9) CLC coverage – Monday through Friday
5
Quiz Week (9) Activities Quiz 4 will be released on Friday (3/1) at 6 PM –Deadline: Thursday (3/7) at 4:30 PM –Makeup quiz – from Friday (3/8) at 9 AM through Sunday (3/10) at 11:00 PM 30% penalty No Pre-lab quizlet Be sure to visit the CLC for quiz assistance and review the quiz tips Practice week for Proficiency Exam –posting of practice quizzes on 3/5 –Exam to be conducted during week of March 11 (week 10)
6
Lab 4 Overview Based on materials from Chapter 15 and prior readings –All scripts created as procs within code edit regions –Introduction to time step simulations –Creating movies (animations) from individual frames –Use of “for” and “while” constructs within same loop header
7
Lab 4 Overview Lab 4 outline –Part 0 exercise Preview of Part 1 (chemical reaction time step simulation) starter script –Part 1 – chemical reaction time step simulation Create a graph of 4 reaction component concentrations over time of the reaction
8
Lab 4 Overview Lab 4 outline –Part 2 – Movement of a bouncing ball 2.1 – modification of a starter script (Blammo trajectory logic) to create an initial trajectory into ground 2.2 – Further modification to produce bounces and rebounds off of ground 2.3 – Plot and movie to show a specified number of bounces
9
Anatomy of an animation # 1 st, create a table variable to store frames –frames := table(); # Within loop, populate table with individual frames –frames[i] := plot([xp],[yp],style=point, color=“green”); # this plot is of a single point (xp,yp) # after all frames are populated, run an animation # insequence=true causes the animation to take place –display(convert(frames,list), insequence=true,scaling=constrained);
10
Time Step Simulations A word about time step simulations –We introduce time step simulations in the chemical reaction (Part 1) and bouncing ball (Part 2) simulations in today’s lab –In a time staged simulation, the loop steps represent time slices –Each iteration of the loop calculates the next generation of values based on correlations using the present generation –In today’s chemical reaction lab, the concentrations the of 4 reaction components are computed for the next generation (step) from their current values and other coefficients –In the bouncing ball simulation, the position of the ball is captured at each time slice for it’s trajectory –The predator / prey example from quiz 3 was an example of a time step simulation
11
Use of “for” and “while” within same loop header Example from today’s lab – Part 2 (bouncing ball) for i from 1 while numbounces < 6 do –# the “for i from 1” portion of the header enables use of a counter (i) to populate subscripts within the loop –# the “while numbounces < 6” portion conditionally loops until the 6 th bounce has been determined
12
And Finally, a Pre Part 0 Demo Animation of the predator / prey model for a 100 year cycle –Will demonstrate how to capture and animate a sequence of frames, each containing a pair of points representing rabbit and fox populations at a specific time slice (year) –Will also illustrate the power of plots and animations to effectively depict a simulation of this nature
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.