ppt - Department of Computer Science

advertisement

CS122/CS123

Engineering Computation Lab

Lab 1

Bruce Char

Department of Computer Science

Drexel University

Summer 2011

CS 121/122/123 – what is it?

• Engineering Computation Lab

• Learn how to use a tool for technical computation – Maple

About this Summer’s Classes

• This is a combined cs122 and cs123 class

• Materials will be created to enable parallel efforts within 2 class rooms (Korman 110 and

Korman 111)

• Instructor and assistants will coordinate both syllabi simultaneously

• Special flow to lab (Monday) sessions

– 1 st 15 minutes – items specific to both classes)

– Remainder of session – will split into 2 rooms to execute main body of lab exercises

Class syllabus

• Copy available on-line – course web site –

Syllabus tab

• Grading policies, quiz schedules, cheating penalties, etc. explained – read it!

Class web pages

• http://www.cs.drexel.edu/complab/cs122/summer2011B

• http://www.cs.drexel.edu/complab/cs123/summer2011

• Backup copies of all materials also on bbVista sites

Class Schedule

• Lab every week during the term

• Weeks 6, 7, 8 and 9

– Attendance required

• No makeup lab

– Work on lab with lab partner(s)

• Groups of 2 or 3.

– Verification sheet (one per lab team)

• Do the work in lab.

• Get sheet signed by lab staff.

• Turn in sheet at end of lab period as record of what you’ve done.

Other class requirements

• Take on-line quiz in weeks 6, 7, 8 and 9

– Based on lab from current week

– Can take quiz from any internet/browser-enabled computer.

– Will need to obtain copy of Maple15 for your computer

– Take on-line pre-lab “quizlet” in weeks 7, 8, and 9 prior to our next labs (in weeks 7, 8 and 9)

• Class proficiency exam in week 10 (8/22)

• Proficiency exam is taken “live” during your regularly scheduled lab period.

What counts towards class grade, what doesn’t count

• Doing lab work during lab (36% of grade)

– No make up labs in Summer term

• Take quiz in week of the lab (20% of grade)

– Some questions may involve dynamically generated components so you won’t get the exact same questions all the time.

– Some questions on the quiz will have “how do I do” which allows you to find out if you got it right or wrong and try again.

– May retake quiz as many times as you wish, up to deadline.

– Avoid taking exams at the last minute

• Take pre-lab quizlet (for Labs 2, 3, and 4) (8% of grade)

– Available Thursday through Monday morning prior to lab

• Proficiency exam is “traditional” – take it proctored in class in week 10 (36% of grade)

Weekly Work Cycle Milestones

• Pre-lab “quizlet” – available from Thursday (9am) through Monday (8am) each week starting in week

6 (prep for next lab)

– Necessary to read chapters and lab description 1 st for upcoming lab

• Lab sessions –Monday (4PM) in weeks 6 through

10

– Wednesday = consultant session – OK to complete

Monday lab and/or work on quiz

• Post-lab quiz – from Tuesday (9M) through Friday

(5 PM)

– No makeup quiz offered during Summer

Lab schedule for today

CS122 and CS123

• CS122 students - Move into Korman 111

• Work on Part 0 introductory exercises

• Then go on to Part 1 of lab

• Complete Lab 1 preview on next pages

• Get verification sheet done for each part as you finish. Get partial credit if you are not completely finished at the end of the period.

Lab 1 Overview – CS122

• Based on materials from Chapter 10 readings

– Development of longer scripts using Maple’s Code Edit Region feature and “outline” approach

• 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

– Use of print, printf and sprintf functions to enhance display of script information and results

• print – basic text and variable output

• printf – formatted, more user controlled output

• sprintf – creates output as a string for downstream usage

– Code troubleshooting / debugging techniques

Lab 1 Overview – cs122

• Lab 1 outline

– Part 0 – Some initial exercises to become familiar with key lab concepts

– Part 1 – design and implement a user defined function from specifications

– Part 2 – working with code edit regions

• A. execute a code edit region obtained from a starter file that simulates

Blammo’s flight trajectory

• B. Revise this script to produce a result in metric units

• C. Suppress intermediate result traces for 1.B script

– Part 3 – adding wind resistance calculations to the Blammo script

• A. Revise script from Part 2.B to incorporate impact of wind resistance

• B. From a starter file outline, create a script in a code edit region to compute and compare the flight trajectories with and without wind resistance

• C. Use the script from 3.B to analyze a variety of cases

Lab 1 Overview-cs122

Part 0 Concepts to Practice

• Example 1 – Working with Maple’s Code Edit Region

– Includes code troubleshooting / debugging

• Example 2 – Create and execute a Maple user defined function

• Example 3 – Multi-plot graphs using Maple’s display function

Lab 1 Overview – cs123

• Based on materials from Chapter 15 readings – writing programs as functions

– Review of user defined function syntax and usage

– Creating functions with Maple’s procedure feature

• Use of global and local variables

• Use of “if” and “looping” statements

• Transforming scripts into procedures

• Troubleshooting within procedures

Lab 1 Overview – cs123

• Lab 1 outline

– Part 0 – practice examples using Maple procedures

– Part 1.1 – building a time staged simulation program from specifications

• In prior labs/quizzes, we encountered time staged simulation scripts:

– Prey-predator problem

– Moving particle and bouncing ball

– Chemical reaction

• In today’s lab, we will develop a simulation to model the cooling of a house

• Starter script provided – must add logic to perform a time staged analysis using specified modeling relationships along with plots of the temperature profiles

Lab 1 Overview – cs123

• Lab 1 outline - continued

– Part 1.2 – extend the cooling simulation to include thermostat and air flow control functions

• Will modify script created in Part 1.1 to incorporate these controls in the form of Maple procedures

– The overall simulation model is described in depth in the introduction portion of the lab description

Getting Started

• Connect to class web page: www.cs.drexel.edu/complab/cs123/summer2011 or www.cs.drexel.edu/complab/cs122/summer2011B

• Start up Maple 15

• Read Lab 1 directions. Follow Lab directions,

NOT items on verification sheet.

• Do the work with your partner(s). All should try to do the work, but the grader will need to look at only one answer to give you credit for doing the problem.

A Note on Teamwork

• CS121, 122, and 123 are meant to be interactive experiences with your teammates

• Ask a teammate for assistance before requesting help from a TA

• At the end of the lab session, everyone on the team should be knowledgeable of the solutions

• Please do not apply a “divide and conquer” approach to multi-section lab exercises

• OK to change teams on a weekly basis

Saving worksheets

• File->Save or File->Save As (to desktop from lab computers)

• Keyboard shortcut: Command-S (control-

S) does the same thing.

• File saved with “.mw” suffix.

• Files can be saved during session in case of computer or application crash/freeze.

Finishing up – save files

• Make sure your name/user id/section number/date, time/instructor name are on the verification sheet.

• Get the verification sheet signed and handed in.

• Save worksheet on desktop if you haven’t done so already. You can call the file “MyLab1”. This will create a file called MyLab1.mw.

• Submit a copy to Blackboard site for backup storage only

(we do not look at them).

• Email a copy to yourself and/or your lab partners as an attachment so you can look at what you did for review purposes later.

• .mw file should open correctly on any Maple 14 (Mac,

Windows, Linux) – file format is portable across system types.

Next Steps – Take quiz 1 + “quizlet” 2!

• Install Maple 15 on personal computer – needed for the quizzes

– Copies available at software.drexel.edu

• You need to log on to Maple TA and take quiz 1. It will be about this week’s Lab material.

– Available from Tuesday, 7/26 at 9am through Friday, 7/29 at 5 pm

– If you miss the quiz deadline, you will get a zero for the quiz.

• You may work on the quiz (instructor and TAs will be available) at the Wednesday (7/27) consultation session (4-5:50 PM)

• Chapters for the pre-lab reading are posted and you should read that before coming to Lab 2 next Monday

– Also be sure to take the Lab 2 “quizlet” available from 7/26 (9 am) through 8/1 (8 am)

Quiz (and Lab) Assistance

• Quiz “How did I do” feature

– May take quiz as many times as you like – only highest score will count.

• Wednesday “consultation session”

Maple TA Quiz Logistics

• (Log on) https://mapleta.cs.drexel.edu/mapleta

– Link is also on course and bbVista websites

– Login ID -> your email ID (eg. dha33)

– Password -> your 8 digit student ID (eg. 12345678)

• (Select course) Computation Lab 2 or 3 – Summer, 2011

• (Select quiz) Quiz 1

• Answer question

– “how did I do” will (if enabled for the question) tell you whether you got the question wrong or right.

• Hit grade to record grade

• Click on “quit and save” to finish quiz.

• Click on “logout” to exit Maple TA.

Maple TA Quiz Demo

• If you don’t hit grade, your quiz score will not be recorded.

• If you forget to get your quiz graded, you can log in again and then get it graded. But if you forget, your score may never be reported to the instructor.

• Other quiz guidelines

– If you hit “quit and save” without hitting “grade” first, your current work will appear the next time you log in.

– You may take the quiz multiple times (only your highest score will be recorded). However, once you hit “grade”, a blank quiz will appear the next time you access the quiz

Download