ECOR 2606 Lecture Notes - Lecture 9: Dont, Convolution, Matlab

27 views4 pages
ECOR 2606 D/E - Lecture 3 15/01/2018
SNAP QUIZ (Good examples to study for exams/tests)
a) Are these expressions in the required form MATLAB root solving? If not, rewrite them.
b) Could you use roots or fzero to solve each revised expression?
i) x(x+2)(x+3) = 10
a) - expressions need to be in f(x)=0 form for root solving, therefore this is not in proper form so
subtract 10 from both sides
>>f = @(x) x.*(x+2).*(x+2).*(x+3) 10
b) -expression is a polynomial but not in the right form, can use fzero
>>fzero(f,2);
Or can expand to get expression of right form (with coefficients) to get x3+ 5x2+6x -10 and then use toos
>>roots([ 1 5 6 -10]];
Side note: Convolution multiplies two polynomials
>>conv([1 2], [1 3])
1 5 6
>>conv(conv[1 2], [1 3], [1,0]) [0 0 0 10];
ii) sin(2*x^2) 2cos(x) = 0
a) >>f=@(x) sin(2*x.^2) 2*cos(x);
b) - not a polynomial so use fzero
>>fzero(f,2);
iii) tan-1(2πx) = e3/x
a) >>f=@(x) atan(2*pi*x)-exp(3./x);
Note: atan = arctan
b) fzero(f,[2 9]);
________________________________________________________________________________
Lecture 3: polyval, fplot input, fprintf, function files, control statements
Example for finding roots for a cubic:
>> D = 50;
>> r = D/2;
>> rho = 0.25;
>> p = [ 1 (-3 * r) 0 (4 * r ^3 * rho)];
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows page 1 of the document.
Unlock all 4 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Ecor 2606 d/e - lecture 3 15/01/2018. *(x+3) 10: -expression is a polynomial but not in the right form, can use fzero. Or can expand to get expression of right form (with coefficients) to get x3+ 5x2+6x -10 and then use toos. >>conv(conv[1 2], [1 3], [1,0]) [0 0 0 10]: sin(2*x^2) 2cos(x) = 0, >>f=@(x) sin(2*x. ^2) 2*cos(x), - not a polynomial so use fzero. Lecture 3: polyval, fplot input, fprintf, function files, control statements. >> p = [ 1 (-3 * r) 0 (4 * r ^3 * rho)]; As x must be between 0 and d the answer is 16. 3176 mm. Using fzero also works, using function f and an interval from 0 to d. >> f = @(x) x. ^3 - 3 * r * x. ^2 + 4 * r^3 * rho; >> x = linspace(-d, 2 * d, 50); Polyval evaluates polynomial at given x values, producing corresponding y value.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents