Lecture17 - MATLAB Function: optimset The function optimset...

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

View Full Document Right Arrow Icon
The function optimset creates an options structure that you can pass as an input argument to the following four MATLAB optimization functions: fminbnd (single variable) fminsearch (multi-variables) fzero lsqnonneg Example: options = optimset('Display','iter','TolFun',1e-8) This statement creates an optimization options structure in which the Display parameter is set to 'iter' and the TolFun parameter is set to 1e-8. MATLAB Function: optimset
Background image of page 1

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

View Full DocumentRight Arrow Icon
>> options =optimset( 'display','iter' ); >> [x fx]=fzero(@x x^10-1,0.5, options ) >> [x fx]=fzero('manning',50,options) Func-count x f(x) Procedure 1 50 -14569.8 initial 2 48.5858 -14062 search 3 51.4142 -15078.3 search 4 48 -13851.9 search ... ... ... 19 72.6274 -22769.2 search 20 18 -3457.1 search 21 82 -26192.5 search 22 4.74517 319.67 search Looking for a zero in the interval [4.7452, 82] 23 5.67666 110.575 interpolation 24 6.16719 -5.33648 interpolation 25 6.14461 0.0804104 interpolation 26 6.14494 5.51498e-005 interpolation 27 6.14494 -1.47793e-012 interpolation 28 6.14494 3.41061e-013 interpolation 29 6.14494 -5.68434e-013 interpolation Zero found in the interval: [4.7452, 82]. x = 6.14494463443476 fx = 3.410605131648481e-013 fzero and optimset functions Find sign change after 22 iterations Switch to secant (linear) or inverse quadratic interpolation to find root Search in both directions x 0 ± x for sign change
Background image of page 2
Root of Polynomials Bisection, false-position, Newton-Raphson, secant methods cannot be easily used to determine all roots of higher-order polynomials MATLAB function: roots for polynomials; recast root finding in terms of an eigenvalue problem;
Background image of page 3

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

View Full DocumentRight Arrow Icon
MATLAB Function: roots Recast the root evaluation task as an eigenvalue problem (Chapter 20) x = roots(c) - roots c = poly(r) - inverse function [ ] 0 1 2 1 n n 0 1 2 2 1 n 1 n n n c c c c c c vector t coefficien c x c x c x c x c x p , , , , , ) ( - - - = + + + + + =
Background image of page 4
i 3 2 3 2 2 1 x 0 156 x 56 x 111 x 10 x 14 x 6 x x f r 2 3 4 5 6 ± - - = = + + - + + - = , , , , ) ( Roots of Polynomial Consider the 6 th -order polynomial >> c = [1 -6 14 10 -111 56 156]; >> r = roots(c)
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/05/2011 for the course EGM 3344 taught by Professor Raphaelhaftka during the Spring '09 term at University of Florida.

Page1 / 31

Lecture17 - MATLAB Function: optimset The function optimset...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online