Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3) Part C: Create a Main Script for Simulation: Main.m Step C-1. Create a script file Main.m which is the main code for the
3) Part C: Create a Main Script for Simulation: "Main.m" Step C-1. Create a script file "Main.m" which is the main code for the simulation of the given 4 objects Step C-2. Reset your system first by using "close", "c""" System Reset close all; clear; ele Close All Figure Windows Renoves All Variables from the current workspace % Clear Command History Step C-2. Load the initial data "Data" (-Step A-1) Initial Data load(Data.mat); Step C-3. Check that the initial data "Tatamar" is valid by using your function "Input Check(" Step C-4. Set the update time interval (dt) and the current time (as d-0.0005 and 1-0. (If there is anything else you need to declare before a simulation, feel free to do it.) Step C-5. As the time (1) increases by dt, use your functions "Accel" and "Ped Euler" to the trajectories of the objects from the initial data until one of the following conditions is met If reaches 1000, stop and display the following message. "No Collision in Expected If any of the asteroids collide with Earth first, stop and display the following message. (The blue-colored values above are decided depending on the simulation result) We assume a collision if the distance between two bodies becomes less than or equal to 0.82 Step C-5. Every time the new positions of the objects are updated, you need to plot them as following The plot is showing all objects ever x1-30,30] and y (-30,30]. Here are the common settings you should apply to the above plots. 00 Object Symbol (Marker): Ciedle (We don't consider the diameter of each object) (b) All objects should be of a different color (No need to use the same color as the example above) (c) Figure Window Size: 550 x 500 (Width x Height) (d) Display grid lines, and set the grid interval as 10 for (e) Plot them every 0.5 time units and pause code execution for 0.001 sec right after every plotting by using a "pe (0.001" function. Additionally, if the earth collides with any asteroid, plot them again at the collision moment
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