MATLAB Essentials | Problem Set
Problem Set for MATLAB Essentials

Determine the value of each of the following.

6×7+4224 6 7 4 2 2 4

>> (6*7)+4^2-2^4 (ans = 42)

32+234554+640.55245+56+78 3 2 2 3 4 5 5 4 64 0.5 5 2 4 5 5 6 7 8

>> ((3^2+2^3)/(4^5-5^4))+((sqrt(64)-5^2)/(4^5+5^6+7^8)) (ans = 0.0426)

log102+105 10 2 10 5

>> log10(10^2)+10^5 (ans = 100002)

e2+23lne2 2 2 3 2

>> exp(2)+2^3-log(exp(2)) (ans = 13.3891)

sin2π+cosπ4 2 4

>> sin(2*pi)+cos(pi/4) (ans = 0.7071)

tanπ3+cos270+sin270+cosπ3 3 270 270 3

>> tan(pi/3)+cos(270*pi/180)+sin(270*pi/180)+cos(pi/3) (ans = 1.2321)

Solve the following system of equations:


2x+4y=1 2 x 4 y 1

x+5y=2 x 5 y 2

>> A=[2 4; 1 5] A = 2 4 1 5 >> B=[1; 2] B = 1 2 >> Solution=A\B Solution = -0.5000 0.5000

Evaluate y at 5.


y=4x4+3x2x y 4 x 4 3 x 2 x

>> p=[4 0 3 -1 0] p = 4 0 3 -1 0 >> polyval(p,5) ans = 2570 >>

Given below is Load-Gage Length data for a type 304 stainless steel that underwent a tensile test. Original specimen diameter is 12.7 mm. 1
Load [N] Gage Length [mm]
0.000 50.8000
4890 50.8102
9779 50.8203
14670 50.8305
19560 50.8406
24450 50.8508
27620 50.8610
29390 50.8711
32680 50.9016
33950 50.9270
34580 50.9524
35220 50.9778
35720 51.0032
40540 51.816
48390 53.340
59030 55.880
65870 58.420
69420 60.960
69670 (maximum) 61.468
68150 63.500
60810 (fracture) 66.040 (after fracture)
σ=PA σ P A , where P is the load [N] on the sample with an original cross-sectional area A [ m2 m 2 ] and the engineering strain is defined as ε=Δll ε Δl l , where Δl Δl is the change in length and l l is the initial length.



Compute the stress and strain values for each of the measurements obtained in the tensile test. Data available for download.

First, we need to enter the data sets. Because it is rather a large table, using Variable Editor is more convenient. See the figures below:

Load in Newtons
Load
Extension length in mm.
Length

Next, we will calculate the cross-sectional area. Area=pi/4*(0.0127^2) Area = 1.2668e-004

Now, we can find the Stress values with the following, note that we are obtaining results in MPa: Sigma=(Load_N./Area)*10^(-6) Sigma = 0 38.6022 77.1964 115.8065 154.4086 193.0108 218.0351 232.0076 257.9792 268.0047 272.9780 278.0302 281.9773 320.0269 381.9955 465.9888 519.9844 548.0085 549.9820 537.9830 480.0403

For strain calculation, we will first find the change in length: Delta_L=Length_mm-50.800 Delta_L = 0 0.0102 0.0203 0.0305 0.0406 0.0508 0.0610 0.0711 0.1016 0.1270 0.1524 0.1778 0.2032 1.0160 2.5400 5.0800 7.6200 10.1600 10.6680 12.7000 15.2400

Now we can determine Strain with the following: Epsilon=Delta_L./50.800 Epsilon = 0 0.0002 0.0004 0.0006 0.0008 0.0010 0.0012 0.0014 0.0020 0.0025 0.0030 0.0035 0.0040 0.0200 0.0500 0.1000 0.1500 0.2000 0.2100 0.2500 0.3000

The final results can be tabulated as foolows: [Sigma Epsilon] ans = 0 0 38.6022 0.0002 77.1964 0.0004 115.8065 0.0006 154.4086 0.0008 193.0108 0.0010 218.0351 0.0012 232.0076 0.0014 257.9792 0.0020 268.0047 0.0025 272.9780 0.0030 278.0302 0.0035 281.9773 0.0040 320.0269 0.0200 381.9955 0.0500 465.9888 0.1000 519.9844 0.1500 548.0085 0.2000 549.9820 0.2100 537.9830 0.2500 480.0403 0.3000

Footnotes

  1. 1 Introduction to Materials Science for Engineers by J. F. Shackelford, Macmillan Publishing Company. © 1985, (p.304)