Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATLAB QUESTION COMPUTER SCIENCE / MATHEMATICAL COMPUTING WORLD Population File: https://file.io/zITnpZ With roughly 83 million people being added to the world's population every year, the

MATLAB QUESTION

COMPUTER SCIENCE / MATHEMATICAL COMPUTING

WORLD Population File: https://file.io/zITnpZimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

With roughly 83 million people being added to the world's population every year, the upward trend in population size is expected to continue. The current world population of 7.6 billion is expected to reach 8.6 billion in 2030, 9.8 billion in 2050 and 11.2 billion in 2100, according the United Nations' World Population Prospects1 You have been asked to analyse the world population using the latest data released by the United Nations. Countries are grouped geographically into six major areas designated as: Africa, Asia, Europe, Latin America and the Caribbean, Northern America, and Oceania. The population data from 1950 2015 for the six major areas in the world is given in a data file named World Population.xlsx. The population data for each area are arranged as below: Africa: Asia: Europe: Latin America and the Caribbean ndex 162 209 Northern America: Oceania: Index 2-59 Index 61- 111 Index 113 160 Index 211-215 Index 217 -239 Note: The population data given is in thousands Q2a In the Q2a.m file, use importdata() to import the population data of each country from the data file called World Population.xlsx. Calculate the total population of each year for each of the six major areas Plot the total population against year for the six major areas in the same figure. Ensure that your plot can clearly show the population data of all six major areas. Include a legend at the top left corner. Calculate the world total population for 2015 and include it in the title of your plot. Subsequently, write the total population of 2015 for the six major areas to a file named "TotalPopulation2015.txt". The txt file should look like the following: Total Population of 2015 (in thousands) Area Africa Asia Q2b In the Q2b.m file, perform curve fitting to the total population data of each area in Q2a using 2nd order polynomial model, Population = at2+ bt + c, where a, b, and c are coefficients and t represents the year. Use fprintf) to print the curve fitting equations to the command window using the exponential specifier with 2 decimal places. In a 2x3 subplot arrangement, plot the total population against year using green circle and its respective curve fitting model using red line for all six major areas. Ensure that all subplots are labelled with the area name accordingly. You should have five figure windows by the end of this task. Q2c In the Q2c.m file, use fzero) to determine the major area that reaches 1.5 times of its population at 2015 (from the data) within the shortest time (least number of years). Use fprintf) to print a single line answer to the command window Hint: You will need to use function handle to create an anonymous function for root finding. Q2c In the Q2c.m file, use fzero() to determine the major area that reaches 1.5 times of its population at 2015 (from the data) within the shortest time (least number of years). Use fprintf) to print a single line answer to the command window. Hint: You will need to use function handle to create an anonymous function for root finding. Q2d The world map given in the template, world map.bmp, is coded using values of 0-6. These values represent the 6 major areas and the background: Africa: Asia: Europe Latin America and the Caribbean: Northern America: Oceania: Background: 4 6 In the Q2d.m file, import the image into MATLAB as 2D array and reassign the values so that the six major areas are represented in different shades based on its total population of year 2015. The highest population should be assigned with the value 219, followed by 182, 146, 109, 73 and 36. The background remains as 0. Show the re-coded image in a new figure. Hint: You will need to use (but not limited to) the following MATLAB functions: imread(), imshow(). Q2e The logistic growth model below is often used to describe the population growth dP dt = rP(1-K) where r is the population growth rate and K is the maximum population. In the Q2e.m file, iterate through possible values for parameters r and K to fit the ODE model for the population of Malaysia. Use the population of Malaysia at 1950 as the initial value for your ode45() function. Your code should find the best parameters for r and K, where the mean absolute error (as compared to the Malaysia population raw data) is at a minimum. Plot the population of Malaysia against year from the raw data and the population obtained from the ODE model in the same figure. Print the value of r and K in the title of your figure. Hint: The population growth rate, r ranges from 1.8%-3.5%. You should iterate r at a resolution at 0.001. Hint: The maximum population is less than 80million. You can start iterating K at 50 million and at a resolution of 1million. Note: The population data given is in thousands. With roughly 83 million people being added to the world's population every year, the upward trend in population size is expected to continue. The current world population of 7.6 billion is expected to reach 8.6 billion in 2030, 9.8 billion in 2050 and 11.2 billion in 2100, according the United Nations' World Population Prospects1 You have been asked to analyse the world population using the latest data released by the United Nations. Countries are grouped geographically into six major areas designated as: Africa, Asia, Europe, Latin America and the Caribbean, Northern America, and Oceania. The population data from 1950 2015 for the six major areas in the world is given in a data file named World Population.xlsx. The population data for each area are arranged as below: Africa: Asia: Europe: Latin America and the Caribbean ndex 162 209 Northern America: Oceania: Index 2-59 Index 61- 111 Index 113 160 Index 211-215 Index 217 -239 Note: The population data given is in thousands Q2a In the Q2a.m file, use importdata() to import the population data of each country from the data file called World Population.xlsx. Calculate the total population of each year for each of the six major areas Plot the total population against year for the six major areas in the same figure. Ensure that your plot can clearly show the population data of all six major areas. Include a legend at the top left corner. Calculate the world total population for 2015 and include it in the title of your plot. Subsequently, write the total population of 2015 for the six major areas to a file named "TotalPopulation2015.txt". The txt file should look like the following: Total Population of 2015 (in thousands) Area Africa Asia Q2b In the Q2b.m file, perform curve fitting to the total population data of each area in Q2a using 2nd order polynomial model, Population = at2+ bt + c, where a, b, and c are coefficients and t represents the year. Use fprintf) to print the curve fitting equations to the command window using the exponential specifier with 2 decimal places. In a 2x3 subplot arrangement, plot the total population against year using green circle and its respective curve fitting model using red line for all six major areas. Ensure that all subplots are labelled with the area name accordingly. You should have five figure windows by the end of this task. Q2c In the Q2c.m file, use fzero) to determine the major area that reaches 1.5 times of its population at 2015 (from the data) within the shortest time (least number of years). Use fprintf) to print a single line answer to the command window Hint: You will need to use function handle to create an anonymous function for root finding. Q2c In the Q2c.m file, use fzero() to determine the major area that reaches 1.5 times of its population at 2015 (from the data) within the shortest time (least number of years). Use fprintf) to print a single line answer to the command window. Hint: You will need to use function handle to create an anonymous function for root finding. Q2d The world map given in the template, world map.bmp, is coded using values of 0-6. These values represent the 6 major areas and the background: Africa: Asia: Europe Latin America and the Caribbean: Northern America: Oceania: Background: 4 6 In the Q2d.m file, import the image into MATLAB as 2D array and reassign the values so that the six major areas are represented in different shades based on its total population of year 2015. The highest population should be assigned with the value 219, followed by 182, 146, 109, 73 and 36. The background remains as 0. Show the re-coded image in a new figure. Hint: You will need to use (but not limited to) the following MATLAB functions: imread(), imshow(). Q2e The logistic growth model below is often used to describe the population growth dP dt = rP(1-K) where r is the population growth rate and K is the maximum population. In the Q2e.m file, iterate through possible values for parameters r and K to fit the ODE model for the population of Malaysia. Use the population of Malaysia at 1950 as the initial value for your ode45() function. Your code should find the best parameters for r and K, where the mean absolute error (as compared to the Malaysia population raw data) is at a minimum. Plot the population of Malaysia against year from the raw data and the population obtained from the ODE model in the same figure. Print the value of r and K in the title of your figure. Hint: The population growth rate, r ranges from 1.8%-3.5%. You should iterate r at a resolution at 0.001. Hint: The maximum population is less than 80million. You can start iterating K at 50 million and at a resolution of 1million. Note: The population data given is in thousands

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions