Hertzsprung–Russell diagram MATH 210-01, Fall 2021 Ryan Pellico, Department of Mathematics, Trinity College In class we used the script HR_diagram.m to import stellar data from an Excel spreadsheet...

1 answer below »
The assignment is entitled in the pdf "MATLAB_HR_diagram". The files needed are also attached


Hertzsprung–Russell diagram MATH 210-01, Fall 2021 Ryan Pellico, Department of Mathematics, Trinity College In class we used the script HR_diagram.m to import stellar data from an Excel spreadsheet using the xlsread function, and extract the relative magnitudes (m) from the second column, observed colors (c) from the third column, and parallax measurements (p) from the fourth column. The Hertzsprung-Russel (HR) diagram is a scatter plot relating the absolute magnitude (M) (or luminosity) of stars with their observed color (or effective temperature). In order to produce this diagram, we calculated M via the relation M = m+ 5 · (log10(p) + 1). You can read more about the HR diagram here: https://en.wikipedia.org/wiki/Hertzsprung%E2%80%93Russell_diagram The original data is available as a text file at the following website, and has been converted into an Excel spreadsheet available on Moodle. http://burro.astr.cwru.edu/Academics/Astr221/HW/HW5/yaletrigplx.dat 1. (25 points) Write a line (or lines) that could be added to the script to modify the axis so the horizontal axis is from −0.5 to 2.25 and the vertical axis is from −10 to 20. Hint: help axis, help xlim, help ylim. 2. (25 points) Write a line (or lines) that could be added to the script to add reasonable labels to the horizontal and vertical axes, and a title. Hint: help xlabel, help ylabel, help title. 3. (25 points) Write a line (or lines) that could be added to the script to create an n × 3 matrix named COL of colors to try and match the colors of stars indicated by the below diagram: 1 https://en.wikipedia.org/wiki/Hertzsprung%E2%80%93Russell_diagram http://burro.astr.cwru.edu/Academics/Astr221/HW/HW5/yaletrigplx.dat 4. (25 points) Write a line (or lines) that could be added to the script to deletes all rows from the matrix NUM that have a value in the third column less than 2.25. Does this produce a different figure than just changing the axis to exclude these points? Explain. 2 HR_star_data 24.611.040.0135149 38.451.050.0717113 49.011.440.088623 68.60.940.014755 75.960.670.045550 76.430.640.045550 85.70.520.049597 85.690.520.049597 96.130.750.066463 9.0113.741.990.21336 9.1114.171.490.053525 108.370.650.0075119 118.70.80.0392150 11.0113.071.520.04463 122.06-0.110.02779 136.190.480.046272 162.270.340.069566 16.111.81.480.0575101 177.010.920.0327105 17.0213.731.390.019330 185.420.420.0213149 186.120.440.0213149 193.881.030.0645161 22.0110.871.450.0085190 237.960.750.030784 244.890.490.0658149 259.911.060.0288117 268.350.620.0495150 275.250.440.0322137 27.0114.360.420.090637 29.0113.271.520.028324 307.950.950.0215150 3213.061.60.045851 32.191.360.0219150 345.720.310.0241111 34.0115.340.210.032948 368.370.630.032892 36.0115.90.580.051338 375.121.620.002586 384.81.570.014198 394.441.660.0272173 406.6-0.020.0096106 40.0111.531.740.182168 4212.541.660.0866134 42.1112.261.550.066116 458.941.420.068139 45.0113.791.620.056937 466.850.640.0674150 474.610.060.019198 487.960.660.032884 48.016.660.60.0016133 48.0212.491.570.0465120 48.0313.951.490.028435 48.0410.991.460.0365120 498.071.560.28222 506.50.590.028870 514.520.050.0193125 51.0110.881.520.0359120 526.460.680.0475115 533.561.220.011623 53.0115.37-0.120.0394 544.230.580.1408105 54.0116.051.980.079337 555.180.420.015672 565.51-0.050.0101127 5710.41.480.050569 585.1810.0259161 608.940.680.011193 618.30.90.0473113 61.0111.241.50.062840 626.390.660.041935 638.411.570.029128 649.840.840.0153110 64.111.881.480.0151173 64.1114.271.590.06141 65.15.400.0153111 65.1214.541.670.052844 667.920.950.0491125 686.820.60.028101 692.80.620.150172 70.0110.561.470.05946 712.391.090.038477 723.940.170.0712137 72.0211.661.220.022138 735.061.650.0155111 745.170.030.010672 766.040.430.0329111 775.431.560.0142149 77.0112.231.480.075451 789.631.140.0279150 798.40.620.0049133 79.0111.031.140.0283120 806.210.840.0227174 80.0110.171.090.033182 81.017.720.80.006710 835.190.120.0163149 83.0114.991.510.020339 855.61.150.0079141 8610.41.540.099825 874.73-0.10.0283150 87.0112.751.640.062342 884.770.020.0252137 898.520.830.024258 904.37-0.070.027273 90.15.381.080.033398 916.310.0051159 929.611.350.033270 92.1111.360.031683 935.090.040.0478114 93.0113.511.650.050731 956.410.610.0389106 95.0114.880.670.005542 967.370.540.0438150 96.15.570.470.0491161 975.20.560.061545 975.650.570.061545 97.0112.541.550.062191 97.18.620.830.0369101 97.1115.610.20.030440 97.1211.711.540.043998 987.940.70.026874 988.430.660.026874 98.016.410.520.0218111 98.0215.321.890.063645 995.131.60.007965 99.18.370.780.0774150 1026.780.640.0376150 1036.40.550.0272107 1045.570.720.074884 1046.230.720.074884 1064.370.870.033975 106.0113.240.540.0134144 10711.051.530.080139 1083.271.280.02918 1097.30.630.0179101 1105.870.850.096263 11210.571.160.0147150 1135.361.160.007798 1142.231.170.012761 1156.690.510.0193150 1167.360.940.059665 1176.140.70.041297 118.0114.021.550.043420 118.025.330.890.0101125 1196.970.650.03871 1205.890.550.0567106 120.110.891.320.0301150 120.1114.530.620.1012104 1214.590.970.003161 12210.250.360.0081108 1237.60.520.013782 12510.521.50.0472150 1274.940.180.021984 1297.190.750.023194 1308.731.130.052677 1315.390.50.0368173 131.0114.531.580.051840 13210.861.030.0025249 1339.250.670.0182257 133.0110.931.340.0423120 1342.041.020.055593 135.0212.8410.0194104 1374.3600.031101 1384.761.010.0213186 138.0113.2910.009546 1395.91.160.0082161 14010.781.440.0564163 1417.790.670.0398163 1425.420.040.011398 1435.240.330.0463137 1448.0110.0432150 1456.540.650.0541117 145.0116.71.610.014740 1468.481.170.0803106 146.015.80.640.0481186 1475.50.980.024117 147.0112.311.190.0099236 1485.381.650.0146141 1498.640.640.0331150 150.0115.781.630.028429 1514.061.120.035596 152.26.540.50.0215111 152.2112.561.250.0042234 152.2212.130.430.0024239 1537.850.540.0412110 1547.740.510.0384150 1553.440.570.171718 1565.750.880.136120 156.0210.70.580.0077235 1577.760.90.0167105 157.0112.140.70.0194234 1584.431.50.017694 1595.070.510.0455125 16012.380.550.232519 1627.160.780.0623101 1646.30.360.010393 164.0111.740.870.0216232 165.0110.040.610.0166234 165.0214.871.50.013646 1665.190.50.063481 1675.071.370.0235137 16910.671.390.054734 169.019.60.890.0053232 169.0211.630.530.007238 169.038.690.80.008299 169.0413.080.880.0064237 1709.241.210.047468 1725.220.360.0035149 172.0111.351.10.0017235 172.0215.411.680.020686 172.0310.411.080.0292235 1738.961.280.069278 1744.820.530.0644150 174.1112.431.150.0009272 174.1312.050.770.0252234 175.0112.210.940.0243236 175.0212.041.050.0106235 175.039.160.580.053159 175.039.730.550.053159 1777.170.930.0818106 177.0112.40.890.0309234 1808.471.40.013362 1814.831.210.00572 181.0212.230.90.019233 181.0310.390.660.0425180 182.0112.340.580.0147236 1835.79-0.020.0129162 183.17.380.650.038278 183.1112.741.030.0183235 183.1212.190.60.0037234 1849.11.030.043461 184.0111.891.480.0181234 1852.47-0.150.014889 1864.630.960.035467 186.0111.831.150.0064234 18712.361.510.0616150 187.019.481.180.0279233 1885.311.520.005691 1893.870.130.033879 1905.451.090.0338186 190.0113.721.650.056441 190.0215.021.710.033338 190.0310.960.960.0195235 1914.420.940.006173 191.0111.481.020.0059232 1929.460.860.0698150 192.0112.470.790.0099233 1939.471.320.059297 1947.080.460.030478 1947.790.430.030478 194.111.771.560.0769142 1988.450.60.0402120 2007.331.070.0508151 200.018.560.630.018238 200.029.870.50.0325238 20110.831.570.090944 20210.061.470.117441 202.019.951.110.0572235 202.0210.110.760.0254233 202.0312.790.890.0079236 2037.670.750.0384130 2049.561.50.106558 204.15.591.180.0325150 204.119.750.330.0206238 20513.661.680.095573 205.110.561.190.0438106 205.1111.841.230.0281234 205.210.971.430.0313110 2068.210.0276103 206.16.90.650.0114150 2076.450.250.01162 20810.061.370.0195150 2094.280.960.026165 2105.360.90.0228127 210.0113.960.310.046938 210.0211.230.860.0148232 210.0411.830.610.0294239 2116.251.120.0099107 21410.260.780.0124110 214.0111.251.490.0177234 2159.81.190.04126 215.0314.471.870.099850 215.16.831.590.0094222 2167.710.610.0427106 216.0114.811.880.079330 216.028.671.160.032952 2178.981.30.066640 217.0112.410.880.0075235 217.0210.951.130.0088232 217.0311.40.860.0197235 217.0511.371.470.0634120 2187.570.50.0302222 2195.170.690.133917 2203.310.890.02161 22111.520.880.007140 22213.351.590.045132 2235.030.110.029998 2248.411.120.05287 2258.850.940.0475110 2266.460.860.0283127 2275.520.340.0331117 2285.210.160.0133186 2297.680.720.003890 23110.561.280.045150 2325.370.880.0316161 2333.451.160.033332 2344.25-0.070.000994 2355.29-0.020.015598 2366.741.170.0026150 2382.061.580.047779 2399.10.790.0397150 240.015.650.60.030396 2414.330.170.008764 2435.81-0.10.002172 2444.661.030.013679 2454.511.090.022294 2469.81.560.1205101 246.0112.891.620.062818 248.0112.051.860.268832 2497.931.530.0145141 2504.651.040.005999 250.0114.761.810.071627 2515.240.320.023395 2535.130.460.057466 2545.70.420.027977 254.0115.51.50.028268 2558.470.560.042150 2574.960.580.0648110 257.0115.031.820.048145 2599.050.760.0475150 260.15.410.90.0163111 2617.20.930.0275110 2617.690.940.0275110 2626.520.560.037497 2639.661.290.0409120 2644.860.470.053398 2644.950.450.053398 2665.160.070.012361 2679.7810.057167 267.0113.830.140.064930 268.111.761.470.045892 2697.980.810.047384 269.111.561.430.0456150 2707.110.820.041795 2728.340.790.0288150 2734.760.030.0166111 2748.90.590.025551 2757.641.030.028208 275.0111.341.320.0431120 27610.361.340.034880 277.0210.641.140.0403160 277.0312.170.750.0003120 2788.50.920.0191150 2794.881.080.014819 2816.960.620.03796 28210.151.40.0633150 282.19.461.040.0249150 282.19.650.970.0249150 282.1113.611.760.069440 2837.850.90.038469 284.0117.10.820.032155 284.0310.11.020.0204120 2854.741.050.0126101 285.0111.341.320.0152120 285.029.571.020.0312120 2863.61.060.035526 2872.680.130.034355 287.015.910.410.029360 2898.50.880.0552145 289.110.31.060.011497 2909.461.010.0269106 2918.310.690.0236150 292.113.121.670.0315178 2934.91.230.0058137 2945.380.390.036872 2965.51.110.01472 2976.411.240.022149 2984.830.420.02763 298.27.930
Answered Same DayOct 06, 2021

Answer To: Hertzsprung–Russell diagram MATH 210-01, Fall 2021 Ryan Pellico, Department of Mathematics, Trinity...

Nishchay answered on Oct 06 2021
117 Votes
Assignment Solution
1) Matlab code to change the axis limits
1. close all; % close all open figure
2. clc;clear all; % clear command window and work space
3. % the function xlsread imports data from an Excel spreadsheet by taking as
4. % an input the filename of the Excel
spreadsheet as a character array '...'
5. % or string "...". The spreadsheet must be in the Current Folder, and the
6. % function outputs up to three arrays, NUM contains the purely numerical
7. % data, TXT contains the purely text data, RAW contains all the data (in a
8. % cell array).
9. [NUM,TXT,RAW] = xlsread('HR_star_data.xlsx');
10.
11. % column 1: star ID number (we don't need this)
12.
13. % column 2: apparent V magnitude (extract this column and call it m)
14. m = NUM(:,2);
15.
16. % column 3: observed B-V color (extract this column and call it c)
17. c = NUM(:,3);
18.
19. % column 4: observed parallax (extract this column and call it p)
20. p = NUM(:,4);
21.
22. % column 5: parallax uncertainty (in milliarcsec) (we don't need this)
23.
24.
25.
26. % Create new column of absolute magnitude (M) using m and p.
27. M = m + 5*(log10(p)+1);
28.
29.
30.
31. % scatter(x, y, size, color, marker)
32. scatter( c, M, 3, c, 'o', 'filled')
33.
34. % x-axis limit from -0.5 to 2.25
35. xlim([-0.5 2.25]);
36.
37. % y-axis limit from -10 to 20
38. ylim([-10 20]);
39.
40. % use set(gca,'Name','Value') to change features of the "axis"
41. set(gca,'Color',[0 0 0],'XColor',[1 1 1],'YColor',[1 1 1]);
42. set(gca,'Ydir','reverse','FontSize',14);
43.
44. % use set(gcf,'Name','Value') to change features of the "figure"
45. set(gcf,'Color',[0 0 0]);
2) Matlab code for title and label the axis
1. close all; % close all open figure
2. clc;clear all; % clear command window and work space
3. % the function xlsread imports data from an Excel spreadsheet by taking as
4. % an input the filename of the Excel spreadsheet as a character array '...'
5. % or string "...". The spreadsheet must be in the Current Folder, and the
6. % function outputs up to three arrays, NUM contains the purely numerical
7. % data, TXT contains the purely text data, RAW contains all the data (in a
8. % cell array).
9. [NUM,TXT,RAW] = xlsread('HR_star_data.xlsx');
10.
11. % column 1: star ID number (we don't need this)
12.
13. % column 2: apparent V magnitude (extract this column and call it m)
14. m = NUM(:,2);
15.
16. % column 3: observed B-V color (extract this column and call it c)
17. c = NUM(:,3);
18.
19. % column 4: observed parallax (extract this column and call it p)
20. p = NUM(:,4);
21.
22. % column 5: parallax uncertainty (in milliarcsec) (we don't need this)
23.
24.
25.
26. % Create new...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here