Develop a MATLAB function that uses an Euler numerical integration method to sol
ID: 2086289 • Letter: D
Question
Develop a MATLAB function that uses an Euler numerical integration method to solve the equations of motion shown above. Your function should take as an input a step size dt, the initial velocity of the cannon ball, the firing angle and the drag coefficient k and it should output three arrays t, x and y which represent the position trajectory of the cannon ball versus time from the initial launch up to the point that the cannon ball lands back on a flat ground (i.e. y = 0). Assume the launch starts from (x,y) = (0,0). Inside your function you should iteratively evaluate the velocity (vx, vy) and position (x, y) at each timestep by integrating the equations above and dx/dt = vx, dy/dt = vy
dt dtExplanation / Answer
if t(n)<tf t(n+1) = tf; n = n+1; t(n)=tf; end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.