0% found this document useful (0 votes)
111 views57 pages

Physics 322 Aum

The document contains code for simulating the motion of a bullet fired at an angle. It defines the bullet and ground objects, assigns properties like mass and color, calculates the initial velocity vector, and uses a while loop with equations of motion to iteratively calculate the bullet's position and velocity over time until it hits the ground. The code is meant to output the final time, position, and velocity of the bullet.

Uploaded by

Manu Thomas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
111 views57 pages

Physics 322 Aum

The document contains code for simulating the motion of a bullet fired at an angle. It defines the bullet and ground objects, assigns properties like mass and color, calculates the initial velocity vector, and uses a while loop with equations of motion to iteratively calculate the bullet's position and velocity over time until it hits the ground. The code is meant to output the final time, position, and velocity of the bullet.

Uploaded by

Manu Thomas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

vector

vector

-1,3,0

0,0,0 4,1,0 .red

rf-ri

arrow dr

dr
vector

vector

1,3,0

0,0,0 -4,1,0 .magenta

rf-ri

arrow dr

dr
vector

vector

-3,-6,0

-3,-6,0

2,3,0
-3,-6,0

2,3,0

yellow

F1+F2

arrow
Fnet

Fnet
visual

vector

vector

-3,6,0

-3,6,0 2,-3,0 .red

F1+F2

arrow Fnet

Fnet
Question 12
Notes: Make sure that v.ou P..ilY. attention to correct SIJ.elling, ca1>.ital or small letter cases, commas, and 1>.oints. Make sure that v.ou don't use SJ!ace when com1>.leting the code lines.
Not yet
answered A bullet with a mass of 0.3 kg is fired at an angle of 75° with an initial speed of 18 m/s. Initial position of the bullet is< 0, 0.5 ,0 >. Simulate the bullet's motion. Calculate its final
Marked out of position, its final velocity, and how long it takes for the bullet to hit the ground.
30.00
a. Define the btillet as a sphere. Make radius as 0.3, red color, and make sure you see its trail.
f' Flag
question b. Define the ground as a box with position< 0 , 0 , 0 > and size< 60, 0.4, 10 > . Use green color for this vector.
c. Give mass property to the bullet.
d. Define the net force as the gravitational force. Present it as a vector. (g=9.8 m/s 2 and Fg=m-g).
e. Define the initial velocity of the projectile as a vector based on a given speed and an angle.
f. Initialize the time (t=0) and the increment (dt=0.01).
g. Define a while loop with the condition until the bullet's position in y-direction doesn't reach zero and set the rate to 100.
h. Apply equations of motions (you can find them in the Activity pdf file) to calculate the final position and the velocity of the bullet.
i. Update the velocity with the calculated value.
j. Update the time increment.
k. Print the final time needed for the bullet to hits the ground.

GlowScript 3.2 VPython

bullet=! sphere l(pos=vector(o,c0.5


= Jo), 0.3 color=color.cred _trail
= J mak~~ - - - ~ l=True)

ground=I box l(pos=Ivector l<o,O,O), size=I vector 1(60,0.4,10), color=color.green)

m=0.3
g=9.8 - - - - ~ ~ - - - - -
vector
Fnet=~I 0,-m*g,0
theta=75*pi/180
velocity=! vector 1(18*cos(theta), lB*sin{theta), 0)
t=0
dt=0.01
while bullet.pos.y I >=0):
~-----~

rate
-----------~
velocity= velocity+Fnet/m*dt
bullet.pas bullet.pos+velocity*dt
t+dt
D
print ('t=', t 's ')
sphere 0.3 0.2 orange _trail
box vector vector

vector 0,-m*g,0

vector

bullet.pos.y
rate
velocity+Fnet/m*dt
bullet.pos+velocity*dt
t+dt
t
! " # $

Modern Mechanics - PHYS172 - F1/F2 -


Spring 2022
Home / My courses

/ Modern Mechanics - PHYS172 - F1/F2 - Spring 2022

/ 8 May - 14 May

/ Lab Assignment - VPython (4%) - due 18 May 5pm

Question 1
Not yet answered

Marked out of 4.00

Flag question

Which attribute is used to change the arrow length in visual


python?

Select one:
axis
radius
pos
size

Question 2
Not yet answered

Marked out of 4.00

Flag question

To define an angle of 25 degrees in radians using Visual


Python, it is needed to be written:

Select one:
25pi/180

25/pi/180

25*pi/180

25/pi*180

Question 3
Not yet answered

Marked out of 4.00

Flag question

In order to write a comment in Visual Python, the correct sign


would be:

Select one:
#

_#
*

*#*

Question 4
Not yet answered

Marked out of 4.00

Flag question

Visual python display window coordinates are formed with


(x,y,z) where x represents:

Select one:
None of the choices fits
in/out of the display window
horizontal axis
vertical axis

Question 5
Not yet answered

Marked out of 4.00

Flag question

How would you define the bullet as a sphere of radius 0.1 at


position <-5, 0.15, 0> using yellow color? Make sure that its trail
is visible.

Select one:
bullet=sphere(position=vector(-5,0.15,0), radius=0.1,
color=color.yellow, make_trail=True)

bullet=sphere(pos=vector(-5,0.15,0), radius=0.1,
color=color.white, make_trail=True)

bullet=sphere(pos=vector(-5,0.15,0), radius=0.1,
color=color.yellow, make_trail=True)

bullet=sphere(pos=vector(-5,0.15,0), raduis=0.1,
color=color.yellow, make_trail=True)

Question 6
Not yet answered

Marked out of 4.00

Flag question

What is the correct code line to change the type of the trail
from a line to points in visual python:

Select one:
trail.type='point'
trail_type='points'
trail.type='points'
trail_type='point'

Question 7
Not yet answered

Marked out of 4.00

Flag question

What is a correct code line which is used to leave a trail behind


a moving object?

Select one:
make_trail=True
maketrail=True
make.trail=true
make-trail=True

Question 8
Not yet answered

Marked out of 4.00

Flag question

To choose z-component of the velocity that is defined using


Visual Python as v=vector(x,y,z), it is needed to be written:

Select one:
v_z

v.vector.z

vector.z

v.z

Question 9
Not yet answered

Marked out of 4.00

Flag question

Which attribute is used to change the size of a spherical object


in visual python?

Select one:
pos
radius
axis
size

Question 10
Not yet answered

Marked out of 4.00

Flag question

In order to print text in Visual Python, the correct statement


would be:

Select one:
print (text)

print ("text')

print ('text")

print ('text')

Next page

◀ Lab Assignment - Average Velocity (4%) - due 20 April 5


pm

Jump to...

Submit Here - (F1/F2) – Vpython Project (4%) due May 21


23:59 ▶

Quiz navigation

1 2 3 4 5 6 7 8 9 10 11 12

Finish attempt ...

You are logged in as Awdhah Jazzaa Abdullah Aldabbous (Log out)


Modern Mechanics - PHYS172 - F1/F2 - Spring 2022

Switch to the standard theme


© Copyright 2021, All Rights Reserved - American University of the
Middle East (AUM), Egaila, Kuwait

Home | My AUM Portal | Email | Banner | Library | E-Learning


x

x
x

You might also like