subject

When Callista hits the ground, she stops. To simulate this, if her altitude is ever less than 0, set her velocity in all directions to zero, her height to zero, and her x location to its previous value. Her x location should then remain the same until the end of the simulation. In other words, when she hits the ground, she stops moving until the 10 seconds we are simulating are over. For each angle, you will need to simulate all 1,000 time steps. Each time you update the state variables, first compute her acceleration (using her previous speed to compute the drag,) then her velocity (using her current acceleration,) then her location (using her current velocity.)
Final answer
After the simulation is complete, we are not yet finished. Callista needs to know the optimum angle in integer degrees (being a cannonball not a mathematician).
?Above was the info about the code and what is needed in the code, and now the question I'm really asking is to FILL IN THE BLANKS IN THE STARTER CODE THAT IS GIVEN BELOW :
# 0. Place your necessary imports here. You may find it useful to be able to plot when debugging and visualizing your result.
import numpy as np
# 1. Create a 1D vector named `t` and 2D arrays named `vx`, `vy`, `x`, and `y` to hold the state variables, of size 90 x 1001.
t = ???
# 2. Store the angles from 1 to 90 degrees as radians in a variable called `radians`. Use this to initialize the state variables for `vx` and `vy`.
m = 90 # angles to fire at
angles = ???
radians = angles * 2*np. pi/360
# 3. Define properties like gravity, Callista's surface area, and Callista's mass, and any other parameters you may need as they come up.
A = 0.8 # m^2
g = 9.8 # m/s^2
# etc. Note that I expect an `initial_height` and `initial_velocity` below.
# 4. At this point, you should have defined `t`, `x`, `y`, `vx`, `vy`, `radians`, and the properties you need. Now, initialize the starting condition in each array:
for i in range(m):
y[ i ][ 0 ] = initial_height
vx[ i ][ 0 ] = initial_velocity * np. cos( radians[ i ] )
vy[ i ][ 0 ] = ??? # (see "Angles" above)
# 5. Now you are ready to begin the simulation proper. You will need two loops, one over every angle, and one over every time step for that angle's launch.
for i in ???: # loop over each angle
for j in ???: # loop over each time step
# check that the location isn't below the ground; if so, adjust as specified above
# calculate the acceleration including drag
# calculate the change in position at time `ts` using the current velocities (`vx[ i ][ j ]`) and the previous positions (`x[ i ][ j-1 ]`). This is slightly different from the previous example you solved in an earlier homework.
# 6. The purpose of these calculations was to show which angle yielded the farthest distance. Find this out and store the result in a variable named `best_angle`.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 16:40
Match each feature of e-publishing as an advantage, a disadvantage, a threat, or an opportunity. (choices) increased collaboration digitalized out-of-print versions monopoly over digital formats requirement for a specialized digital device pairs advantage of e-publishing disadvantage of e- opportunity for e- threat to e-
Answers: 1
question
Computers and Technology, 22.06.2019 13:00
Which option should u select to ignore all tracked changes in a document
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
In a compound condition, both conditions on either side of the logical operator and must be true for the overall condition to be true. a: true b: false
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Me dangers of social media and the internetexplain what each means: 1) social media and phones have become an addiction.2) outside people have access to you all the time.3) cyberstalking4) cyberbullying5) catphishing6) viruses7) identity theft8) credit card fraud9) hacking10) money schemes
Answers: 1
You know the right answer?
When Callista hits the ground, she stops. To simulate this, if her altitude is ever less than 0, set...
Questions
question
History, 02.01.2020 11:31
Questions on the website: 13722361