Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions In MATLAB... Define You are being assigned 1 warmup problem and 1 application problem. Use the provided script file: Class_20_App.m for these problems. You

Instructions

In MATLAB...

Define

You are being assigned 1 warmup problem and 1 application problem. Use the provided script file: Class_20_App.m for these problems. You will also need to write your own functions as described below. Include comment statements to help organize your script and function files.

One of the advantages of functions (beyond organizing code and reducing repeated code) is that they facilitate coordination between programmers. In these problems, another programmer has already completed some of the code in the script and has asked you to write functions to make it work.

Represent

Make a flow chart for your function for the application problem.

Plan

Download Class_20_App.m and create function files for the problems that require them.

Outline the steps your program will take by adding comment statements.

Implement

Complete the problems in the script file and function files.

Evaluate

Comment on your answers to the application problems; are they reasonable? You may do a calculation (by hand or in Excel) to support your evaluation.

Document

Publish your work. The function will NOT be included in the pdf so you will need to append the function code.

Submit the following: Flow charts, Script file, function files, & Command window output PDF generated aboveoEvaluate step comments including any calculation(s) done.

Application Problem 1

Background A common experiment to characterize the properties of a material is to deform the material and measure the stress (the forces in the material per unit area) against the strain (the percentage that the material has been deformed). Different materials have different characteristic stress-strain curves, and these are used to classify materials as brittle (they go through linear elastic deformation, but fracture at high strain) or ductile (they deform linearly then yield and deform plastically).

Problem Statement

A stress-strain experiment has been done on a steel alloy producing the data provided in stress_strain_data.txt (be sure to download this from Carmen and put it in your working folder). Your co-worker has already loaded the data and plotted it, but there is a problem: since the sample fractured during the experiment, all the stress data after that strain is 0 and not meaningful (since the sample is broken). You are asked to write a function named remove_zeros that has two inputs (raw_stress and raw_strain, in that order) and two outputs (fixed_stress and fixed_strain, in that order) to remove all the data after the fracture point. Hint: find the index of the fracture point (i.e. when raw_stress first equals 0) using a while loop.

stress_strain_data.txt

0.0001 2.7000 0.0001 8.0000 0.0001 8.8500 0.0001 9.2600 0.0001 9.7000 0.0002 9.9500 0.0003 10.3000 0.0002 10.8000 0.0001 11.4000 0.0003 12.2000 0.0003 13.2000 0.0003 14.3000 0.0002 15.3000 0.0002 16.3000 0.0003 17.2000 0.0002 18.0000 0.0002 18.9000 0.0003 19.8000 0.0004 20.6000 0.0003 21.3000 0.0003 22.0000 0.0003 22.7000 0.0004 23.3000 0.0004 24.0000 0.0003 24.7000 0.0004 25.4000 0.0005 26.1000 0.0004 26.8000 0.0003 27.6000 0.0003 28.1000 0.0005 28.7000 0.0003 29.7000 0.0003 30.6000 0.0004 31.7000 0.0004 32.6000 0.0003 33.6000 0.0005 34.8000 0.0004 36.1000 0.0004 37.0000 0.0004 38.3000 0.0006 39.5000 0.0005 41.1000 0.0004 43.0000 0.0006 44.9000 0.0005 47.1000 0.0004 49.3000 0.0005 51.1000 0.0006 53.3000 0.0005 55.5000 0.0005 58.1000 0.0008 60.6000 0.0006 63.1000 0.0005 65.6000 0.0006 68.7000 0.0007 71.5000 0.0006 74.7000 0.0006 77.8000 0.0008 81.3000 0.0007 84.7000 0.0007 88.2000 0.0008 91.9000 0.0008 96.0000 0.0007 100.0000 0.0008 104.0000 0.0009 108.0000 0.0009 113.0000 0.0008 117.0000 0.0009 121.0000 0.0010 126.0000 0.0009 131.0000 0.0009 136.0000 0.0010 141.0000 0.0011 146.0000 0.0011 151.0000 0.0010 156.0000 0.0012 161.0000 0.0013 168.0000 0.0012 174.0000 0.0013 180.0000 0.0014 187.0000 0.0014 193.0000 0.0013 200.0000 0.0015 206.0000 0.0016 213.0000 0.0015 220.0000 0.0017 227.0000 0.0018 234.0000 0.0018 241.0000 0.0019 248.0000 0.0020 255.0000 0.0020 262.0000 0.0021 270.0000 0.0023 277.0000 0.0024 284.0000 0.0024 291.0000 0.0026 298.0000 0.0029 305.0000 0.0030 312.0000 0.0032 320.0000 0.0035 326.0000 0.0037 333.0000 0.0039 339.0000 0.0044 342.0000 0.0048 348.0000 0.0051 355.0000 0.0056 358.0000 0.0062 361.0000 0.0066 367.0000 0.0071 370.0000 0.0077 377.0000 0.0082 380.0000 0.0087 383.0000 0.0091 389.0000 0.0098 392.0000 0.0103 395.0000 0.0107 402.0000 0.0111 405.0000 0.0117 408.0000 0.0122 414.0000 0.0126 417.0000 0.0131 420.0000 0.0136 427.0000 0.0142 430.0000 0.0146 433.0000 0.0151 439.0000 0.0157 442.0000 0.0162 446.0000 0.0167 452.0000 0.0171 455.0000 0.0178 458.0000 0.0182 461.0000 0.0187 468.0000 0.0191 471.0000 0.0198 474.0000 0.0204 477.0000 0.0209 480.0000 0.0214 486.0000 0.0220 490.0000 0.0226 493.0000 0.0231 496.0000 0.0236 499.0000 0.0242 502.0000 0.0248 505.0000 0.0254 508.0000 0.0259 515.0000 0.0265 518.0000 0.0272 521.0000 0.0277 524.0000 0.0283 527.0000 0.0289 530.0000 0.0296 533.0000 0.0301 537.0000 0.0307 540.0000 0.0314 540.0000 0.0321 543.0000 0.0326 546.0000 0.0333 549.0000 0.0340 552.0000 0.0346 555.0000 0.0352 559.0000 0.0359 562.0000 0.0367 562.0000 0.0373 565.0000 0.0379 568.0000 0.0387 571.0000 0.0394 574.0000 0.0400 574.0000 0.0407 577.0000 0.0415 581.0000 0.0421 584.0000 0.0428 584.0000 0.0436 587.0000 0.0444 590.0000 0.0451 590.0000 0.0457 593.0000 0.0466 596.0000 0.0474 596.0000 0.0481 599.0000 0.0487 599.0000 0.0495 602.0000 0.0504 606.0000 0.0512 606.0000 0.0519 609.0000 0.0526 609.0000 0.0535 612.0000 0.0543 612.0000 0.0550 615.0000 0.0558 615.0000 0.0566 618.0000 0.0576 618.0000 0.0584 621.0000 0.0590 621.0000 0.0600 624.0000 0.0609 624.0000 0.0616 624.0000 0.0624 628.0000 0.0634 628.0000 0.0642 631.0000 0.0650 631.0000 0.0658 631.0000 0.0667 634.0000 0.0676 634.0000 0.0684 634.0000 0.0693 637.0000 0.0703 637.0000 0.0711 637.0000 0.0718 640.0000 0.0728 640.0000 0.0738 640.0000 0.0745 643.0000 0.0754 643.0000 0.0765 643.0000 0.0773 643.0000 0.0781 646.0000 0.0792 646.0000 0.0801 646.0000 0.0809 646.0000 0.0819 650.0000 0.0829 650.0000 0.0837 650.0000 0.0847 650.0000 0.0857 653.0000 0.0866 653.0000 0.0875 653.0000 0.0886 653.0000 0.0895 656.0000 0.0903 656.0000 0.0914 656.0000 0.0924 656.0000 0.0932 656.0000 0.0943 656.0000 0.0954 659.0000 0.0962 659.0000 0.0972 659.0000 0.0982 659.0000 0.0993 659.0000 0.1002 659.0000 0.1010 659.0000 0.1022 662.0000 0.1033 662.0000 0.1041 662.0000 0.1051 662.0000 0.1062 662.0000 0.1072 662.0000 0.1081 662.0000 0.1091 662.0000 0.1103 665.0000 0.1112 665.0000 0.1122 665.0000 0.1133 665.0000 0.1145 665.0000 0.1153 665.0000 0.1163 665.0000 0.1175 665.0000 0.1185 665.0000 0.1195 665.0000 0.1206 665.0000 0.1217 668.0000 0.1227 668.0000 0.1238 668.0000 0.1249 668.0000 0.1259 668.0000 0.1270 668.0000 0.1281 668.0000 0.1291 668.0000 0.1303 668.0000 0.1314 668.0000 0.1323 668.0000 0.1335 668.0000 0.1347 668.0000 0.1357 668.0000 0.1369 668.0000 0.1380 668.0000 0.1391 668.0000 0.1401 668.0000 0.1414 668.0000 0.1424 668.0000 0.1435 668.0000 0.1446 668.0000 0.1459 668.0000 0.1468 668.0000 0.1480 668.0000 0.1492 668.0000 0.1502 0.0000 0.1514 0.0000 0.1526 0.0000 0.1537 0.0000 0.1549 0.0000 0.1561 0.0000 0.1572 0.0000 0.1583 0.0000 0.1597 0.0000 0.1607 0.0000 0.1619 0.0000 0.1631 0.0000 0.1644 0.0000 0.1655 0.0000 0.1667 0.0000 0.1679 0.0000 0.1692 0.0000 0.1703 0.0000 0.1716 0.0000 0.1729 0.0000 0.1740 0.0000 0.1752 0.0000 0.1766 0.0000 0.1777 0.0000 0.1788 0.0000 0.1803 0.0000 0.1815 0.0000 0.1827 0.0000 0.1840 0.0000 0.1853 0.0000 0.1865 0.0000 0.1878 0.0000 0.1890 0.0000 0.1905 0.0000 0.1917 0.0000 0.1930 0.0000 0.1942 0.0000 0.1957 0.0000 0.1969 0.0000 0.1981 0.0000 0.1995 0.0000 0.2008 0.0000 0.2021 0.0000 0.2032 0.0000 0.2047 0.0000 0.2060 0.0000 0.2074 0.0000 0.2086 0.0000 0.2101 0.0000 0.2114 0.0000 0.2125 0.0000 0.2140 0.0000 0.2153 0.0000 0.2166 0.0000 0.2178 0.0000 0.2193 0.0000 0.2207 0.0000 0.2219 0.0000 0.2232 0.0000 0.2246 0.0000 0.2259 0.0000 0.2272 0.0000 0.2286 0.0000 0.2301 0.0000 0.2313 0.0000 0.2326 0.0000 0.2341 0.0000 0.2354 0.0000 0.2366 0.0000 0.2380 0.0000 0.2395 0.0000 0.2408 0.0000 0.2421 0.0000 0.2435 0.0000 0.2450 0.0000 0.2463 0.0000 0.2475 0.0000 0.2490 0.0000 0.2506 0.0000 0.2518 0.0000 0.2532 0.0000 0.2546 0.0000 0.2560 0.0000 0.2573 0.0000 0.2588 0.0000 0.2603 0.0000 0.2616 0.0000 0.2628 0.0000 0.2644 0.0000 0.2659 0.0000 0.2674 0.0000 0.2690 0.0000 0.2703 0.0000 0.2718 0.0000 0.2733 0.0000 0.2746 0.0000 0.2759 0.0000 0.2771 0.0000 0.2786 0.0000 0.2798 0.0000 0.2812 0.0000 0.2826 0.0000 0.2842 0.0000 0.2857 0.0000 0.2869 0.0000 0.2882 0.0000 0.2895 0.0000 0.2908 0.0000 0.2923 0.0000 0.2938 0.0000 0.2952 0.0000 0.2966 0.0000 0.2981 0.0000 0.2994 0.0000 0.3009 0.0000 0.3024 0.0000 0.3039 0.0000 0.3053 0.0000 0.3068 0.0000 0.3084 0.0000 0.3098 0.0000 0.3111 0.0000 0.3125 0.0000 0.3141 0.0000 0.3154 0.0000 0.3167 0.0000 0.3179 0.0000 0.3193 0.0000 0.3206 0.0000 0.3218 0.0000 0.3234 0.0000 0.3247 0.0000 0.3260 0.0000 0.3274 0.0000 0.3289 0.0000 0.3305 0.0000 0.3318 0.0000 0.3333 0.0000 0.3346 0.0000 0.3359 0.0000 0.3375 0.0000 0.3389 0.0000 0.3402 0.0000 0.3416 0.0000 0.3430 0.0000 0.3446 0.0000 0.3459 0.0000 0.3471 0.0000 0.3485 0.0000 0.3499 0.0000 0.3512 0.0000 0.3527 0.0000 0.3540 0.0000 0.3556 0.0000 0.3569 0.0000 0.3583 0.0000 0.3597 0.0000 0.3611 0.0000 0.3625 0.0000 0.3639 0.0000 0.3654 0.0000 0.3666 0.0000 0.3680 0.0000 0.3693 0.0000 0.3706 0.0000 0.3721 0.0000 0.3734 0.0000 0.3748 0.0000 0.3764 0.0000 0.3778 0.0000 0.3793 0.0000 0.3808 0.0000 0.3823 0.0000 0.3836 0.0000 0.3849 0.0000 0.3864 0.0000 0.3880 0.0000 0.3895 0.0000 0.3909 0.0000 0.3922 0.0000 0.3934 0.0000 0.3948 0.0000 0.3964 0.0000 0.3978 0.0000 0.3990 0.0000 0.4005 0.0000 0.4021 0.0000 0.4033 0.0000 0.4047 0.0000 0.4063 0.0000 0.4077 0.0000 0.4092 0.0000 0.4106 0.0000 0.4121 0.0000 0.4135 0.0000 0.4150 0.0000 0.4162 0.0000 0.4178 0.0000 0.4192 0.0000 0.4205 0.0000 0.4220 0.0000 0.4235 0.0000 0.4248 0.0000 0.4260 0.0000 0.4275 0.0000 0.4288 0.0000 0.4301 0.0000 0.4315 0.0000 0.4330 0.0000 0.4344 0.0000 0.4356 0.0000 0.4371 0.0000 0.4386 0.0000 0.4401 0.0000 0.4414 0.0000 0.4430 0.0000 0.4445 0.0000 0.4458 0.0000 0.4473 0.0000 0.4487 0.0000 0.4501 0.0000 0.4513 0.0000 0.4527 0.0000 0.4540 0.0000 0.4554 0.0000 0.4570 0.0000 0.4583 0.0000 0.4598 0.0000 0.4613 0.0000 0.4628 0.0000 0.4644 0.0000 0.4657 0.0000 0.4672 0.0000 0.4688 0.0000 0.4703 0.0000 0.4717 0.0000 0.4733 0.0000 0.4749 0.0000 0.4763 0.0000 0.4778 0.0000 0.4793 0.0000 0.4806 0.0000 0.4820 0.0000 0.4833 0.0000 0.4849 0.0000 0.4862 0.0000 0.4876 0.0000 0.4889 0.0000 0.4901 0.0000 0.4917 0.0000 0.4931 0.0000 0.4945 0.0000 0.4961 0.0000 0.4974 0.0000 0.4990 0.0000 0.5004 0.0000

Your help is much appreciated! Thank you!!

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

Step: 3

blur-text-image

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

Transactions On Large Scale Data And Knowledge Centered Systems X Special Issue On Database And Expert Systems Applications Lncs 8220

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2013th Edition

3642412203, 978-3642412202

More Books

Students also viewed these Databases questions