CS122 / CS123 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Summer 2011 ©By the author. All rights reserved.

Slides:



Advertisements
Similar presentations
CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Winter 2010.
Advertisements

Using MyMathLab Features You must already be registered or enrolled in a current MyMathLab class in order to use MyMathLab. If you are not registered or.
Today’s quiz on 8.2 B Graphing Worksheet 2 will be given at the end of class. You will have 12 minutes to complete this quiz, which will consist of one.
Math 010 online work that was due today at the start of class:
PLEASE HELP US OUT WITH THIS: When you go to the open lab next door in 203, please make sure you sign in on the log sheet and enter your instructor’s.
Next class session: Test 1 on all sections covered from Chapters 1 and 2 Remember: If you haven’t yet passed the Gateway Quiz, you need to review your.
COP4020/CGS5426 Programming languages Syllabus. Instructor Xin Yuan Office: 168 LOV Office hours: T, H 10:00am – 11:30am Class website:
CS 123 Computational Lab IIl Spring 2008 Department of Computer Science Drexel University Copyright by the authors. Permission is given for students and.
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note-taking materials. Today’s daily quiz will be given at the.
CS123 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Spring 2010.
Reminder: The Syllabus Quiz is due next session at the start of class. You can review/redo this quiz as many times as you want to get 100%. Only your best.
CS 123 Computational Lab IIl Spring 2008 Department of Computer Science Drexel University Copyright by the authors. Permission is given for students and.
CS 121 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University October 6-10, 2008 ©By the author. All rights reserved.
CSc 2310 Principles of Programming (Java) Dr. Xiaolin Hu.
CS 121 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University January 5-9, 2009 ©By the author. All rights reserved.
Chapter 1 Computing Tools Analytic and Algorithmic Solutions Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CS 122 Engineering Computation Lab Lab 2 Dan De Sousa and Tim Cheeseman Department of Computer Science Drexel University April 2009 ©By the author. All.
CS 121 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Fall 2009 ©By the author. All rights reserved. Permission.
CS122 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Spring 2011.
CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Spring 2011.
CS 121 Engineering Computation Lab Lab 4 Department of Computer Science Drexel University Summer 2009 ©By the author. All rights reserved. Permission is.
CS123 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Spring 2010.
CS 121 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Fall 2009 ©By the author. All rights reserved. Permission.
CS 122 / CS123 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Summer 2011 ©By the author. All rights reserved.
CS 121 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Summer, 2009 ©By the author. All rights reserved.
CS 121 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Fall 2009 ©By the author. All rights reserved. Permission.
CS 123 Engineering Computation Lab Lab 2 Dan De Sousa and Bruce Char Department of Computer Science Drexel University April 2009 ©By the author. All rights.
CS122 Instructor Assignments Winter, 2010 Term. Overview Some changes in assignments due to schedule considerations Some new initiatives / revised strategies.
Using MyMathLab Features of MyMathLab You must already be registered or enrolled in a current MyMathLab class in order to use MyMathLab. If you are not.
CS 121 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Fall 2010 ©By the author. All rights reserved. Permission.
CS122/CS123 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Summer 2011.
CS122 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Winter 2012.
CS 123 Lab 4 Instructor: Mark Boady Course Designer: Professor Bruce Char Department of Computer Science Drexel University Spring 2013.
CS122 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Spring 2011.
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note- taking materials.
CS 121 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Fall 2011 ©By the author. All rights reserved. Permission.
CS123 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Spring 2010.
CS 121 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Fall 2010 ©By the author. All rights reserved. Permission.
CS 121 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Fall 2012 ©By the author. All rights reserved. Permission.
CS 121 Engineering Computation Lab Lab 3 Department of Computer Science Drexel University Summer 2009 ©By the author. All rights reserved. Permission is.
CS123 Engineering Computation Lab Lab 1 Section Instructor: Mark Boady Content By: Bruce Char Department of Computer.
CS123 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Spring 2012.
CS 121 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Winter, 2011 ©By the author. All rights reserved.
CS 122 Engineering Computation Lab Lab 4 Dan De Sousa and Bruce Char Department of Computer Science Drexel University Summer 2009 ©By the author. All rights.
CS151 Introduction to Digital Design Noura Alhakbani Prince Sultan University, College for Women.
CS 123 Computational Lab IIl Spring 2008 Department of Computer Science Drexel University Copyright by the authors. Permission is given for students and.
REMINDER: If you haven’t yet passed the Gateway Quiz, make sure you take it this week! (You can find more practice quizzes online in the Gateway Info menu.
1. PLEASE HELP US OUT WITH THIS: When you go to the open lab next door in 203, please make sure you sign in on the log sheet and enter your instructor’s.
CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Winter 2013.
CS 121 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Fall 2010 ©By the author. All rights reserved. Permission.
CS123 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Spring 2011.
CS122 – Quiz 2 Winter, 2013 Quiz Hints. Quiz 2 Hints Question 1 – working with the “if” statement  First, we did not fully explain the structure of the.
CS122 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Winter 2012.
CS122 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Winter 2010.
CS122 – Quiz 1 Winter, 2013 Quiz Hints. Quiz 1 Hints Question 1 – Understanding procs  First, we did not fully explain the structure of the Maple proc,
CS123 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Spring 2013.
CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Winter 2011.
CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Winter 2012.
CS 122 Engineering Computation Lab Lab1 Bruce Char Department of Computer Science Drexel University Summer 2009 ©By the author. All rights reserved. Permission.
CS 122/CS123 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Summer 2011 ©By the author. All rights reserved.
CS122 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Winter 2013.
REMINDER: If you haven’t yet passed the Gateway Quiz, make sure you take it this week! (You can find more practice quizzes online in the Gateway Info menu.
CS101 Computer Programming I
CS122 Engineering Computation Lab Lab 4
CS 121 Engineering Computation Lab Lab 5
CS 121 Engineering Computation Lab Lab 3
CS 121 Engineering Computation Lab Lab 2
CS123 Engineering Computation Lab Lab 4
Using MyMathLab Features
CS122 Engineering Computation Lab Lab 3
Presentation transcript:

CS122 / CS123 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Summer 2011 ©By the author. All rights reserved. Permission is given to CS122 Summer 2011 staff and students to use and reproduce these notes for their own use.

11/06/09 Review of Lab 3 Cycle – cs122 Major Lab 3 concepts to remember Use of “for”, “while” loops and “if” statements to solve a variety of firing angle analyses

11/06/09 Review of Lab 2 Cycle – cs122 drawBoxB function syntax: – drawBoxB:=(width, height, xlo, ylo,c)  display([line([xlo,ylo],[xlo+width,ylo],color=c), line([xlo+width,ylo],[xlo+width,ylo+height],color=c), line([xlo,ylo],[xlo,ylo+height],color=c), line([xlo,ylo+height],[xlo+width,ylo+height],color=c)], axes=none, scaling=constrained); Need in Lab 4 for movement of particle in box exercises

11/06/09 Review of Lab 3 Cycle – cs122 Blammo trajectory analyses – why we used “for”, “while” and “if” – 1.1 – Compute distance traveled for a variety of firing angles for angle from 30 to 75 do – Simple “for” loop to cover integer range of angles – 1.2 – Find smallest angle that hits target for angle from 10 to 90 while (abs(distance-targetdist) >tol)) do – “for” loop defines overall set of angle to consider – “while” loop will stop the computations the 1 st time an angle produces a distance that hits target – 1.3 – Print all firing angles that produce a target hit for angle from 10 to 89 do if (abs(distance-target) <tol) then printf (…….); end if; a.Must compute for all angles, since multiple angles can produce the desired result b.Will only print out statistics for the angles that produce a hit on target

11/06/09 Review of Lab 3 cycle – cs123 Overview of calculus features in Maple – Optimization – finding the min or max of an objective function over a range for the independent variable – eg. minimum surface area of a can – Integration and differentiation – area of an irregularly shaped object Note use of piecewise expressions to define shape of object – Spline curve fitting – for a variety of degrees Power versus time – integrate  total energy generated

Administrative Notes Remaining activities for term Quiz 4 – Tuesday through Friday Use Wednesday session to take quiz Practice for Proficiency Exam Quizzes and quizlets from term will be released on Tuesday and will remain open until 8/22 – 2 PM. If you contact the instructor prior to 2 PM on 8/22 with specific quiz and problem numbers, you may complete quiz questions you did not answer on the original quizzes (maximum of 2 questions per student). Proficiency exam – Monday, August 22nd

Proficiency Exam Information Summer 2011

Proficiency Exam In class exam, during regular class hours (Monday, 8/22)‏ The exam counts for 36% of your final grade

Proficiency Exam For the exam, you will do two tests in Maple TA. One quiz will have How did I do? turned on (9 points). One part (6 points) will have it turned off. The part where it is turned off will be the multiple choice or similar questions where getting feedback would make the question useless from an evaluation viewpoint.

Proficiency Exam Questions for the exam will be drawn from past quizzes, and from a small set of new questions. This means that everyone will know what the questions could be, ahead of time. They will also be able to prepare a plan for answering them, ahead of time.

Practicing All questions will be posted on Maple TA in practice form starting Tuesday, August 16th and running through the exam period (8/22 until 2 PM). For exam security, we will turn off access to the practice quizzes while exams are being run in the labs.

Exam Security During the exam You must use the laptop (be it Mac or Windows) provided. You may not use your own computer. You may use Maple Maple TA Browse cs.drexel.edu/complab/cs123/summer2010 cs.drexel.edu/complab/cs122/summer2011B which have copies of the lab directions and lecture notes. No notes or other aids

Exam security Computer usage will be monitored, both by visual checks by course staff and by software monitoring built into the computers you use. Unlike the labs, we will be in full “Big Brother” mode during the exam: We will be able to watch what you do, log every key stroke and mouse click, and take movies and screenshots of what you are doing.

A reminder about cheating Unauthorized access to information for the exam will be a violation of the Academic Honesty policy. So will accessing unauthorized information non- electronically or any other form of cheating. The minimum penalty will be a reduction in the final grade for the course. We reserve the right to give you a course grade of F with no opportunity to withdraw, or to begin proceedings to expel you from the university. If you have concerns about your grade for the course, talk to your instructor.

Proficiency Exam Policy If you have a conflict or are unable to attend the scheduled exam due to a reasonable medical or personal excuse, you should contact your section instructor and arrange an alternative time as soon as possible. If you miss your exam and delay contacting your instructor until after the proficiency exam has passed, our policy will be to give you a zero for the exam.

Quiz 4 Activities Quiz 4 will be released on Tuesday (8/16) at 9 AM – Deadline: Friday (8/19) at 5 PM – Attend Wednesday session to try quiz with TA support No Pre-lab quizlet – this is the last lab of the term Proficiency Exam Scheduled for Monday, August 22 nd at 4 PM Practice exams (previous quizzes, quizlets and some extra problems) will be released on Tuesday

11/06/09 Lab 4 Overview – cs122 Based on materials from Chapter 15, 16 and 17 readings – Chapter 17 – the purpose of variables used in loops (new) – Chapter 15 – More on repetition and looping (review) “while” loop – conditional looping + relational operators Combining “for” and “while” loops Dealing with runaway (infinite) “while” loops – Chapter 16 – Conditional execution (review) Choosing alternatives – if.. then.. else.. elif constructs

11/06/09 Lab 4 Overview – cs122 Lab 4 outline – Part 0 exercises Practice on “if”, “if-else” and “if-elif-else” constructs – Part 1 – particle movement in box 1.1 – using the drawboxB function from Lab 2 to animate the bouncing of a particle off of the East wall of a box revising script from 1.1 (drawBoxB + East wall bounce) to handle bounce off of West wall 1.3 – adding logic to bounce off of North and South walls 1.4 – simulating diagonal movement and movement within a box of smaller dimensions

11/06/09 Lab 4 Overview – cs122 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

11/06/09 Lab 4 Maple Concepts: Discussion – cs122 Choosing among cases – if-then-elif-else-end – if (condition1) then Code to execute if condition1 is true – elif (condition2) then Execute if condition2 is true Note – only can reach here if condition 1 was false – elif (condition3) then if condition 3 true (1 and 2 were false) – else “catch all” bucket – if all case conditions specified above were false – end if; East, West, North and South wall bounces for particle movement will utilize this construct See today’s Part 0 exercises for example and syntax

11/06/09 Lab 4 Maple Concepts: Discussion – cs122 Use of the ptpos (list) variable in Part 1 of today’s lab – ptpos is a list that represents a point in the X-Y grid with an x coordinate = x and y coordinate = y – For example, if the value of ptpos is the list [9,1], it indicates that the moving point is at the simulated coordinate (9,1) within the box. – To get the value of the x coordinate in the midst of the simulation, use the expression ptpos[1]. – To get the value of the y coordinate, use the expression ptpos[1].

11/06/09 Lab 4 Overview – cs123 Based on materials from Chapters 21 and 22 readings – Chapter 21 – Calculations that return true or false Use of boolean expressions with a programming API – Chapter 22 – Review of course goals and objectives

11/06/09 Lab 4 Overview – cs123 Lab 4 outline – 5 parts – Part 0 – introduction to software mechanics and features – Part 1 - move car in a square – Part 2 – bump car back and forth between 2 walls – Part 3 – find gap in a wall and proceed to target – Part 4 – find the nth gap in a wall and proceed to target

11/06/09 Lab 4 Maple Concepts Discussion and Demo – cs123 Application Programming Interfaces (APIs) – An industry standard term for a package of procedures that simplifies the process of writing code for a particular purpose – An API usually provides a set of functions (user interfaces) to create applications – Maple provides an API for many common mathematical and computation tasks Plotting, calculus, trigonometric functions – Why they are important Entire courses on software design and reusability Bottom line – give programmers a way of easily writing code for a particular platform Encourages rapid development, saves work

11/06/09 Lab 4 Maple Concepts: Discussion and Demo – cs123 Car Simulator API – An API written by the course staff that enables you to animate and simulate car movement in conjunctions with walls, barriers, etc. – This simulator ignores forces of friction, focusing on the logic of controlling the (directional) movement of a car

11/06/09 Lab 4 Maple Concepts: Discussion – cs123 Car Simulator API – 4 key functions available – move(x) Moves the car forward (in the direction it is currently pointed) x squares – Turn(d) Turns the car d radians to the left Turn (Pi/2) makes the car turn directly to the left Turn (-Pi/2) makes the car turn directly to the right The turn is always relative to the current direction of the car – isTouching(d,’stateOfCar’) Returns “true” if the car is touching some object in the direction d radians above (PI/2), left(Pi), below(-PI/2) or right (0) Direction d is always absolute in terms of the X-Y axis It is OK to use ‘bt’ for ‘stateOfCar’

11/06/09 Lab 4 Maple Concepts: Discussion – cs123 Car Simulator API – 4 key functions available – getCURRENTLOCATION() Get the current state of the car, which is a list with: [x, y, dir, state] [2, 0, 0, CarSimulation:-CARNORMAL]

11/06/09 Lab 4 Maple Concepts: Discussion and Demo – cs123 Car Simulator API – flow of lab – There are 4 sections to Part 0 (each contained in it’s own work sheet) and 4 problem work sheets associated with Parts 1, 2, 3 and 4 – You must open and perform the tasks for each of these work sheets in the order presented in the lab description – It is especially critical to 1 st open and run the Part 0 tutorials. It loads the Car Simulator API software that is needed throughout these exercises

11/06/09 Lab 4 Maple Concepts: Discussion – cs123 Part 0 exercises – 1 st copy the zipped file from the course site and then unzip (MAC may automatically unzip for you) – Open the Maple worksheets from the unzipped files as per the lab description instructions – Follow the directions in each work sheet - study the logic in each code edit region, run the code and review the output – Note that some regions produce an animation of the car’s movement