Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Winter 2013.

Similar presentations


Presentation on theme: "CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Winter 2013."— Presentation transcript:

1 CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Winter 2013

2 CS122 Computation Lab II CS122 is the 2 nd in a sequence of 3 Computation Lab courses (along with CS121 and CS123) –The sequence uses MapleSoft’s Maple software to demonstrate how a wide variety of both routine and complex engineering and math problems can we efficiently solved and analyzed using a typical technical computation tool. All Freshman Engineering students are required to take this sequence Where appropriate, the Computation Lab sequence is integrated with the engr101, 102 and 103 offerings

3 What we learned in CS121 Last term we studied a variety of basic Maple software features and concepts: –Arithmetic operations, expression evaluation and equation solving, plotting and animation, (least squares) data curve fitting, Maple function usage along with development of user defined functions and script writing to enable us to solve and analyze a variety of engineering and math based problems

4 Welcome Back to CS122 This term, we will continue to learn and utilize Maple software features to increase our abilities to develop more sophisticated programs to solve more complex problems: –Script development and troubleshooting using Maple Code Edit Regions –Introduction to Maple procedures to encapsulate complex functions –Programming constructs to enhance our ability to develop complex scripts to conduct a wider variety of analyses: Iterative and conditional loops Maple tables for storage of multiple related values Decision statements (if and if-else constructs) –Introduction to time staged simulations

5 What’s New for CS122 Special extra consultation session –During quiz weeks on Tuesday evenings – will begin following Lab 2 –Details and recruitment to be announced shortly – please be sure to check the weekly (Thursday) email communications New (hands on) format for lecture portion of lab – Part 0 New quizlet rules –“How did I do?” turned off –May take / re-take quizlet a total of 3 times Some questions may vary slightly – eg. different parameters –Only your best score is recorded

6 CS122 – Basic Schedule 4 labs in even numbered weeks (2, 4, 6 and 8) 4 quizzes odd numbered weeks (3, 5, 7 and 9) 3 pre-lab quizlets in weeks (3, 5 and 7) Proficiency Exam in week 10 Flow of course similar to CS121 Be sure to review contents of course web site for details –www.cs.drexel.edu/complab/cs122/winter2013

7 Administrative Notes Please contact your individual instructors with questions and problems CLC (room 147 UC) will be staffed at same times as for cs121 in Fall (odd weeks – starting week 3) Missed work policies – same as in cs121 –Makeup labs to be held on Monday at 6 PM (odd weeks). Must receive explicit approval from your instructor in order to attend! –Makeup quiz offered (30% penalty) – Friday through Sunday after completion of regular quiz –No makeup quizlets MLK holiday on Monday, 1/21 –Makeup lab will take place on Tuesday instead of Monday –No CLC coverage on 1/21 Pre-Lab quizlet schedule –All quizlets will be due on Monday of lab week at 8 AM

8 Lab 1 Overview Based on materials from Chapter 10 and 11 readings –Development of longer scripts using Maple’s Code Edit Region feature The code edit region enables us to create and execute a series of Maple actions at once in “development friendly” environment –Utilizes the execution trace feature –Facilitates step by step troubleshooting / debugging Part 0 (Problem A) will walk us though the code edit region feature –Introduction to Maple procs Part 0 (Problem B) will introduce the Maple proc basic syntax –Introduction to conditional execution of actions using “while” loops Part 0 (Problem B) will demonstrate the “while” loop construct Will utilize the Car Simulator API to teach these concepts –Part 0 (Problem C) will focus on using the Car Simulator API

9 Lab 1 Maple Concepts: Discussion Conditional looping with “while” loops –while (condition) do loop body –end do; –The loop body will continue to get executed as long as the condition = true –The condition expression usually utilizes 1 or more relational operator ( >= <> = ) –Sometimes, a variable in the condition expression must be initialized so that it will have a value for the 1 st condition test –Faulty program logic can result in an endless (infinite) loop Use “stop (red)” hand on Maple icon list If this does not stop the execution, use “Force quit” from the Maple menu

10 Lab 1 Maple Concepts Discussion and Demo 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 Lab 1 Maple Concepts: Discussion and Demo 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 –In Lab 2, some of the simulator exercises will mimic some of the engr102 robot lab maneuvers

12 Lab 1 Maple Concepts: Discussion Car Simulator API – 3 key functions for Lab 1 –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’

13 Lab 1 Maple Concepts: Discussion and Demo Car Simulator API – how to use –Problem C of Part 0 provides an introduction on the logistics of using the Car Simulator a tutorial to explain how to launch, code program solutions –It is especially critical to 1 st open and run the Part 0 tutorial. It loads the Car Simulator API software that is needed throughout these exercises The 2 necessary Car Simulator library modules must reside in the same folder as the Maple work sheet examples Part 0 will explain how to satisfy this requirement

14 Lab 1 Overview Lab 1 outline –Part 0 – Some initial exercises to become familiar with key lab concepts –Problem 1 – moving in a variety of directions –Problem 2 – moving in a square –Problem 3 – finding a gap in a wall and then moving to a target –Problem 4 – finding a specified gap in a multi- gap wall

15 Lab 1 Overview Part 0 Concepts to Practice Problem A – Working with Maple’s Code Edit Region Problem B – Introduction to Maple procedures and “while” loops Problem C – Using the Car Simulator API

16 Quiz Week (3) Activities Quiz 1 will be released on Friday (1/180) at 6 PM –Deadline: Thursday (1/24) at 4:30 PM Makeup quiz – from Friday (1/25) at 9 AM through Sunday (1/27) at 11:00 PM –30% penalty Pre-lab 2 quizlet –From Thursday (1/24 – noon) through Monday (1/28 – 8 AM) Be sure to visit the CLC for quiz assistance Be on alert for information regarding extra consultation initiative


Download ppt "CS122 Engineering Computation Lab Lab 1 Bruce Char Department of Computer Science Drexel University Winter 2013."

Similar presentations


Ads by Google