HW3 - Problem 5.10 Instructions and changes in problems...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Problem 5.10 Instructions and changes in problems Write short Matlab programs for bi‐section and for false position. Generate a table as given in the answers below to compare the progress of bisection and false position. In plot have your axis to (xmin xmax ymin ymax) so that you can see that there is actually a root at 1.5 and not asymptotic at 0. ‐ Also make sure that when you calculate error is ea and not et. ‐ Make sure you have an initial guess in the fzero function 5.10 mod 5.13 6.2 6.2 mod 6.16 7.2 7.4 Compare with the convergence of Matlab fzero with the same interval. Use or modify the bi‐section program you wrote for 5.10. Do one iteration by hand to prepare for exam. For the fixed point iteration, there are two ways of creating the iteration (one involving a square root). Write both, and calculate the derivative of the right hand side in order to select which one to use. Do one iteration by hand to prepare for exam. Compare the convergence in 6.2 (with a table showing the iteration history) for Matlab functions fzero and roots starting with the same initial guess. Do not use an interval for fzero. Use fzero. When doing part (a) make sure you take a good guess, do not put a range in the fzero call. Part (a) by hand, part (b) with Matlab. For part (c), use any rootfinding method you want. Note: Use the equation f (x) = −1.5x − 2x +12x instead of the equation given in the book for problems 7.4 through 7.6. 6 4 ‐ When you take the second derivative of the function make sure you analyze the expression and you will see that for any value of x the expression will always be negative which means.... ‐ For part a make sure you have a small interval so you can see the maximum more clearly 7.5 Put your intermediate results in a table like in the answers below. ‐ Remember that you are looking for a maximum and the example in the book is for a minimum 7.6 Put your intermediate results in a table like in the answers below. Will need to cancel a common factor in denominator and numerator to avoid division by zero at optimum (s=1). Express one of the dimensions in terms of the other two by using the cross‐sectional area. The textbook solution uses d and s=tan(theta) as the two remaining variables. Find the minimum first graphically, by using contours. Then use fminsrch to home in on the exact solution. Solve the same problem with fmincon using all three variables and the area constraint. It is easier to solve the problem numerically if the area requirement is posed as an inequality constraint rather than an equality constraint. 7.28 7.32 7.32mod 5.10. Result for bisection i 1 x f(x ) l l 0.5 2 1.5 3 1.5 4 1.5 5 1.5 6 1.5 7 1.5 8 1.5 5.13 x = 268.328 ymax = -0.51519 x u f(x ) u x r −32.258 2.5 0.81303 2 2 −0.030 2.5 0.8130 2 95 32 −0.030 2 0.6018 1.75 95 09 −0.030 1.75 0.3789 1.625 95 09 −0.030 1.625 0.2069 1.5625 95 27 −0.030 1.5625 0.0979 1.5312 95 56 5 −0.030 1.5312 0.0362 1.5156 95 5 61 25 −0.030 1.5156 0.0033 1.5078 95 25 83 125 f(x ) r 1.5 ε a −0.0309 46 0.6018 25.00% 09 0.3789 14.29% 09 0.2069 7.69% 27 0.0979 4.00% 56 0.0362 2.04% 61 0.0033 1.03% 83 0.52% −0.013 595 6.2 For Newton’s method you should get the following convergence: i 0 1 x i f(x) 5 3.353 659 2 2.801 332 3 2.721 108 4 2.719 341 5 2.719 341 2.710 44 0.305 06 0.006 44 3.1E06 7.4E13 f'(x) -13.5 4.907 32 3.802 66 3.642 22 3.638 68 3.638 68 ε a -8.2 49.09 % 19.72 % 2.95% 0.06% 0.00% 6.16 Ta = 1684.3 7.2 X=4. 7.4 (a) (b) Show that the second derivative will always be negative and hence the function will be concave for all values of x. (c) x = 0.91692 7.5 7.6 7.28 T=3, s=1 7.32 Theta=60o ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online