Zookal
Zookal

We’d love to hear any feedback or comment from you!

© 2011-2021 Zookal Pty Ltd

View question and answer

From our collection of questions and answers
Engineering · Computer Science
Question details

This is a Matlab problem, please answer this problem using Matlab coding. Please answer both of the questions

Vodafone AU WiFi , 10:21 PM mcpl.moodlesites.com QUESTION 2 3 MARKs Monte Carlo methods are a broad class of computational algorithms that rely on repeated random sampling to obtain numerical results. You have been asked to estimate the value of π using the Monte Carlo method. A number of randomised points is generated within the box of unit width, as shown in figure 2. Some of the points lie within the circle, while others lie outside the circle. The value of rt is calculated using the following expression: where Ne represents the number of points inside the unit circle, and Ns is the number of dots within the square. In figure 1, there are 17 points inside the circle and 20 points inside the square (Le. 3 points outside the circle). Therefore, π었 4217-3.4. This estimated value of π should become more accurate with an increasing number of points. Figure 2: Randomised points generated inside a box containing a unit circle. The procedure to perform the Monte Carlo method is listed below: 1. Generate a randomised point within a square containing a circle of unit radius 2. Determine N and N, and calculate the estimate of Tt 3. Repeat steps 1 and 2 for a specified number of points Complete the following tasks to perform the Monte Carlo procedure described above. Q2a In the Q2a m file, generate a 2x1 subplot arrangement where the top panel contains a circle of unit radius and a square with a width of 2 units, both centred at (x,y) (0,0) (see figure 3 for an example). Plot these shapes as black lines and set the axes to be square (option for axis). Details of the bottom panel are described in Q2b MCD4140 Assignment Page 6 of S Q2b nthea2bmfile prompt the user for a specified number of points to estimate π using the input() function. Generate your first randomised point by randomising its x and y-coordinates. The limits for the x and y coordinates should be imited to the bounds of the square (ie. from -1 to 1 in both directions). Plot this randomised point in the top panel of the figure as a red dot if it lies on or within the circle, or as a blue dot if it is outside the circle. Use a marker size of 15. After plotting your first randomised point, calculate the estimate of π and plot the result as a black dot in the bottom panel of the figure (see figure 3). The current estimate value of π should be stated in the title. 05 Estimate of pi 4.00000010:21 PM a mcpl.moodlesites.com .ll vodafone AU WiFi Estimate of pi 4.000000 024 06 0812141818 Figure 3: Plot after the 1t randomised point. Repeat the above instructions until the number of specified points is reached. Update the top and bottonm panels after each new point is created and pause for 0.1 seconds using the pause() function to create an animated effect. i.e. your top and bottom panels should populate with points over time (see figure 4 for examples). Snapshots of the figure after the 3d and 100th randomised points are shown in figure 4. You should have five figure windows by the end of this task Estimate of pl 2440 Estimate of pi 320000 1 12 1618 22 24 2 28 Figure 4: (Left) Plot after the 3d randomised point. (Right) Plot after the 100 randomised point. MCD4140 Assignment Page 7 of 9 QUESTION 3 Background You are part of a team working for the United Nations Environment Programme (UNEP) to investigate the deforestation process in Borneo. You are provided six images of the forest area in Borneo from 1950-2020, which comprise of historical and projection data. Forests are represented as green pixels and deforested areas as yellow pkels. MARKS Q3a In the Q3a m file, use the imread) function to read the images. For each year (1950, 1985, 2000, 2005, 2010, 2020), calculate the percentage forested area (PFA) which is defined as: for_ × 10096 = greenandyellow pixels greenpixels一一× 100% est area PFA total land area Write the year, forested area, total land area and PFA to a file named BorneoForestData.txt. The file should look like the following Total Land Area P PFA Year 1950 1985 ( % } ?23 F rest Area 2?? Hint: Green (forest) in grayscale 75 to 115 (inclusive) Light blue (water) in grayscale- 240 Black (text) in grayscale 0 All other colours in grayscale represent land You should stil have five figure windows by the end of this task 03b In the 036 m file, plot the PFA against the year as blue circles in a new figure. You believe that the data can be appropriately represented by either an exponential model or a 2d order polynomial model. Find the coefficients for each model based on the form of the equations below Exponential modet PFA = αeßt d order polynomial model: PFA * atbc11 vodafone AU WiFi 10:21 PM a mcpl.moodlesites.com , Hint: Green (forest) in grayscale 75 to 115 (inclusive) Light blue (water) in grayscale 240 Black (text) in grayscale 0 All other colours in grayscale represent land You should stil have five figure windows by the end of this task Q3b In the Q3bm file plot the PFA against the year as blue circles in a new figure. You believe that the data can be appropriately represented by either an exponential model or a 2d order polynomial model. Find the coefficients for each model based on the form of the equations below: Exponential model: PFA-αeßt * . 2 order polynomial model: PFA at bt e where a, B, a, b, c are coefficients, and t represents the year Plot both fitted models for years 1950 to 2100 (yearly increments) on the newly created figure. Print the equations of the fitted models to the command window using the exponential specifier for fprintf You should have six figure windows by the end of this task. MCD4140 Assignment Page 8 of 9 Q3c In the Q3cm file, perform the Newton-Raphson method on both models described in Q3b to estimate the year when Borneo will have no forests left. Perform the root-finding method using precision values of 1e-1, e-2, e-3 le-10, and present the results in a tabular structure in the command window similar to the following Year Polynomial Precision e-01 1e-02 1e-03 Exponential 2?? 2?? Print one sentence that states whether the exponential or polynomial model is more appropriate and provide justification for your choice. You should still have six figure windows by the end of this task. Q3d You are asked to further investigate the 2d order polynomial model considering the effect of neglecting the a coefficient. Thus, the two ordinary differential equations that may model the Boneo deforestation data are: Model 1 d(PFA) quadratic): datb Model 2 dPFA) (linear): dt where a and b are the coefficients from the 2d order polynomial model (see a3b). In the Q3dm file solve the annual PFA in Borneo by applying the midpoint method to both models. Use a step size of 0.001 years and the PFA value calculated for 1950 as the initial condition. The range of years should span 1950 to 2100. In a 1x2 subplot figure, plot the following: PFA obtained in Q3a against the year as blue circles. [both panels .PFA values obtained by solving Model 1 as a red line. [left panel] PFA values obtained by solving Model 2 as a blackline. [right panel] Remember to include a legend. Use fprintf to provide a one-sentence explanation for why model 2 does not provide an appropriate linear fit of the PFA data. You should have seven figure windows by the end of this task

Answer
Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.

Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.