Question
can someone answer as soon This is the Assignment 11 Write (in C++) a program that uses Euler's method to solve the following problem: Assume
can someone answer as soon
This is the Assignment 11 Write (in C++) a program that uses Euler's method to solve the following problem: Assume the trajectory of a cannonball, including the effects of atmospheric drag, is given by the equations where , , and . Suppose we launch a cannonball at an angle of above the horizon with a speed of . How far does the cannonball travel horizontally and what timestep size ( ) did you have to use to find your answer? You should put your answers in comment statements in your header block along with the results of a convergence test. Hint: You will have to terminate your calculation when the cannonball comes back to approximately ground level. If your last timestep took the cannonball below ground level, the last timestep was too large and you should reduce the size of the last timestep and use the reduced timestep until you are approximately at ground level. You can use an if construct with a continue statement within a loop to adjust your timestep size as needed to accomplish this. Submit the source code file, i.e. the .cpp file containing the C++ code, by uploading it into blackboard using the attachments button under the assignment.
with given equations of Euler's method as follow.
dx/dt = vx ---------------eq(1)
dy/dt = vy---------------eq(2)
dvx/dt = -alphavvx----------------------eq(3)
dvy/dt = -alphavvy -g---------------------eq(4)
and another part of the problem as given the following values, such as
g=9.8m/s^2 , alpha = 4X 10^-5, V=SQRT(VX^2 + VY^2), V=700M/S^2
based on the above information in the problem i have to solve for this next Assignment 12 such as
Rewrite (in C++) a your Euler's method program to use the 4th order Runge-Kutta algorithm to do the integration for the cannonball problem specified in Assignment 11. The program should use C++ functions for the problem specific parts (initial conditions, number of equations, the right-hand-sides of the ODEs) and dynamic arrays so that the main driver program is generic (no problem specific information in the main program!). Put the function prototypes in a namespace declared within a header file. Package the problem specific function definitions into a separate file C++ code file. The main program should be in it's own file. What timestep were you able to use (compared to your Euler algorithm code) with the 4th order Runge-Kutta algorithm (note this information in the header of the file containing the function definitions)? Upload all three files (your main program, your header file, and your file containing the function definitions) into Blackboard one at a time.
The folumas taken from physics
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