CS 123 Computational Lab IIl Spring 2008 Department of Computer Science Drexel University Copyright by the authors. Permission is given for students and.

Slides:



Advertisements
Similar presentations
Motion in Two Dimensions
Advertisements

Motion in Two Dimensions
IS660Z Programming Games Using Visual Basic Overview of Cannonball.
Visual Basic: ballistics
Physics 111 Lecture 03 Motion in Two Dimensions SJ 8th Ed. : Ch. 4
Projectile motion Chapter 4, Section 4 Lecture 08 General Physics (PHYS101)
Projectile Motion. Once a difficult problem for cannoneers If the vertical and horizontal components are separated, the problem becomes simple.
Physics 211 Space - time & space-space diagrams Kinetic Equations of Motion Projectile motion Uniform circular motion Moving coordinate systems Relative.
ENGR 215 ~ Dynamics Sections 12.4 – Curvilinear Motion: Position.
Physics 121 Topics: Course announcements Quiz
Projectile Review Questions
CS 123 Computational Lab IIl Spring 2008 Department of Computer Science Drexel University Copyright by the authors. Permission is given for students and.
Rectilinear Motion Revisited Objective: We will look at rectilinear motion using Integration.
1.Measurements & units 2.Scalars & vectors 3.Displacement, Velocity and acceleration 4.Relative velocity. 5.Motion in two dimensions and in three dimensions.
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.
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 123 Computational Lab IIl Spring 2008 Department of Computer Science Drexel University Copyright by the authors. Permission is given for students and.
CS122 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Spring 2011.
PHYS 1441 – Section 002 Lecture #7 Wednesday, Feb. 6, 2013 Dr. Jaehoon Yu What is the Projectile Motion? How do we solve projectile motion problems? Maximum.
Free Fall Motion Notes Day 4.
Physics pre-AP. Equations of motion : We assume NO AIR RESISTANCE! (Welcome to “Physicsland”), therefore… The path of a projectile is a parabola. Horizontal.
Physics 201, Lect. 6 Chapter 3: Motion in two- and three-dimensions Examples and application 10/23/2015Phys 201, Spring 2011.
Free Fall & Projectiles Chapter 3, sections 7-9 & Chapter 8, sections 1-4.
Thursday, Sept. 11, 2014PHYS , Fall 2014 Dr. Jaehoon Yu 1 PHYS 1443 – Section 004 Lecture #6 Thursday, Sept. 11, 2014 Dr. Jaehoon Yu Motion in.
CS 121 Engineering Computation Lab Lab 4 Department of Computer Science Drexel University Summer 2009 ©By the author. All rights reserved. Permission is.
Chapter 6: Motion in Two Dimensions TWO DIMENSIONAL MOTION.
CS123 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Spring 2010.
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.
Projectiles (2D) A projectile is any object that is in a state of freefall, or in other words an object that is only acted upon by the force of gravity.
Warm up 8/26 Warm up 1. Do in notebook True or False, if false explain why or give example 1. If, then 2. If, then 3. If, then 4. If, then.
CS122 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Winter 2012.
CS 121 – Quiz 4 Questions 5 and 6. Question 5 We are given Blammo’s initial angle of elevation, initial velocity, and the height of the center of the.
Monday, Sept. 13, 2004PHYS , Fall 2004 Dr. Jaehoon Yu 1 1.Motion in two dimension Motion under constant acceleration Projectile motion Heights.
CS122 / CS123 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Summer 2011 ©By the author. All rights reserved.
CS 121 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Fall 2011 ©By the author. All rights reserved. Permission.
Projectile Motion Projectile motion: a combination of horizontal motion with constant horizontal velocity and vertical motion with a constant downward.
CS 121 Engineering Computation Lab Lab 3 Department of Computer Science Drexel University Summer 2009 ©By the author. All rights reserved. Permission is.
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.
CS 123 Computational Lab IIl Spring 2008 Department of Computer Science Drexel University Copyright by the authors. Permission is given for students and.
SECTION 2 (PART 2) - Projectile Motion and Centripetal Force.
CS 121 Engineering Computation Lab Lab 4 Bruce Char Department of Computer Science Drexel University Fall 2010 ©By the author. All rights reserved. Permission.
CS122 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Winter 2010.
CS 121 Engineering Computation Lab Lab 4 Department of Computer Science Drexel University February 16-20, 2008 ©By the author. All rights reserved. Permission.
CS 122 Engineering Computation Lab Lab1 Bruce Char Department of Computer Science Drexel University Summer 2009 ©By the author. All rights reserved. Permission.
CS320n –Visual Programming Execution Control with If / Else and Boolean Functions (Slides 6-2-1) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for.
6.2 General projectile motion
1. What is the acceleration due to gravity? 2. Use your kinematics equations to solve the following problem: The observation deck of tall skyscraper 370.
Sept 15 th Kinematics questions from yesterday Quiz Wednesday.
Introduction to 2D Projectile Motion Types of Projectiles Which one is NOT a projectile?
Physics 141MechanicsLecture 4 Motion in 3-D Motion in 2-dimensions or 3-dimensions has to be described by vectors. However, what we have learnt from 1-dimensional.
Part 1 Projectiles launched horizontally
CS122 Engineering Computation Lab Lab 4
Motion in Two Dimensions EQ: What is a projectile?
CS 121 Engineering Computation Lab Lab 5
CS123 Engineering Computation Lab Lab 4
Projectile Motion.
Chapter 2: One-Dimensional Motion
Projectile motion Projectile Motion Subject to Gravity Assumptions:
CS 121 Engineering Computation Lab Lab 3
PHYS 1441 – Section 002 Lecture #8
PHYS 1441 – Section 002 Lecture #7
Announcements: Read preface of book for great hints on how to use the book to your best advantage!! Labs begin week of Sept. 3  buy lab manual. Bring.
Motion in Two Dimensions EQ: What is a projectile?
P R O J E C T I L s V Vy Vx.
What do you think a “launch” looks like?
PHYS 1443 – Section 001 Lecture #5
Projectiles.
Projectile motion.
Presentation transcript:

CS 123 Computational Lab IIl Spring 2008 Department of Computer Science Drexel University Copyright by the authors. Permission is given for students and staff of CS 123 Spring 2008 to reproduce these notes for their own use.

Calendar ActivityDue Date Lab 1Week 2Week 3 Quiz 1Week 3 Lab 2Week 4Week 5 Quiz 2Week 5 Lab 3Week 6Week 7 (16 th May- 5P.M) Quiz 3Start : 10 th MayWeek 7 (16 th May- 5P.M) Lab 4Week 8Week 9 Quiz 4Week 9 Lab exam (in class)Week 10

Important Note about Today’s Lab 1)You are required to work in a group 2)You don't get credit for the lab until you show a TA or instructor your results from the end of the lab. You can do this at the end of the lab period, or by dropping into the Cyber Learning Center next week. If you do not get "checked in" by a staff member, then you will receive no credit for this lab even if you attended a Lab session

So, What is today’s Lab about? Animating with maple : use “animate” command to create maple simulations We will simulate cannon simulation and the “Blammo” game

One dimensional motion Assuming we have 1 dimensional motion: Velocity: v(t) = -gt + v(0) Displacement: y(t) = int(-gt + v(0)) dt = -1/2gt^2+v(0) t + D

Let’s look at maple code: > a := -32; # feet/second^2; > v := int(a, t) + v0; > y := int(v, t); > tpeak := solve(v=0, t); # time to reach peak > ymax := eval(y, t=tpeak); # height of peak > soln := solve(y=0, t); # times when on the ground > tmax := max(soln); # select later time > tmax := simplify(tmax, assume=positive); # assume v0 > 0 to simplify > tmax = 2*tpeak; # confirm Animate : animate(pointplot, [[0,y]], t=0..tmax, symbolsize=20); Maple Simulation of one dimensional motion:

2 New Maple commands: 1) Animate : -what does it do? > create a 2-D or 3-D animation on one parameter -How to use it? > animate(plotcommand, plotargs, t=a..b, options) Example: : animate(pointplot, [[0,y]], t=0..tmax, symbolsize=20); 2) Evalb : - what does it do ? Evaluates a Boolean Expression -how to use it ? Evalb(x) example : >evalb(evalf(sqrt(5))>2); True Wh\

Using Defined Procedures to make a game! Let’s take a closer look at defined procedures and how we can use them: 1)VerticalPosition : checks if the disk hits the bell / derive the equations 1)VerticalPosition:=proc(t,v0,h) 2)MaxTime determines the time when the disk returns to the ground 1)MaxTime := proc(v0, h) 3)PlayGame: Given the initial velocity v0 of the disk and the height h of the bell, procedure PlayGame uses the animate command to simulate the hit- the-bell game. 1)PlayGame:= proc(v0, h)

Two Dimensional Motion: h x(t) = V0x * t y(t) = y0 + V0y*t -1/2g*t^2

Same approach as 1 dim- Code up procedures on yourself! Procedures you need to write: 1) HitsNet(initial velocity, angle (measured in radians) distance to net, size of net) which returns true if Blammo lands on any part of the net and returns false otherwise. 2) XYPosition(time, initial velocity, angle) which returns a list with two elements, namely expressions for the x and y coordinates of the position of Blammo at time t : USE PREVIOUS EQ! 3) MaxTime(initial velocity, angle) which returns the time when Blammo hits the ground Y = 0, X = X final = R 4) ShootCannon(initial velocity, angle, distance to net, size of net) which creates an animation of Blammo being shot from the cannon towards the net. USE PREVIOUSE FUNCTIONS + ANIMATE

Parametric Curves in Maple We can plot curves in Maple using PLOT command: plot([x(t), y(t), t=range of t], h, v, options) [x,y,range] - parametric specifications h - horizontal range v - vertical range Example: >plot([(t^2-1)/(t^2+1), 2*t/(t^2+1), t=-infinity..infinity]);

What if we have wind resistance ? Let’s consider the case of having resistance: Basic idea : Acceleration is changed : F=M.A How we use it? -Vx-wind, x-wind -Vy-wind, y-wind

Use Procedures/function to simulate Blammo with/out resistance!

Lab structure This lab is divided into the following sections: Required Reading: Introduction & Overview, Tutorials 1-5, Wrap-Up Required Problems: Problems 1-5 Optional Problems: Problems 6,7 Work in groups as always !! Do not forget to CHECK IN !

What to turn in?! Lab 3  Due May 16 th,5 P.M Quiz 3  Due May 16 th,5 P.M -Submit your lab via Bb Vista -We have office hours in UC145 next week, if you had any problem in Quiz 2 feel free to stop by and ask questions! Good Luck!