Question
Modern Computation Methods Project 1: Projectile Path Calculated Using Euler Methods Introduction The goal of this project is to modify an existing Matlab script that
Modern Computation Methods Project 1: Projectile Path Calculated Using Euler Methods Introduction The goal of this project is to modify an existing Matlab script that currently plots the path of a projectile (see Example 3.7 in your textbook). The current script uses the standard equations of motion from Dynamics that are developed without drag forces (air resistance). Your task in this project is to modify the code in two ways.
First, the path of the projectile is to be calculated using an Euler approximation with drag forces included in the calculation. In this first part of the assignment, you are to assume (hard-code) a 10 m/s headwind (i.e., acting in the x direction). Other parameters to be used in the Euler approximations will be provided below.
Second, after successful completion of part 1, you are to modify the code such that a projectile target game (similar to our in-class project) can be played using your new projectile code; in this code, the location of the target will be randomly generated and the value of the wind speed will also be randomly generated. The path of the projectile must be calculated using Euler approximations as developed in part 1.
Algorithm & Pseudo-code Before you begin programming, you should always have a plan in mind. Figure out a procedural way to accomplish your task, then figure out the code to make it happen. For this assignment, begin with the existing script (Example 3.7).
For the Euler approximations, you may have to draw a FBD of the projectile to figure out what the governing ODEs look like for each coordinate direction of motion. Assume that the drag force, Fd, is proportional to velocity squared (i.e., Fd = Cd*v2)). Note that a different value of Fd must be calculated for each coordinate direction; the velocity used in the calculation of drag force is the objects velocity relative to the air. Furthermore, note that the direction of drag force will change depending on the direction of travel of your object (e.g., if your projectile is moving upward, drag force is acting down; if it is falling downward, drag force is acting upward). Additionally, for part 1 of the assignment, you should assume the following:
1. The projectile weighs 1.5 kg. It has a Coefficient of Drag (Cd) of 0.10 N-s2/m2. Gravity has a value of 9.81 m/s2.
2. Use a time increment (t) of 0.01s.
3. Assume that a 10 m/s headwind (acting in the x direction) is present. 4. To verify that your code is working, report the location of the projectile after 1.5s have elapsed assuming the projectile is launched at 50 m/s at 45 above horizontal. Once you have completed the Euler Approximation in part 1, use that code to create a Projectile Game in part 2. Within that, your code should have the following features and use the following assumptions: 1. The projectile weighs 1.5 kg. It has a Coefficient of Drag (Cd) of 0.10. Gravity has a value of 9.81 m/s2.
2. Use a time increment (t) of 0.01s.
3. Display a target in a random location. Your figure window to be displayed must have axis limits from 0 to 30 m in both the x and y directions. The target must be located in a random location generated in the with x and y values greater than 10 but less than 30.
4. Wind acts in the x direction, but is variable. For each game, generate a random value of wind between -10 and + 10 m/s and provide that value to the user before they input their selection for initial launch velocity and angle.
5. The code must contain a loop that allows the user to play until a hit is achieved. The target must stay in the same location until a hit occurs. A hit is determined if the projectile comes within 0.25m of the center of the target. Use the Pythagorean theorem to determine if the projectiles path ever comes within this tolerance/radius; a square-shaped hit box is not allowed.
6. The projectiles path should be plotted until its y-position is below 0m or until it has successfully struck the target
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started