Question: PLEASE USE MATLAB!!! Use bisection.m below function [xn,steps,error] = bisection(f,a,b,tol) %function returns an estimate for the root, xn, and requires %inputs of the function, g,
PLEASE USE MATLAB!!!
Use bisection.m below
function [xn,steps,error] = bisection(f,a,b,tol)
%function returns an estimate for the root, xn, and requires %inputs of the function, g, the interval endpoints, a and b, %the desired tolerance for the error, tol.
error=b-a; %initialize error steps=0; %initialize step counter while error>tol steps=steps+1; %increment counter xn=(a+b)/2; %calculate xn, the midpoint of a and b if f(a)==0 || f(b)==0 %check f(a) and f(b) disp('endpoint is root!') if f(a)==0 xn=a; else xn=b; end break %If f(a or b) = 0 then landed on root and stop iterati elseif f(xn)*f(a) 0 then root is between xn and b, and xn becomes new a end error=b-a; %calculate new error end
Record: 1. your starting interval [, ], and 2. how many iterations it took you to reach .
![PLEASE USE MATLAB!!! Use bisection.m below function [xn,steps,error] = bisection(f,a,b,tol) %function returns](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3c921b40fd_76966f3c92116127.jpg)
8. DeSantis, Gironi, and Marelli ("Vector-Liquid Equilibrium from a Hard-Sphere Equation of State," Industrial and Engineering Chemistry Fundamentals, 15, 182-189, 1976) derive a relationship for the compressibility factor of real gases of the form (1-y) related to the van der Waals volume correction factor. i 2 what is the value of y? 8. DeSantis, Gironi, and Marelli ("Vector-Liquid Equilibrium from a Hard-Sphere Equation of State," Industrial and Engineering Chemistry Fundamentals, 15, 182-189, 1976) derive a relationship for the compressibility factor of real gases of the form (1-y) related to the van der Waals volume correction factor. i 2 what is the value of y
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
