Scatterplot of data with intensity of light transmission

Assignment Help MATLAB Programming
Reference no: EM131332488

QUESTION 1

Background

Climate change is a change in global or regional climate patterns, in particular a change apparent from the mid to late 20th century onwards and attributed largely to the increased levels of atmospheric carbon dioxide produced by the use of fossil fuels. The CO2 emissions (kt) from nine countries since year 1990 have been given in the text file ‘CO2_Emission.csv'. Each of the nine countries have been annotated with a country ID as given below:

Country ID

Country

1

Argentina

2

Australia

3

Belgium

4

China

5

Denmark

6

France

7

Malaysia

8

United Kingdom

9

United States

Q1a

Write Matlab scripts in a M-file (Assn_Q1.m) that will read data from ‘CO2_Emission.csv' (skip the text lines) and store the data in a matrix called ‘emission'. You shall not use import wizard to load the data from the text file.

Output the size of the matrix ‘emission' to the command window.

Then using the command ‘fprintf', to print out the data read from the text file following the format as follows:

CO2 emission (kt) by year

Country

1990

2000

2007

2008

2009

2010

2011

2012

2013

Argentina

112613.6

142136.6

175176.3

189107.2

179961.7

187919.1

191633.8

192359.8

189818.6

Australia

263705

329443.3

372090.5

385904.1

394792.9

372798.2

376710.9

375456.8

377906.4

Belgium

106049.6

115118.1

103545.1

104443.5

100259.4

107751.1

98917.33

92195.71

93618.51

China

2460744

3405180

6791805

7175659

7618684

8767878

9724591

10020745

10249463

Denmark

50230.57

51330.67

50256.24

46933.93

44510.05

46640.57

40645.03

36405.98

38067.13

France

375632.8

362090.6

368914.9

366069.3

351632.3

352769.1

331537.1

332956.3

333191

Malaysia

56592.81

125734.1

184816.8

204031.9

198802.7

218476.2

220405

218707.2

236510.5

United Kingdom

555924.5

541784.6

528425.7

520072.3

471400.2

493607.5

447935.1

467197.8

457472.9

United States

4823557

5701829

5794923

5622464

5274129

5408869

5305280

5115806

5186168

Q1b

Based on the data read from "CO2_Emission.csv", write Matlab scripts in the same M-file (written in Q1a) to:

i. Compute average CO2 emission for each of the nine countries.
ii. Compute average CO2 emission for each year
iii. Find out the country with highest average CO2 emission.
iv. Find out the year with highest average CO2 emission.
v. Find out how many countries with their CO2 emission higher than the average emission in year 2010

Use fprintf command to display your output.

Q1c

In the same M-file, write Matlab script to figure out the country with highest hike and largest decrement in the CO2 emission between year 1990 and 2013 respectively.

Use plot command to create a red line chart to show only the trend of CO2 emission for the country with highest hike between year 1990 and 2013.

In the same figure, plot another blue line chart to show only the trend of CO2 emission for the country with largest decrement between year 1990 and 2013.

Note:
You have to create two separate plots which are juxtaposed in a same figure for the task mentioned above. (Hint: Use subplot)

You need to include relevant title, x-axis & y-axis labels and the identified country name in the legend of the plots.

QUESTION 2

Background

Visible light is the reason we can see anything at all. Light moves as a wave, bouncing off objects so we are able to see them. Transmission of light is a phenomenon when light waves move all the way through a material without being absorbed. When light moves through a transparent (or semi-transparent) material, it can be transmitted, absorbed or reflected.

Experiments measuring the intensity of light transmitted through specimens of a transparent solid of various lengths are given in a text file (LightTransmit.txt).

Note: When attempting the each of the following tasks, ensure all units in your data are consistent, i.e S.I units. You cannot mix units.

Q2a
Write Matlab scripts in a M-file (Assn_Q2.m) that will read data from ‘LightTransmit.txt' (skip the text lines). Unfortunately, there are a few ‘noises' in the dataset (those data with It value higher than 10) and your Matlab program should skip those data as well and store the rest of the data in a matrix called ‘transmission_data'. You shall not use import wizard to load the data from the text file.

Then, use scatter command to create a scatterplot of data with intensity of light transmission, It, versus length of the transparent solid, L. You need to include appropriate title, legend and label of x-axis and y-axis in your plot.

Q2b

Based on the data distribution pattern observed in your scatter plot from Q2a, you predict the relationship between the intensity of light transmission and the transparent solid length could possibly be related by a polynomial equation. Perform a polynomial fit with a third order polynomial and make a plot for the polynomial equation which is overlaid with the scatter plot from Q2a. You should also create 50 interpolated data points onto your plot which are shown as red dots.

Hint: You may need to use the Matlab built-in functions polyfit and polyval for this task.

By observing the plot you made for the task above, your polynomial model seemingly fit the existing data points well. Try to create an extrapolated plot by extending the L upper limit to 0.1 m. Place your extrapolated plot in juxtaposition with your previous plot in this task Q2b (use subplot command). What could you observe and conclude from your extrapolated plot? Use fprintf command to show your brief description of your observation and conclusion (e.g. what's the problem you can find on the current polynomial model to relate the light transmission with the length of the transparent solid ? ) on command window.

Q2c

After having literature review, you find that the transmission of light through a transparent solid can be described by a theoretical equation:

IT = I0(1-R)2e-βL

IT = Intensity of light transmission I0 = Intensity of the incident beam
R = fraction of light which is reflected at the interface
β = absorption coefficient
L = the length of the transparent solid

Given that the intensity of the incident beam, I0 is 5 watts/m2. Use the data stored in matrix ‘transmission_data' which is done in Q1a to determine the absorption coefficient, β and fraction of light, R through curve fitting.

You shall not use Matlab built-in function for curve fitting such as polyfit, fit etc for this task. You have to write a user-defined regression function to obtain the absortion coefficient β and the fraction of light, R. The inputs to the function are two vectors (L and It in this context). The user-defined function must ensure the inputs of the vectors are of same length. If the two input vectors are not equal, it shall display an error message and terminate the program. The output arguments of this function are the coefficients a1 and a0 of a linear equation.

Hint: You may consider to adopt least-square linear regression to a non-linear model

Q2d

After performing curve fitting, make a line chart for the equation based on the β and R values you obtained from Q2c. Overlaid your line chart on a new scatter plot created based on the same dataset used in Q2a. The plot you create for this task shall be placed below the plot created in Q2b (use subplot).

Calculate the coefficient of determination and add it at the top of the plot as a text label using the Matlab command ‘text'.

Try to create another extrapolated plot for your current curve fitted model by extending the L upper limit to 0.1 m. Place your extrapolated plot in juxtaposition with your plot created in this task Q2d (use subplot command).

Q2e

Based on the equation given in question Q2c, use modified secant method to find an approximation of L when It is 3.3 watts/m2. You have to create another user-defined function (in separate function file) that use the modified secant method to find the root. Your user-defined function f shall include input arguments of a function handle, an initial guess, a small perturbation fraction and precision value. Test the user-defined function by prompting the user for an initial guess. You could presume the precision value is predefined as 0.001% and the perturbation fraction is 0.001. The function shall return the value of root. Display the root (which is the approximation of L) on command window with four decimal places.

Attachment:- LightTransmit - CO2_Emission.rar

Reference no: EM131332488

Questions Cloud

What is probability that player i describes to the event a : What is the probability that Player I describes to the event A?- What is the probability that Player II ascribes to the event A?
Concrete test instrument used in construction for evaluating : A portable concrete test instrument used in construction for evaluating and profiling concrete surfaces (MACRS-GDS 5-year property class) is under consideration by a construction firm for $22,500. The instrument will be used for 6 years and be worth ..
Are the three models evidence of the increasing fractures : What similarities and/or differences do you see among Luther, Calvin, and Ignatius´s models of Christian Life? Are the three models evidence of the increasing fractures of Christian piety or is there some evidence that suggest a common core of Ch..
Their fund at the time of their retirement : When Steve and Roslyn retire together they wish to receive $40,000 additional income (in the equivalent of today’s dollars) at the beginning of each year. They assume inflation will be 4% and they expect to realize an after tax return of 8%. Based on..
Scatterplot of data with intensity of light transmission : ENG1060 ASSIGNMENT - Calculate the coefficient of determination and add it at the top of the plot as a text label using the Matlab command ‘text' - create a scatterplot of data with intensity of light transmission, It, versus length of the transpare..
Which manufacturing location offers polaris greatest cost : Which manufacturing location offers Polaris the greatest cost savings? Would your recommendation change if the exchange rates increased or decreased by 15%?
Write two replies for the given post : Who gained more out of the Cold War, the U.S., Soviet Union, or developing 3rd World countries?Do you think that the losses caused by the Cold War are justified by either the United State's and/or the Soviet Union's goals?
Amortizing loan of equal payments for the life of mortgage : Bernie Madeoff pays $250,000 for a new four-door bedroom 2,400-square-foot home outside Tonopah, Nevada. He plans to make a 20% down payment, but is having trouble deciding whether he wants a 15-year fixed rate (6.398%) or a 30-year fixed rate (6.879..
Average iq for residents of a state : Does the average IQ for residents of a state vary with the amount that the state spends on education? Seven of the 50 U.S. states were randomly selected.

Reviews

len1332488

12/29/2016 1:22:00 AM

ASSIGNMENT HELP 1) You can ask questions in the Discussion Board on Moodle 2) Hints and additional instructions are provided as comments in the assignment template M---Files 3) Hints may also be provided during lectures 4) The questions have been split into sub---questions. It is important to understand how each sub--- question contributes to the whole, but each sub---question is effectively a stand---alone task that does part of the problem. Each can be tackled individually. 5) I recommend you break down each sub---question into smaller parts too, and figure out what needs to be done step---by---step. Then you can begin to put things together again to complete the whole.

len1332488

12/29/2016 1:21:46 AM

Your assignment will be marked in your usual computer lab session during Week 12. YOU MUST BE IN ATTENDANCE TO HAVE IT MARKED. It is your responsibility to ensure that everything needed to run your solution is included in your ZIP file (including data files). It is also your responsibility to ensure that everything runs seamlessly on the (Windows---based) lab computers (especially if you have used MATLAB on a Mac OS or Linux system).This assignment is worth 10% (1 Mark == 1%). Code will be graded using the following criteria: 1) Your code produces correct results (printed values, plots, etc…) and is well written.

len1332488

12/29/2016 1:20:45 AM

This assignment should be completed INDIVIDUALLY. If a part of your code is written in collaboration with classmates, say so in your comments and clearly state the contributions of each person. Submit your assignment online using Moodle. You must include the following attachments: 1) A ZIP file (NOT .rar or any other format) named after your student ID containing the following: a. Solution M---Files for assignment tasks b. Any additional function files required by your M---Files c. All data files needed to run the code, including the input data provided to you Follow “ENG1060 Assignment ZIP file instructions.pdf” to prepare your zip file for submission. 2) An assignment cover sheet with your name and ID (do NOT include this in the zip file)

Write a Review

MATLAB Programming Questions & Answers

  A volume 10 in long 5in wide and 05 in thick is to be

a volume 10 in. long 5in wide and 0.5 in. thick is to be removed by face milling cutter that is 3in. diameter and has 6

  Calculate the coefficients a of after two finite barrier

For the following system, use Matlab to: Calculate the coefficients A' of ?? after two finite barriers via transfer matrix approach. Calculate transmission probability (T=|A'|2/|A|2) in case of E>V. Choose E = 4 eV, V = 2 eV, a = 0.1 nm, b = 0.3 nm

  Define the transformation matrix

Define the transformation matrix for each vertex that keeps the approach of the knife normal to the circumference and oriented toward the cut, and makes the cut 1 cm deep.

  Simulate rigid body mechanics

Write a MATLAB code to simulate rigid body mechanics. Create a video file of a free falling rod. Neglect effects from drag or loss of kinetic energy. Make sure the rod falls onto one end showing how the rigid body reacts to hitting the ground. Cannot..

  To make things easy, just place the line makeclothes

To make things easy, just place the line makeClothes at the top of your script so you're guaranteed to have the correct acmeClothes array to work with.

  Generate by means data.m an array

Generate by measdata.m an array A withsize (365,24), containing temperature measurements for an entire year [1 January,..., 31 December], 24 hours a day [00.00h,...,23.00h].

  F data into matlab using only the textread function?

load the following type of data into mathlab using ONLY the textread funcion? Need to import it and plot it using boxplot.

  Write a matlab program to implement the discrete system

ECE - Assignment - Define the finite volume Vi of node i and indicate the appropriate location assignment of the magnetic field H in the mesh - Write a MatLab program to implement the discrete system given by Eq. (2) and solve for the cross-sectiona..

  Implement the support vector machine algorithm

Write a program to implement the Support Vector Machine algorithm. Train an SVM classifer with data from to3 and (04 in the following way - Train your classifier with just the first patterns in 03 and aht and find the separating hyperplane and the ..

  Implement the steps outlined and carry out the simulation

Implement the steps outlined and carry out the simulation - Repeat the steps for the specifications - Also produce output waveforms for at least two carrier frequencies. attached document, and provide me with the matlab files for the requirement at..

  Program the rank order cluster algorithm with a matrix

Program the rank order cluster algorithm with a matrix with x rows and x columns in any plataform (that the person inputs). I prefer visual studio or visual basic

  Give the gradient operator in paraboloidal coordinates

Given that the le data.txt contains only real numbers seperated by white space, write down a sequence of maple commands that will read the data into a maple list and then plot a histogram of the elements in the list.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd