# OpenStax-CNX

You are here: Home » Content » A Brief Introduction to Engineering Computation with MATLAB » Problem Set

• Preface
• Study Guide

• #### 8. Publishing with MATLAB

• 9. Postscript

### Recently Viewed

This feature requires Javascript to be enabled.

Inside Collection (Textbook):

Textbook by: Serhat Beyenir. E-mail the author

# Problem Set

Module by: Serhat Beyenir. E-mail the author

Summary: Problem Set for MATLAB Essentials

Determine the value of each of the following.

## Exercise 1

6×7+4224 6 7 4 2 2 4

### Solution

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

## Exercise 2

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

### Solution

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

## Exercise 3

log102+105 10 2 10 5

### Solution

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

## Exercise 4

e2+23lne2 2 2 3 2

### Solution

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

## Exercise 5

sin2π+cosπ4 2 4

### Solution

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

## Exercise 6

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

### Solution

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

## Exercise 7

Solve the following system of equations:
2x+4y=1 2 x 4 y 1
x+5y=2 x 5 y 2

### Solution


>> A=[2 4; 1 5]

A =

2     4
1     5

>> B=[1; 2]

B =

1
2

>> Solution=A\B

Solution =

-0.5000
0.5000


## Exercise 8

Evaluate y at 5.
y=4x4+3x2x y 4 x 4 3 x 2 x

### Solution


>> p=[4 0 3 -1 0]

p =

4     0     3    -1     0

>> polyval(p,5)

ans =

2570

>>


## Exercise 9

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

Table 1
0.000 50.8000
4.890 50.8102
9.779 50.8203
14.670 50.8305
19.560 50.8406
24.450 50.8508
27.620 50.8610
29.390 50.8711
32.680 50.9016
33.950 50.9270
34.580 50.9524
35.220 50.9778
35.720 51.0032
40.540 51.816
48.390 53.340
59.030 55.880
65.870 58.420
69.420 60.960
69.670 (maximum) 61.468
68.150 63.500
60.810 (fracture) 66.040 (after fracture)
The engineering stress is defined as σ=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.

### Solution

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:

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. Introduction to Materials Science for Engineers by J. F. Shackelford, Macmillan Publishing Company. © 1985, (p.304)

## Content actions

PDF | EPUB (?)

### What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

#### Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

#### Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks