ECOR 2606 Lecture Notes - Lecture 5: Golden Ratio, Psa Tu Engine
ECOR 2606 D/E – Lecture 10 – 7/02/2018
Today – Golden Search
NOTE: Everything up until this lecture is on midterm
1) What is the value of B at the end of the script?
A = 2;
for k = 0:2:5
A = [A A*k];
end
B=A
a) B = 2 0 0 0
b) B = 2
2 0
2 0 0
2 0 0 0
c) B = 2 0 4 0 8 0 16 0
d) B = 2 2 9 8
e) None of the above
- Answer is C because A is a scalar, matrix gets larger each time
First is [2 0]
Then [2 0 4 0] – takes A which is [2 0] from previous and then multiplies it by k giving 4 0
Then [2 0 4 0 8 0 16 0]
2) You are using N-R method to find the smallest root of f(x) = x^2 -6x +8. Would x0=3 be a good
choice, why or why not? And how would you modify it if you had to?
a) No, will not result in a divide by 0, make it slightly smaller
b) “ “, make it slightly larger
c) No, it requires to guesses, add a second guess at x = -5 –WRONG b/c N-R uses 1 guess
d) Yes it should converge to the correct solution
e) No this function has no roots ---WRONG b/c has roots
NOTE – do SNAP QUIZ 3 – GOLDEN SECTION SEARCH
Golden Section Search
-looks for minimum instead of zeros
-need pair of x values – use brackets
-move on of the two walls in
if x1 > f(x2), xu gets moved to x1 – otherwise xL gets moved to x2
find more resources at oneclass.com
find more resources at oneclass.com
Document Summary
Ecor 2606 d/e lecture 10 7/02/2018. 2 0 0: b = 2 0 0 0, b = 2. 2 0 0 0: b = 2 0 4 0 8 0 16 0, b = 2 2 9 8, none of the above. Answer is c because a is a scalar, matrix gets larger each time. Then [2 0 4 0] takes a which is [2 0] from previous and then multiplies it by k giving 4 0. Then [2 0 4 0 8 0 16 0: you are using n-r method to find the smallest root of f(x) = x^2 -6x +8. Note do snap quiz 3 golden section search. Need pair of x values use brackets. Move on of the two walls in if x1 > f(x2), xu gets moved to x1 otherwise xl gets moved to x2. H(t) = 1/r (vo + 2/r)(1-e^(-rt)) gt/r. For vo = 78 m/s , r = 0. 35s^-1.