25
Solutions Manual c to accompany System Dynamics, Second Edition by William J. Palm III University of Rhode Island Solutions to Problems in Appendix C c Solutions Manual Copyright 2010 The McGraw-Hill Companies. All rights reserved. No part of this manual may be displayed, reproduced, or distributed in any form or by any means without the written permission of the publisher or used beyond the limited distribution to teachers or educators permitted by McGraw-Hill for their individual course preparation. Any other reproduction or translation of this work is unlawful.

Palm System Dynamic Sol

Embed Size (px)

Citation preview

Page 1: Palm System Dynamic Sol

Solutions Manual c©

to accompany

System Dynamics, Second Edition

by

William J. Palm III

University of Rhode Island

Solutions to Problems in Appendix C

c©Solutions Manual Copyright 2010 The McGraw-Hill Companies. All rightsreserved. No part of this manual may be displayed, reproduced, or distributedin any form or by any means without the written permission of the publisheror used beyond the limited distribution to teachers or educators permitted byMcGraw-Hill for their individual course preparation. Any other reproductionor translation of this work is unlawful.

Page 2: Palm System Dynamic Sol

C.1 The session is:

�a = 1.12; b = 2.34; c = 0.72;d = 0.81;f = 19.83;�x = 1 + a/b + c/f^2x =

1.4805�s = (b-a)/(d-c)s =

13.5556�r = 1/(1/a + 1/b + 1/c + 1/d)r =

0.2536�y = a*b/c*f^2/2y =

715.6766

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 3: Palm System Dynamic Sol

C.2 The session is

�x = -7-5i;y = 4+3i;�x+yans =-3.0000 - 2.0000i�x*yans =-13.0000 -41.0000i�x/yans =-1.7200 + 0.0400i�(3/2)*jans =0 + 1.5000i�3/(2j)ans =0 - 1.5000i

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 4: Palm System Dynamic Sol

C.3 The session is:

�x=[1:0.2:5];�y = 7*sin(4*x);�length(y)ans =

21�y(3)ans =

-4.4189

There are 21 elements. The third element is −4.4189.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 5: Palm System Dynamic Sol

C.4 The session is

�wage = [5,5.5,6.5,6,6.25]; hours = [40,43,37,50,45];�output = [1000,1100,1000,1200,1100];�earnings = wage.*hoursearnings =

200.0000 236.5000 240.5000 300.0000 281.2500�total_salary = sum(earnings)total_salary =

1.2582e+003�total_widgets = sum(output)total_widgets =

5400�average_cost = total_salary/total_widgetsaverage_cost =

0.2330�average_hours = sum(hours)/total_widgetsaverage_hours =

0.0398�[maximum,most_efficient] = max(output./earnings)maximum =

5most_efficient =

1�[minimum,least_efficient] = min(output./earnings)minimum =

3.9111least_efficient =

5

The workers earned $200, $236.50, $240.50, $300, and $281.25 respectively. The total salarypaid out was $1258.20, and 5400 widgets were made. The average cost to produce one widgetwas 23.3 cents, and it took an average of 0.0398 hr to produce one widget. The first worker,who produced 5 widgets per dollar of earnings, was the most efficient. The fifth worker,who produced 3.911 widgets per dollar of earnings, was the least efficient.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 6: Palm System Dynamic Sol

C.5 The MATLAB expressions are:

f = 1./sqrt(2*pi*c./x)E = (x + w./(y + z))./(x + w./(y - z))A = exp(-c./(2*x))./(log(y).*sqrt(d*z))S = x.*(2.15 + 0.35*y).^1.8./(z.*(1-x).^y)

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 7: Palm System Dynamic Sol

C.6 For part (a) note that the first quarter material cost is computed by

7(16) + 3(12) + 9(8) + 2(14) + 5(13) = 326

and the second quarter material cost is computed by

7(14) + 3(15) + 9(9) + 2(13) + 6(16) = 346

and so on. Thus the quarterly costs can be computed by multiplying the transpose of thematrix of unit costs by the matrix of quarterly production volumes. The resulting 3 × 4matrix is quarterly_costs. Its first row contains the material costs, its second row containsthe labor costs, and the third row contains the transportation costs. The four columnsof quarterly_costs correspond to the four quarters. For part (b) the yearly costs formaterials, labor, and transportation are found by summing the rows of quarterly_costs,or equivalently, by summing the columns of the transpose of quarterly_costs. For part(c) the total quarterly costs are found by summing the columns of quarterly_costs. Thesession is

�unit_cost = [7,3,2;3,1,3;9,4,5;2,5,4;6,2,1];�quarterly_volume = [16,14,10,12;12,15,11,13;8,9,7,11;14,13,15,17;13,16,12,18];�quarterly_costs = unit_cost′*quarterly_volumequarterly_costs =

326 346 268 364188 190 168 214177 186 160 204

�yearly_costs = sum(quarterly_costs′)yearly_costs =

1304 760 727�total_quarter_cost = sum(quarterly_costs)total_quarter_cost =

691 722 596 782

(continued on the next page)

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 8: Palm System Dynamic Sol

Problem C.6 continued:

The table C.6 was created from the matrix quarterly_costs. All costs are in thousandsof dollars.

Table C.6Quarterly Costs

Category Quarter 1 Quarter 2 Quarter 3 Quarter 4Materials 326 346 268 364

Labor 188 190 168 214Transportation 177 186 160 204

From the vector yearly_costs we obtain the following information: yearly materialscost = $1,304,000, yearly labor cost = $760,000, and yearly transportation cost = $727,000.From the vector total_quarter_cost we find that the total costs in each quarter are$691,000, $722,000, $596,000, and $782,000 respectively.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 9: Palm System Dynamic Sol

C.7 The session is

�roots([13,182,-184,2503])ans =

-15.68500.8425 + 3.4008i0.8425 - 3.4008i

�poly(ans)ans =

1.0000 14.0000 -14.1538 192.538513*ans

ans =1.0e+003 *0.0130 0.1820 -0.1840 2.5030

This gives the original coefficients.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 10: Palm System Dynamic Sol

C.8 The session is

�roots([36,12,-5,10])ans =

-0.86510.2659 + 0.5004i0.2659 - 0.5004i

�polyval([36,12,-5,10],ans)ans =

1.0e-013 *0.01780.1243 + 0.0178i0.1243 - 0.0178i

Since the last result is essentially zero, the polynomial evaluates to zero, showing that theroots are correct.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 11: Palm System Dynamic Sol

C.9 The session is

�poly([3+6j,3-6j,8,8,20])ans =

1 -42 645 -5204 24960 -57600�roots(ans)ans =

20.00003.0000 + 6.0000i3.0000 - 6.0000i8.00008.0000

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 12: Palm System Dynamic Sol

C.10 The session is

�conv([10,-9,-6,12],[5,-4,-12,8])ans =

50 -85 -114 272 -48 -192 96

The answer is 50s6 − 85s5 − 114s4 + 272s3 − 48s2 − 192s + 96.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 13: Palm System Dynamic Sol

C.11 The session is

�[q,r] = deconv([14,-6,3,9],[5,7,-4])q =

2.8000 -5.1200r =

0.0000 0.0000 50.0400 -11.4800

The answer is 2.8s− 5.12 with a remainder of 50.04s− 11.48.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 14: Palm System Dynamic Sol

C.12 The session is:

�x = [0:0.01:2];�u = 2*log10(60*x+1);�v = 3*cos(6*x);�plot(x,u,x,v,′--′),ylabel(′Speed (mi/hr)′),...xlabel(′Distance x (mi)′)

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 15: Palm System Dynamic Sol

C.13 The session is

�p1 = [3,-6,8,4,90];�p2 = [3, 5, -8, 70];�x=[-3:0.01:3];�y = polyval(p1,x);�z = polyval(p2,x);�plot(x,y,x,z,′--′),xlabel(′x′),ylabel(′y and z′),gtext(′y′),gtext(′z′)

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 16: Palm System Dynamic Sol

C.14 The script file is:

x = -5;if x < -1

y = exp(x + 1)elseif x < 5

y = 2 + cos(pi*x)else

y = 10*(x - 5) + 1end

The answer for x = −5 is y = 0.0183. Change the first line to x = 3 to obtain y = 1. Thenchange the first line to x = 15 to obtain y = 101.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 17: Palm System Dynamic Sol

C.15 a) z = 0 1 0 0 1b) z = 1 0 1 0 0c) z = 1 1 1 0 1d) z = 0 0 0 1 0e) z = 0 1 0 1 1

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 18: Palm System Dynamic Sol

C.16 (a) The session is

�price_A = [19,18,22,21,25,19,17,21,27,29];�price_B = [22,17,20,19,24,18,16,25,28,27];�price_C = [17,13,22,23,19,17,20,21,24,28];�length(find(price_A>price_B&price_A>price_C))ans =

4

Thus the price of stock A was above both B and C on four days.(b) Replace the fourth line in the above session with

�length(find(price_A>price_B|price_A>price_C))ans =

9

The answer is nine days.(c) Replace the fourth line in the session in part (a) with

�length(find(xor(price_A>price_B,price_A>price_C)))ans =

5

The answer is five days.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 19: Palm System Dynamic Sol

C.17 The script file is

price = [19,18,22,21,25,19,17,21,27,29];cost_new_shares = 100*sum(price.*(price<20))income_selling = 100*sum(price.*(price>25))shares_change = 100*(sum(price<20)-sum(price>25));total_shares = 1000 + shares_changenet_increase = price(10)*total_shares - price(1)*1000

The results are: cost_new_shares = 7300, income_selling = 5600, total_shares =1200, and net_increase = 15800. Thus you spent $7300 in buying shares. You received$5600 from the sale of shares. After the tenth day you own 1200 shares. The net increasein the worth of your portfolio is $15,800.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 20: Palm System Dynamic Sol

C.18 The script file is:

sum = 0;for k = 1:10

sum = sum + 5*k^3;endsum

The answer is sum = 15125.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 21: Palm System Dynamic Sol

C.19 The script file is:

sum = 0;k = 0;while sum <= 2000

k = k + 1;sum = sum + 2^k;

endksum

The answers are k = 10 and sum = 2046.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 22: Palm System Dynamic Sol

C.20 The script file is:

amt1 = 1000;amt2 = 1000;k1 = 0;k2 = 0;while amt1 < 50000

k1 = k1 + 1;amt1 = amt1*1.055 + 1000;

endwhile amt2 < 50000

k2 = k2 + 1;amt2 = amt2*1.045 + 1000;enddiff = k2 - k1

The answer is diff = 2. Thus it takes 2 more years in the second bank.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 23: Palm System Dynamic Sol

C.21 The function is

function theta = asine(x,q)if abs(x) <= 1

if q==1theta=asin(x);

elseif q==2theta = asin(x)+pi;

elseif q==3theta = asin(x)+pi;

elsetheta = asin(x);

endtheta = theta*(180/pi)

elsedisp(’|x| >1’)

end

The function does not protect against incorrect values of the quadrant number q, but theproblem statement did not require this.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 24: Palm System Dynamic Sol

C.22 The function file is

function y = f6(x)y = 1 + exp(-0.2*x).*sin(x+2);

You can plot the function to obtain solution estimates to use with fminbnd, or you cansimply try values of x between 0 and 10. The session is

�fminbnd(′f6′,0)ans =2.5150�f6(ans)ans =

0.4070�fminbnd(′f6′,10)ans =

8.7982�f6(ans)ans =

0.8312

So the solutions are (x, y) = (2.5150, 0.4070) and (x, y) = (8.7982, 0.8312).

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.

Page 25: Palm System Dynamic Sol

C.23 The function file is

function t = time(h,v0,g)% Computes time t to reach a specified height h, with initial speed v0.roots([0.5*g,-v0,h])

A test session follows.

�time(100,50,9.81)ans =

7.46122.7324

The smaller value is the time to reach the height while ascending; the larger value is thetime to reach the height while descending.

c©2010 McGraw-Hill. This work is only for non-profit use by instructors in courses for which

the textbook has been adopted. Any other use without publisher’s consent is unlawful.