Solution+to+HW4

# Solution+to+HW4 - EGM3344 Solution to HW4 Fall 2010 6.4(a...

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EGM3344 Solution to HW4 Fall 2010 6.4 (a) Graphical >> x = linspace(0,4); >> y = 8*sin(x).*exp(-x)-1; >> plot(x,y);grid 6.11 S1 a) >> format long >> x0=0.5; %Initial Guess >> x = fzero(@(x)x^2*abs(sin(x))‐4,x0) x = 3.478508515574645 b) %False Position Mehtod clear all clc x0 = 0; %initial Guess xf=4; % Final Guess error = 1; i=0 while(error > (5*10^(‐7))) i=i+1 f0 = x0^2*abs(sin(x0))‐4; ff = xf^2*abs(sin(xf))‐4; if(f0*ff<0) x2 = x0‐f0*(xf‐x0)/(ff‐f0); %Secant Part end f_x2 = x2^2*abs(sin(x2))‐4 if(f0*f_x2<0) xf=x2; end if(f_x2*ff<0) x0=x2; end error = abs(f_x2); end ...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern