Enter Values:v (velocity),theta (launch angle),Initialize Variables:1=0 (time),tstep = 0.1 (time step between calculations)=32 (Gravitational constant in ft per sec2)Find velocity components...

1 answer below »
The assignment details are in the images I attached. As long as I get code I can copy into my compiler I will be happy.


Enter Values: v (velocity), theta (launch angle), Initialize Variables: 1=0 (time), tstep = 0.1 (time step between calculations) =32 (Gravitational constant in ft per sec2) Find velocity components before loop: theta = theta * PI/ 180.0; vi=v*cos(theta) v,~v*sin(theta) Create a Loop (with everthing below inside of if) t=t+ step Create a trajectory function that does the following (call it inside this loop): pass, vi, vy to the trajectory function y=w*t-05*a*t? (Calculate height) X=v tt (Calculate horizontal distance ) Print time, x distance and y height 11 also detect max height (max y value) then print when it happens retum y Loop Until y <= 0="" (until="" missile="" has="" hit="" the="" ground)="" in="" order="" to="" detect="" max="" height="" and="" last="" values="" inside="" of="" the="" function="" define="" static="" values="" (for="" full="" credit)="" to="" hold="" the="" previous="" values="" of="" x,="" y="" and="" t.="" also="" notice="" that="" the="" last="" value="" of="" height="" is="" 0="" and="" the="" corresponding="" distance="" and="" time="" values="" must="" be="" linearly="" interpolated="" for="" full="" credit.="" le="" initial="" velocity="" £t/5="">40 TEST) 83 yer RT RT Correct data and function call inside of loop (80%) Detect Max Height (10%) Calculate Linear Interpolated last values10%) Submit a screen shot and printout of your code Calculation with distance of a target Enter Values: v (velocity), theta (launch angle), dist (target distance), range (error margin or acceptable radius for "hit" ) Initialize Variables: t=0 (time), tstep = 0.1 (time step between calculations) a=32 (Gravitational constant in ft per sec2) Find velocity components: va=v¥cos(theta) Vy=vAsin(theta) Loop through all combinations: Repeat t= t+ tstep (Increment time step) =v, *1-05 *a* t* t (Calculate height) X = vx * t (Calculate horizontal distance ) plot(x,y) (Plot position of projectile ) Until y <= 0="" (until="" missile="" has="" hit="" the="" ground)="" test="" for="" accuracy:="" if="" abs(x-dist)="">< range then result = hit else result = miss figure 2: trajectories at 60 degree angle 140 ft/sec and 150 ft/sec range="" then="" result="Hit" else="" result="Miss" figure="" 2:="" trajectories="" at="" 60="" degree="" angle="" 140="" ft/sec="" and="" 150="">
Answered Same DayNov 15, 2022

Answer To: Enter Values:v (velocity),theta (launch angle),Initialize Variables:1=0 (time),tstep = 0.1...

Vikas answered on Nov 15 2022
40 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here