Question: M5: Programming Assignment 2 Consider the motion of an object modeled with ideal projectile motion (neglecting air resistance). The trajectory of the object can be

M5: Programming Assignment 2 Consider the motion
M5: Programming Assignment 2 Consider the motion
M5: Programming Assignment 2 Consider the motion
M5: Programming Assignment 2 Consider the motion of an object modeled with ideal projectile motion (neglecting air resistance). The trajectory of the object can be derived frcm basic physics and is given by the formula: y=xtan21(sncos)2x2g+y0 The trajectory of the object can be derived from basic physics and is given by the formula: y=xtan21(v0cos)2x2g+y0 where y is the height in meters, x is the horizontal position in meters, is the inital angle, 8 is the acceleration due to gravity (9.81 m/s2). v0 is the initial velocity in m/s, and y0 is the initial height in meters. The fange, d, of the projectile is the total horizontal distance it travels betore hitting the ground and can be determined using the formula: d=Rv0cos(v0sin+(v0sin)2+2v0). The magnitude of the velocity of the projectile at any point along it's trajectory is given by v=v1+v2, where the x-component of velocity, vt, is unchanged from the initial velocity throughout the duration of the flight and given by v4=v0cos The y-component of velocily, vw at any elevation y can be computed from the kinematics equation v52=(V0sin)22xy. Consider a projectile taunched with the following initial conditions: - y0=2.0 meters - =30 degrees Consider a projectile launched with the following initial conditions: - y0=2.0 meters - =30 degrees - v0=25.0 meters/second Write a script that uses the given initial conditions and formulas to generate an ASCll format data file with the following data in each column (all saved in single precision ASCll format): 1. The first column should have 50 equally-spaced x-values starting at 0 and ending at d. 2. The second column should have 50 y-values that give the height of the projectile corresponding to each x value in the first column. 3. The third column should have the magnitude of the velocity corresponding to each (x,y) point specified in the first fwo columns. Save the data fiee with the name Projectilekinematics. dat. Note that the file should only include the data in single precision ASCII format and no column headings. All computations should be done using double precision, however. Note: You are writing a script, NOT a function. Hint: You may use bult-in functions for the trigonometic functions (sin, cos, tan) in above formulae, but pay close attention to the unit of angle being used in this problem. More details on these functionns can be found in zyBooks Ch. 3.4. M5: Programming Assignment 2 Consider the motion of an object modeled with ideal projectile motion (neglecting air resistance). The trajectory of the object can be derived frcm basic physics and is given by the formula: y=xtan21(sncos)2x2g+y0 The trajectory of the object can be derived from basic physics and is given by the formula: y=xtan21(v0cos)2x2g+y0 where y is the height in meters, x is the horizontal position in meters, is the inital angle, 8 is the acceleration due to gravity (9.81 m/s2). v0 is the initial velocity in m/s, and y0 is the initial height in meters. The fange, d, of the projectile is the total horizontal distance it travels betore hitting the ground and can be determined using the formula: d=Rv0cos(v0sin+(v0sin)2+2v0). The magnitude of the velocity of the projectile at any point along it's trajectory is given by v=v1+v2, where the x-component of velocity, vt, is unchanged from the initial velocity throughout the duration of the flight and given by v4=v0cos The y-component of velocily, vw at any elevation y can be computed from the kinematics equation v52=(V0sin)22xy. Consider a projectile taunched with the following initial conditions: - y0=2.0 meters - =30 degrees Consider a projectile launched with the following initial conditions: - y0=2.0 meters - =30 degrees - v0=25.0 meters/second Write a script that uses the given initial conditions and formulas to generate an ASCll format data file with the following data in each column (all saved in single precision ASCll format): 1. The first column should have 50 equally-spaced x-values starting at 0 and ending at d. 2. The second column should have 50 y-values that give the height of the projectile corresponding to each x value in the first column. 3. The third column should have the magnitude of the velocity corresponding to each (x,y) point specified in the first fwo columns. Save the data fiee with the name Projectilekinematics. dat. Note that the file should only include the data in single precision ASCII format and no column headings. All computations should be done using double precision, however. Note: You are writing a script, NOT a function. Hint: You may use bult-in functions for the trigonometic functions (sin, cos, tan) in above formulae, but pay close attention to the unit of angle being used in this problem. More details on these functionns can be found in zyBooks Ch. 3.4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!