Problem 1 From elementary physics and Homework #1, we know...

This preview shows page 1 - 4 out of 17 pages.

Week 5 Homework ENGR 112 Fzero while Name: Taylor Kish Lab Time T 1400 Names of people you worked with: Websites you used: Approximately how many hours did it take you to complete this assignment (to nearest whole number)? 7 By writing or typing your name below you affirm that all of the work contained herein is your own, and was not copied or copied and altered. Taylor Kish Note: Failure to sign this page will result in a 50-point penalty. Failure to list people you worked with may result in no grade for this homework. Failure to fill out hours approximation will result in a 10-point penalty. Turn .zip files to Canvas or your assignment will not be graded
Week 5 Homework ENGR 112 Fzero while Learning Objectives: More practice with for loops and if statements More practice with using functions as inputs to other functions More practice writing functions Homework Guidelines: 1) Whenever you create a function, you must decide what goes into the function and what goes into the calling script. For example, do you pass gravity in as a variable or do you just set it in the function? Document your choices. 2) There is more than one right way to answer these homework problems. If you come up with a different answer than your fellow classmates, discuss the relative merits of each answer (is it clear? Is it more/less generalizable?) Specific Coding Notes: Debugging: Set a break point at the first line of your function file. This way, you can see what happens in the function file. First, check that the parameters that got passed in have the values you expect. Second, make sure the output variable(s) are set correctly. Grading Checkpoints Criteria Component No Yes [20%] Comments and Pseudocode Declared units on all variables? English description of problem at top? Comments outlining your steps? [10%] Output formatting Used fprintf() to make complete sentences (when required)? Correct units on answers? Correct number of decimal places? [70%] Functionality Script computes correct value(s)? Correctly converted units in script when needed?
Week 5 Homework ENGR 112 Fzero while Problem 1 From elementary physics and Homework #1, we know that the distance a projectile travels when fired from a cannon depends on both the initial velocity v and the launch angle θ: ?(𝑡) = 𝑣 𝑡 cos(𝜃) ?(𝑡) = 𝑣 𝑡 sin(𝜃) − 1 2 𝑔𝑡 2 where x(t) and y(t) are the distances traveled in x and y, respectively, after time t has passed (g is gravity, g = 9.8 meters/second 2 ). Assume an initial velocity of 13.5 meters per second and an angle of 89 degrees above the ground. Use fzero to find the time and x location where the projectile hits the ground . Print the time and location to 4 decimal places.
Comments for grader/additional information (if any) Script File %Taylor Kish 5/7/20 Homework 5 Problem 1 clear clc v0=13.5; %initial velocity g=9.8; %acceleration due to gravity theta=89; %degrees above the ground t0=2*v0/g; %initial position tloc=fzero(@distance,t0); %time location xloc=v0*cosd(theta)*tloc; %x location fprintf(

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture