ch08 - Chapter 8 Solved Problems Problem 1 Command Window:...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Chapter 8 Solved Problems Problem 1 Command Window: >> p=[0.02 -0.75 0 12.5 -2]; >> x=linspace(-6,6,200); >> y=polyval(p,x); >> plot(x,y) >> xlabel('x') >> ylabel('y') -6 -4 -2 0 2 4 6 -80 -60 -40 -20 0 20 40 60 80 100 120 x y
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Chapter 8: Solved Problems Problem 2 Command Window: >> u=[12 21 -11 -14 18 28 -4]; >> v=[4 7 -1]; >> [q, r]=deconv(u,v) q = 3 0 -2 0 4 r = 0 0 0 0 0 0 0 The answer is: Problem 3 Command Window: >> u=[4 6 -2 -5 3]; >> v=[1 4 2]; >> [q r]=deconv(u,v) q = 4 -10 30 r = 0 0 0 -105 -57 The answer is: 3 x 4 2 x 2 4 + 4 x 2 10 x 30 105 x 57 x 2 4 x 2 ++ ---------------------------
Background image of page 2
Chapter 8: Solved Problems 3 Problem 4 Mathematical formulation: Script File: p=[1, -1.1, 0.32, -18/(7920*pi)] roots(p) Command Window: >> p = 1.00000000000000 -1.10000000000000 0.32000000000000 - 0.00072343155951 ans = 0.54886073341442 + 0.12747823555777i 0.54886073341442 - 0.12747823555777i 0.00227853317116 The last root is the answer: m V π 0.2 2 0.7 π 0.2 x () 2 0.7 x ⋅⋅ 18 7920 ----------- == x 3 1.1 x 2 0.32 x 18 7920 π --------------- + 0 = x 0.0022785 =
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Chapter 8: Solved Problems Problem 5 Script File: % Part a disp( 'Part a' ) p=[4 -124 880 0] % Part b x=[0:0.2:11]; V=polyval(p,x); plot(x,V) xlabel( 'x (in.)' ) ylabel( 'V (in^3)' ) % Part c disp( 'Part c' ) pV1000=[4 -124 880 -1000]; x1000=roots(pV1000) % Part d disp( 'Part d' ) pD=polyder(p); %Determine the derivative of the polynomial. xr=roots(pD); %Determine where the derivative is zero. s=xr>0&xr<11; % Find which root is between 0 and 11. xmax=xr(s) % Assign the root to xmax. Vmax=polyval(p,xmax) % Determine the root at xmax. Command Window: Part a p = 4 -124 880 0 Part c x1000 = 21.1625 8.4374 1.4001 Part d xmax = 4.5502 Vmax = 1.8137e+003
Background image of page 4
Chapter 8: Solved Problems 5 In part c the two rootss of x1000 that apply to the problem are 8.4374 and 1.4001 . 0 2 4 6 8 10 12 0 200 400 600 800 1000 1200 1400 1600 1800 2000 x (in.) V (in 3 )
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Chapter 8: Solved Problems Problem 6 Mathematical formulation: m, m, m 3 . Write as a polynomial and find the roots: Script File: h=0.4; r=0.25; V=1.7; C=2*pi*h/3; P=[2*pi C C*r C*r^2-V] R=roots(P) Command Window: P = 6.2832 0.8378 0.2094 -1.6476 R = -0.3579 + 0.5676i -0.3579 - 0.5676i 0.5824 m. r 0.25 = h 0.4 = V 1.7 = V π R 2 2 R 2 1 3 -- π hR 2 r 2 rR ++ () + = R 0.5824 =
Background image of page 6
Chapter 8: Solved Problems 7 Problem 7 User-defined function: function p=polyadd(p1,p2,operation) np1=length(p1); np2=length(p2); % Padding p2, if shorter than p1. if np1>np2 nd=np1-np2; p2add(1:nd)=0; p2=[p2add p2]; end % Padding p1, if shorter than p2. if np2>np1 nd=np2-np1; p1add(1:nd)=0; p1=[p1add p1]; end switch operation case 'add' p=p1+p2; case 'sub' p=p1-p2; end Command Window: >> f1=[1 -7 11 -4 -5 -2]; >> f2=[9 -10 6]; >> f1PLUSf2=polyadd(f1,f2,'add') f1PLUSf2 = 1 -7 11 5 -15 4 >> f1MINUSf2=polyadd(f1,f2,'sub') f1MINUSf2 = 1 -7 11 -13 5 -8 The answers are: addition: subtraction: x 5 7 x 4 11 x 3 5 x 2 15 x 4 ++ + x 5 7 x 4 11 x 3 13 x 2 5 x 8
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Chapter 8: Solved Problems Problem 8 User-defined function:
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.