* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download exam_3_soluiton
Survey
Document related concepts
Corecursion wikipedia , lookup
Relativistic quantum mechanics wikipedia , lookup
Renormalization group wikipedia , lookup
Mathematical descriptions of the electromagnetic field wikipedia , lookup
Perturbation theory wikipedia , lookup
Plateau principle wikipedia , lookup
Mathematical optimization wikipedia , lookup
Computational chemistry wikipedia , lookup
Navier–Stokes equations wikipedia , lookup
Routhian mechanics wikipedia , lookup
Numerical continuation wikipedia , lookup
Root-finding algorithm wikipedia , lookup
Computational electromagnetics wikipedia , lookup
Newton's method wikipedia , lookup
Transcript
ChE 211, Process Simulation Exam 3 Solution Instructions: Open note NOT open book (this section isn’t covered in the book anyway) NOT open computer Where it is appropriate, write your answers on the screen-shot. Feel free to change the units if needed, or to fill in a value that you think will show up after your initial selection. 1) Sketch what is happening when we use the Regula-Falsi method to find the root of a non-linear equation. (10 pts) 2) What steps do you need to go through to use the fixed point iteration method to solve a of non-linear equation? (15 pts) 1. Starting with your equation in the form f(x)=0, rewrite as x=g(x). There are very likely multiple options for what g(x) will actually look like. a. Examine options for g(x) b. Calculate g’(x) at your initial guess. c. If abs(g’(x))<1, it should converge, pick a g(x) accordingly. 2. plot y=g(x) and y=x. The intersection occurs at the root we are searching for. 3. pick a point 4. draw a line in the x direction from the point to y=x, then in the y direction back to y=g(x), this becomes our new point. 5. repeat step four until the change in x is within tolerance. 3) Fill out the guess values and constraints for a Mathcad solve block to solve the following system of equations: (15 points) z3-4x2+2y=cos(36x) sin(y)=20z-x tan(z)+tan(x)=y4 4) Rearrange the equations in problem 3 to be in an ‘implicit’ form. (10 pts) F(x,y,z)=z3-4x2+2y-cos(36x)=0 F(x,y,z)=20z-x-sin(y)=0 F(x,y,z)=tan(z)+tan(x)-y4 5) What method is the following section of matlab code using to solve a nonlinear equation? (10 pts) Function Xsol=mysterymethod(Fun,a,b,imax,tol) %Bwa ha ha ha. Ha ha. % a and b are the x values for the initial guesses, imax is the maximum number of %iterations, and tol is the desired tolerance. Toli=10 %set iteration tolerance high enough that the loop will complete one time Fa=Fun(a); Fb=Fun(b); For itr = 1:imax xNS=b-Fb*(a-b)/(Fb-Fa); %extrapolate the intercept of a straight line between a and b if Fun(xNS)=0 % check to see if we stumbled onto an exact solution Xsol=xNS; Break; end if toli<tol Xsol=xNS; break %stop iterations because tolerance is met end if itr == imax Xsol=’solution not found within maximum iterations’; %check that we aren’t going over on iterations Break end if abs(Fun(Fa))< abs(Fun(Fb)) %develop new guesses. toli=abs(b-xNS)/b; b=xNS; else toli=abs(a-xNS)/a; a=xNS; end end end Secant 6) Why do the initial guesses matter when we are using numerical methods? (10 pts) Aside from the obvious needing a place to start, getting too far away affects the amount of time it takes to converge on a solution, and if there are multiple possible roots/answers, a numerical method usually converges on the answer closest to the initial guess. With some methods, the initial guesses might cause the method to not converge (Newton’s has some of these issues). 7) What is a limitation on the type of function we can use bisection or regulafalsi to solve? (10 pts) The function must cross the x-axis 8) Write a Matlab function to contain the following system of equations: (20 pts) 6y3-5x2+30e-6x=0 20x-ey=0 function fxy=fun(x,y) fxy(1)=6*y^3-5*x^2+30*exp(-6*x) fxy(2)=20*x-exp(y)