ME 76 Final Project Game of Thrones Military Fleets Cannon Simulation with Graphical User Interface (GUI) Major military fleets in the Seven Kingdoms fire cannons to destroy the enemies in range. Firing cannons into the sea produces no glory in battles. Write a MATLAB program using Graphical User Interface Development Environment (GUIDE) to help the Game of Thrones special effect team to simulate the cannonball special effect prior to shooting the cannonball scenes on camera. Add a picture Axes to show a picture of the ship captain's ship in GUI when the program starts. Add another figure Axes in GUI to plot the figure. Add another picture Axes to show a picture of the enemy ship in GUI when the program starts. Add an angle Slider for the special effect team to slide the cannonball shooting angle between 0 and 90 degrees. Add an angle Edit field (Numeric) in GUI. The angle Slider position value should show in the angle Edit field (Numeric). Add an initial velocity Edit field (Numeric) in GUI for the special effect team to enter the initial velocity of the cannonball in meters per second ($m/s$). Add a distance Edit field (Numeric) in GUI for the special effect team to enter the horizontal distance between the cannon and the bow of the enemy ship in meters ($m$). Add a simulation time Label in GUI. This text box will be used to show time in seconds for the projection motion simulation. Add a result Label in GUI. This text box will be used to show whether the cannonball hits or misses the target. Add additional Label boxes in GUI to label different GUI components.
Added by Tonya H.
Close
Step 1
The program should include a GUI with elements to input initial velocity, angle, distance to target, and display the simulation time and whether the cannonball hits or misses the target. The GUI should also display images of the ships. Show more…
Show all steps
Your feedback will help us improve your experience
Sri K and 81 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
QUESTION (1) | 35 Pts] The dynamic of a projectile fired at an initial velocity (vo in m/s) and angle (a in rad) is described by the following set of equations as a function of time (t) : Height : h = v₀ ∙ sin(a) ∙ t − ½ ∙ g ∙ t² Distance : d = v₀ ∙ cos(a) ∙ t Where, vo=100m/s, a=π/6, g is the acceleration due to gravity (9.8 m/s²) and time range (t) from 0 to 50 containing 100 values. The purpose of this exercise is to write a Matlab program that does the following: (a) Define t range and global data (v₀, a, g) (b) Compute (h) and (d) for all t using the function trajectory having (t) as input and (h,d) as output (c) Find the max value of h and its index (h_max and h_ind) (d) Make multiple plots as indicated : Plot (h vs t ) in red color and (d vs t) in dashed blue color, h vs d in triangular markers (e) Add x-axis and y-axis labels and the title for the graphs ! (f) Reproduce axis limits in h versus d and place the value of h_max at its coordinates
Sri K.
Basic Operation for Projectile Motion /Intro Simulation: Click on minimizer button on the top left of screen. Hold and drag the Canon to vary height H = 0 and adjust the angle ̘ (̘ = 90° for Table 1). Choose Initial Speed v0y = 25 m/s (follow Table). Press the Red Button on the bottom of screen to launch the projectile. Drag the Timer/Range tool out of toolbox and place the probe on the maximum height to measure time reaching maximum height t1 and maximum height Hmax. Drag the Timer/Range tool out of toolbox and place the probe on the landing position to measure the total Time t2 . Calculate g value using g = v0y / t1 and final velocity just before touching the ground using vfy = v0y – g∙ t2 . Repeat the process to complete the Data Table. Test and understand all functional tools on screen. You must practice figuring out what is the best way to complete the measurement. Data Table 1: Angle ̘ = 90°, Vary Height of Canon H and Initial Velocity v0y Measure Time t1 reaching to maximum height Hmax and Total Time t2. Calculate g value (g = v0y / t1 ) and final velocity vfy = v0y – g∙ t2 (use measured g value). Attach a screenshot of Data H = 0 m from the Simulation to lab report. H (m) | v0y (m/s) | t1 (s) | Hmax (m) | t2 (s) | g = v0y / t1 (m/s²) | vfy (m/s) 0 | 25 | | | | | 5 | 20 | | | | | 10 | 15 | | | | | 15 | 10 | | | | | 15 | 14 | | | | |
Keerti J.
Akash M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD