Question: This is a MATLAB problem. Please solve the part 4 in MATLAB and you don't need to solve the part 2. If you have any





This is a MATLAB problem. Please solve the part 4 in MATLAB and you don't need to solve the part 2. If you have any question, please ask me ASAP.
Part 4 Total Solar Eclipses (TSEs) follow a pattern. They happen almost every 18 months. This mean to accurately calculate when solar eclipses happen, you need to consider the Saros cycle. The Saros cycle is a period of approximately 6,585.3 days (18 years 11 days 8 hours). Open the data file provided with this assignment. Feel free to change the formatting of the data if needed. You may delete or rearrange the data as you see fit. After doing so, save your file into any format that you can work with in Matlab. For this week, I want you to accomplish the following [20 points each]: 1. 2. Import the CSV file (or your formatted file) using the function dinread. Use the two pairs of TSE dates in Saros 127 (Happening in 6/21/2001 and 7/2/2019) and Saros 142 (Happening in 12/4/2002 and 12/14/2020) to calculate the Saros cycle. Do that in a function file called "SarosCycleCalc.m". Print out your calculation on the command window.+ 3. Compare your calculation in part 2 with the known Saros cycle of 6,585.3 days. Is it accurate? If it is not, write your answer in the box below on what is the reason behind the difference between your calculations and the accurate cycle duration? How would you fix that?* In order to enhance your estimation, change your algorithm and/or the Matlab functions you are using to calculate the difference between the two TSE dates in a single Saros (Don't delete your code from part 2, keep your answer for part 2 in your code. Create a new function called "EnhancedSasCyleCalc.m" for this part) Print out your enhanced calculation of the Saros cycle on the command window. [Self-check: you should be closer to 6,585.3 days (18 years 11 days 8 hours].Hint: Try using the following functions datenum' and'datevec. Use Matlab help to learn how they work 4. 5. Use your enhanced Saros cycle estimation and calculate 9 future TSE's that correspond Saros 152,139, 126,, 145. a. Print your estimations on the command window,+ b. Save your predictions of future TSE dates on the same data file that you have imported. Save them as new rows below the existing dates. (You only need to add the date and Saros number). [Hint: Use dimvrite function with the -append' attribute]' Self-check:* Date Saros 04/12/2021* 08/0x/2024 12/0x/20xx 02/08/2027* 22/07/20xx xx/xx/2030 xx/xx/2033 20/03/2034 02/09/2035 152 139 126 136 146 133- 1200 130 145 Answers will be acceptable for +/- 10 days around the correct answer. Extra points for accurately estimating the exact date." Part 2 This Part will help your program be more usable and flexible. Apply the following improvements to your code from Part 1 so it does the following: Ask the user for the required budget. (In HW2 we assumed that it takes $3,000 to travel to a solar eclipse. Some people would like to buy samera's and gear. So we want them to define their own required budget) Ask the user to input their daily savings starting from 1-1-2018 Ask the user to input a initial savings budget. Which is how much money would you deposit to your savings for this project on 1-1-2018. (aote that you started with zero balance in the past homework. Using loops and if statement, identify all future total solar eclipse events that you will be able to afford to go to. ' Test your code using parameters: a) b) c) d) Required budget $4000 Daily Savings (starting from January 1st 2018- $4. Initial savings $200 How many eclipse events an you choose to attend out of the next 6 upcoming eclipses e) [Extra credit +25pts] Using if statement, adjust your program to print an e) [Extra credit +25pts] Using if statement, adjust your program to print an appropriate response if the savings budget won't allow you to attend any of the Self check: the output should look like this: With a required budget of $4000, you can attend the following total solar eclipse(s): A total solar eclipse that occurs at 10xx days with a savings balance of $4x1x A total solar eclipse that occurs at 14xx days with a savings balance of $5xx6 A total solar eclipse that occurs at 1xxx days with a savings balance of $7xx8 A total solar eclipse that occurs at 2xxx days with a savings balance of $9xx0 A total solar eclipse that occurs at 3x4x days with a savings balance of $12xxx Self-check for the EC: What is your required budget>$9999. How much will you save per day>S1 Do you have an initial savings amount that you want to put aside>SO You will not be able to attend any ecdlipse in the next 3147. In this number of days, you will be having $ 3147 only in your savings Date (DD/NM/YYYY) M Time of greatest Saros Type Magnitude Central duration (min:s) 1 6/21/2001 2 12/4/2002 3 11/23/2003 43/29/2006 5 8/1/2008 6 7/22/2009 77/11/2010 8 11/13/2012 93/20/2015 12:04:46 7:32:16 22:50:22 10:12:23 10:22:12 2:36:25 19:34:38 22:12:55 9:46:47 1:58:19 18:26:40 19:24:08 16:14:39 21 2001 2002 2003 2006 2008 2009 2010 2012 2015 2016 2017 2019 2020 127 Total 142 Total 152 Total 139 Total 126 Total 136 Total 146 Total 133 Total 120 Tota.l 130 Total 145 Total 127 Total 142 Total 1.05 ## 1. 024 1.038 # 1.052 1.039 ### 12 23 29 1.08 ## 13 20 9 21 1, 05 1.045 1.045 ## 1.031 ## 10 3/9/2016 11 8/21/2017 12 7/2/2019 13 12/14/2020 12 14 1.025 ###
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
