Question: Can you help us figure out how to code this problem in Matlab? Below is the bisection code which we need to use. We do

Can you help us figure out how to code this problem in Matlab?Can you help us figure out how to code this problem in Below is the bisection code which we need to use. We do not know how to create a function for this problem

function bisection(func,ab,tolx,tolfx)

%func is the nonlinear function %ab is the bracketing interval [a,b] %tolx is the tolerance for error in estimating error %tolfx is the tolerance for error in function value at solution

maxiters=50; %maximum number of iterations allowed

a=ab(1); b=ab(2); fa=feval(func,a); %evaluate function at a fb=feval(func,b); %evaluate function at b

fprintf(' # root f(x) ');

for i=1:maxiters x=(a+b)/2; fx=feval(func,x); fprintf('%3d %7.6f %7.6f ', i,x,fx); if (abs(fx)

3. Saturation of oxygen in water concentration that is dependent upon the temperature of water. The saturation concentration of dissolved oxygen in water can be calculated using the following empirical equation Oxygen can dissolve in water up to a saturation 1.575701105 6.642308107 1.2438001010 In Sow =-139.3441 1 + 8.62 1949 1011 where sow-the saturation concentration of dissolved oxygen in water at 1 atm (mg/l) and Ta = absolute temperature (K). Remember that Ta = T + 273.15. where Te -temperature (C). According to this equation, saturation decreases with increasing temperature. For typical water samples near ambient temperature, this equation can be used to determine oxygen concentration ranges from 14.621 mg/l at 0 C to 6.949 mg/l at 35 C. Given a value of oxygen concentration, this formula and the bisection method can be used to solve for the temperature in degrees Celsiu:s (a) If the initial guesses are set as 0 and 35 C, how many bisection iterations would be required to determine temperature to an absolute error of 0.05 C? (b) Based on (a), develop and test a bisection m-file function to determine Tas a 8, 10, function of a given oxygen concentration. Test your function for Sow and 14 mg/1. Check your results

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!