me 1020 engineering programming with matlab … 8.5: problem setup: use the linearity property. 𝐀...

16
ME 1020 Engineering Programming with MATLAB Chapter 8 Homework Answers: 8.1, 8.3, 8.5, 8.8, 8.10, 8.12, 8.14, 8.16 Problem 8.1:

Upload: duongliem

Post on 18-Jun-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7

ME 1020 Engineering Programming with MATLAB

Chapter 8 Homework Answers: 8.1, 8.3, 8.5, 8.8, 8.10, 8.12, 8.14, 8.16

Problem 8.1:

Page 2: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7

Problem 8.3:

Page 3: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7
Page 4: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7

Problem 8.5:

Problem setup: Use the linearity property.

𝐀𝐱 = 𝐛

𝐱 = π€βˆ’πŸπ›

𝐀𝐲 = 𝐛𝑐

𝐲 = π€βˆ’πŸπ›π‘ = 𝑐𝐱

𝐀 = [1 βˆ’5 βˆ’26 3 17 3 βˆ’5

]

𝐛 = [111310

]

Solve for x and then multiply by c.

Page 5: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7
Page 6: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7

Problem 8.8:

Page 7: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7

Problem setup:

(𝑅1)π‘ž + (1)𝑇1 + (0)𝑇2 + (0)𝑇3 = 𝑇𝑖

(𝑅2)π‘ž + (βˆ’1)𝑇1 + (1)𝑇2 + (0)𝑇3 = 0

(𝑅3)π‘ž + (0)𝑇1 + (βˆ’1)𝑇2 + (1)𝑇3 = 0

(𝑅4)π‘ž + (0)𝑇1 + (0)𝑇2 + (βˆ’1)𝑇3 = βˆ’π‘‡π‘œ

π‘₯𝑇 = [π‘ž 𝑇1 𝑇2 𝑇3]

𝑅1 = 0.036; 𝑅2 = 4.01; 𝑅3 = 0.408; 𝑅4 = 0.038

𝑇𝑖 = 20; π‘‡π‘œ = βˆ’10

Page 8: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7

Problem 8.10:

Problem setup:

R R R

R R

R R R

R R R

R R R

Ta T1 T2 T3

T4

T7

T6 T5

T8 T9 Tb

qa1

q12

q23

q45

q56

q78

q89

q9b

q14

q47

q25

q36

q58

q69

Page 9: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7
Page 10: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7

Problem 8.12:

Page 11: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7

Discussion of results:

The row-reduced echelon form is:

(1)π‘₯ + (0)𝑦 + 1.9176𝑧 = 3.9583

(0)π‘₯ + (1)𝑦 βˆ’ 0.7500𝑧 = 5.6250

These equations can be reduced:

π‘₯ = βˆ’1.9176𝑧 + 3.9583

𝑦 = 0.7500𝑧 + 5.6250

For this problem, we must have π‘₯ β‰₯ 0, 𝑦 β‰₯ 0, and 𝑧 β‰₯ 0.

Page 12: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7

for 𝑧 β‰₯ 0, π‘₯ ≀ 3.9583

for 𝑧 β‰₯ 0, 𝑦 β‰₯ 5.6250

for π‘₯ β‰₯ 0, βˆ’ 1.9176𝑧 + 3.9583 β‰₯ 0 or 𝑧 ≀ 2.0648

for 𝑦 β‰₯ 0, 0.7500𝑧 + 5.6250 β‰₯ 0 or 𝑧 β‰₯ βˆ’7.5 (not a valid solution)

Ranges of variables:

0 ≀ π‘₯ ≀ 3.9583

𝑦 β‰₯ 5.6250

0 ≀ 𝑧 ≀ 2.0648

Part c): Profit analysis:

𝑃 = 200π‘₯ + 300𝑦 + 100𝑧

𝑃 = 200(βˆ’1.9176𝑧 + 3.9583) + 300(0.7500𝑧 + 5.6250) + 100𝑧

𝑃 = 2479 βˆ’ 58.52𝑧

For maximum profit, set 𝑧 = 0. This gives 𝑃 = 2479.

π‘₯ = 3.9583

𝑦 = 5.6250

Part d): Profit analysis:

𝑃 = 200π‘₯ + 500𝑦 + 100𝑧

𝑃 = 200(βˆ’1.9176𝑧 + 3.9583) + 500(0.7500𝑧 + 5.6250) + 100𝑧

𝑃 = 3604 + 91.48𝑧

For maximum profit, set 𝑧 to its maximum value: 𝑧 = 2.0648. This gives

𝑃 = 3604 + 91.48(2.0648) = 3793

π‘₯ = βˆ’1.9176(2.0648) + 3.9583 = 0

𝑦 = 0.7500(2.0648) + 5.6250 = 7.1736

Page 13: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7

Problem 8.14:

Page 14: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7

Problem 8.16:

Problem setup:

Part a):

𝑦 = π‘Žπ‘₯2 + 𝑏π‘₯ + 𝑐

Point 1: (π‘₯, 𝑦) = (1,4): 4 = π‘Ž(1)2 + 𝑏(1) + 𝑐; (1)π‘Ž + (1)𝑏 + (1)𝑐 = 4

Point 1: (π‘₯, 𝑦) = (4,73): 73 = π‘Ž(4)2 + 𝑏(4) + 𝑐; (16)π‘Ž + (4)𝑏 + (1)𝑐 = 73

Point 1: (π‘₯, 𝑦) = (5,120): 120 = π‘Ž(5)2 + 𝑏(5) + 𝑐; (25)π‘Ž + (5)𝑏 + (1)𝑐 = 120

π‘₯𝑇 = [π‘Ž 𝑏 𝑐]

Part b):

𝑦 = π‘Žπ‘₯3 + 𝑏π‘₯2 + 𝑐π‘₯ + 𝑑

Point 1: (π‘₯, 𝑦) = (1,4): 4 = π‘Ž(1)3 + 𝑏(1)2 + 𝑐(1) + 𝑑; (1)π‘Ž + (1)𝑏 + (1)𝑐 + (1)𝑑 = 4

Point 1: (π‘₯, 𝑦) = (4,73): 73 = π‘Ž(4)3 + 𝑏(4)2 + 𝑐(4) + 𝑑; (64)π‘Ž + (16)𝑏 + (4)𝑐 + (1)𝑑 = 73

Point 1: (π‘₯, 𝑦) = (5,120): 120 = π‘Ž(5)3 + 𝑏(5)2 + 𝑐(5) + 𝑑; (125)π‘Ž + (25)𝑏 + (5)𝑐 + (1)𝑑 = 120

π‘₯𝑇 = [π‘Ž 𝑏 𝑐]

Page 15: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7
Page 16: ME 1020 Engineering Programming with MATLAB … 8.5: Problem setup: Use the linearity property. 𝐀 =𝐛 =π€βˆ’πŸπ› 𝐀 =𝐛 =π€βˆ’πŸπ› = 𝐀=[1 βˆ’5 βˆ’2 6 3 1 7

The exact solution (in terms of d) is:

(1)π‘Ž + (0)𝑏 + (0)𝑐 + (0.05)𝑑 = 0.25

(0)π‘Ž + (1)𝑏 + (0)𝑐 + (0.05)𝑑 = 3.5

(0)π‘Ž + (0)𝑏 + (1)𝑐 + (1.45)𝑑 = 0.25

π‘Ž + 0.05𝑑 = 0.25 or π‘Ž = βˆ’0.05𝑑 + 0.25

𝑏 + 0.05𝑑 = 3.5 or 𝑏 = βˆ’0.05𝑑 + 3.5

𝑐 + 1.45𝑑 = 0.25 or 𝑐 = βˆ’1.45𝑑 + 0.25

𝑦 = (βˆ’0.05𝑑 + 0.25)π‘₯3 + (βˆ’0.05𝑑 + 3.5)π‘₯2 + (βˆ’1.45𝑑 + 0.25)π‘₯ + 𝑑

The least squares solution is (inexact solution):

𝑦 = (0.2414)π‘₯3 + (3.5862)π‘₯2 + (0)π‘₯ + 0.1724