Question
Need the solution in Matlab

MU UUNIUI) in the tex the same initial guesses as in (b). (5.9) The saturation concentration of dissolved oxygen in freshwate
0 0
Add a comment Improve this question Transcribed image text
Answer #1

solution

a) For the initial guess set 0 and 40°C The number of iterations are usedn element To achieve a given error (tolerance), e Itb) Smatlab code %bisection.m clc clear all; close all; Supper and lower limit value xu 0 xl- 40 for osf 8:2:12 &to find the aelse x (2) xr (1); y (2) y (1) Send loop end %test the solution solution=zeros (1,100) loop executes for i-2:100 iterate the

//output

Result Executing the program.... Soctave -qf-no-window-system main.m the number of iteration required to get an absolute erro

//copyable code

b)

%matlab code

%bisection.m

clc;

clear all;

close all;

%upper and lower limit value

xu=0;

xl=40;

for osf=8:2:12

%to find the approximte temperature function T

f=@(T) (exp((-139.34411)+((1.575701*10^5)./(T+273.15))-((6.642308*10^7)./((T+273.15).^2))+((1.243800*10^10)./((T+273.15).^3))-((8.621949*10^11)./((T+273.15).^4)))-osf);

%lower and upper limit interval

x(1)=xu;

y(1)=xl;

%calculate interval iteration

xr(1)=(xu+xl)/2;

%loop executes

if (f(x(1))*f(xr(1)))<0

%update the upper limit

x(2)=x(1);

y(2)=xr(1);

else

x(2)=xr(1);

y(2)=y(1);

%end loop

end

%test the solution

solution=zeros(1,100);

%loop executes

for i=2:100

%iterate the interval

xr(i)=(x(i)+y(i))./2;

%check upper and lower limit condition

if (f(x(i))*f(xr(i)))<0

x(i+1)=x(i);y(i+1)=xr(i);

else

x(i+1)=xr(i);y(i+1)=y(i);

end

%absolute error

if (xr(i)-xr(i-1))<=0.05

solution(i)=xr(i);

end

%end loop

end

disp(['the number of iteration required to get an absolute error 0.05 is ' num2str(osf)]);

disp('answer=')

display(solution(100));

end

Add a comment
Know the answer?
Add Answer to:
Need the solution in Matlab MU UUNIUI) in the tex the same initial guesses as in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need the Matlab code please. Problem Statement #2: ds (c) using the To the same...

    I need the Matlab code please. Problem Statement #2: ds (c) using the To the same initial guesses as in (b). 5.9) The saturation concentration of dissolved oxygen in freshwater can be calculated with the equation 1.575701 x 105 In of =-139.3441144 20 34411 + - Ta where mum const! of the 1.243800 x 100 6.642308 x 107 1 = 1 72 8.621949 x 1011 Deva ks = 5.12 car where Oxf = the saturation concentration of dissolved oxy- gen...

  • The saturation concentration of dissolved oxygen in freshwater can be calculated with the equation, ln Osf...

    The saturation concentration of dissolved oxygen in freshwater can be calculated with the equation, ln Osf = −139.34411 + 1.575701 × 105 Ta − 6.642308 × 107 T2 a + 1.243800 × 1010 T3 a − 8.621949 × 1011 T4 where Osf is the saturation concentration of dissolved oxygen in freshwater at 1 atm (mg/L) and Ta is the absolute temperature in Kelvin (K), where Ta = T + 273.15, where T is the temperature in Celsius (oC). According to...

  • The saturation concentration of dissolved oxygen in freshwater can be calculated with the equatio...

    The saturation concentration of dissolved oxygen in freshwater can be calculated with the equation: In osf - -139.34411 +1.575701 x 10-6.642308 x 101.243800 x 1010 1-8.621949 x 10" 10101-8.621949 x 10 1 where, osf is the saturation concentration of dissolved oxygen in freshwater at I atm ( osf is in mg/liter); and Ta absolute temperature (K). According to this equation, saturation decreases with increasing temperature. For typical natural waters, the oxygen concentration ranges from 14.621 mg/liter at 0°C (273 K)...

  • matlab please TABLE P15.5 Dissolved oxygen concentration in water as a function of temperature (°C) and...

    matlab please TABLE P15.5 Dissolved oxygen concentration in water as a function of temperature (°C) and chloride concentration (O/L). Dissolved Oxygen (mg/L) for Temperature (C) and Concentration of Chloride (g/L) C=Og/L c=10 g/l c=20 g/L 14.6 12.9 11.4 12.8 11.3 10.3 11.3 10.1 8.96 10.1 9.03 8.08 9.09 8.17 7.35 8.26 7.46 6.73 6.85 6.20 1.56 the percent relative error for your prediction. Explain pos sible causes for the discrepancy. 15.7 As compared with the models from Probs. 15.5 and...

  • please help with #1 a and b. thank you Use the following data for all problems:...

    please help with #1 a and b. thank you Use the following data for all problems: The data below defines the sea-level concentration of dissolved oxygen for fresh water as a function of temperature: T°C omg/L 0 8 16 14.621 11.843 9.870 24 32 40 8.418 7.305 6.413 a. Approximate o(19) using a 1st order Newton's interpolating polynomial. b. Approximate o(19) using a 2nd order Newton's interpolating polynomial. 2) Use linear algebra to find the coefficients of the 2nd order...

  • i need the answer to be on a MatLab window 1. Consider the following equation, which...

    i need the answer to be on a MatLab window 1. Consider the following equation, which represents the concentration (c, in mg/ml) of a drug in the bloodstream over time (t, in seconds). Assume we are interested in a concentration of c2 mg/ml C3te-0.4t A. Estimate the times at which the concentration is 2 mg/ml using a graphical method Be sure to show your plot(s). Hint: There are 2 real solutions B. Use MATLAB to apply the secant method (e.g....

  • using Matlab: A drug administered to a patient produces a concentration in the bloodstream given by...

    using Matlab: A drug administered to a patient produces a concentration in the bloodstream given by c(t)=Ate^(-t/3) milligrams per milliliter, t hours after A units have been injected. The maximum safe concentration is 1.00 mg/mL. What amount should be injected to reach this maximum safe concentration, and when does this maximum occur? (Use calculus to find the time when a maximum occurs. Then set c(tmax) = 1 to solve for A.) An additional amount of this drug is to be...

  • the equilibrium concentration of dissolved oxygen jn mg/L in Lake Titicaca. The elevation is 3.850 m...

    the equilibrium concentration of dissolved oxygen jn mg/L in Lake Titicaca. The elevation is 3.850 m (atmospheric pressure = 0.62 atm)? Assume T-20 °C and K 0.62 atm)? Assume T-20 °C and Kn730 atm-L/mol. What would the concentration be with the same temperature at sea level? Explain the significance of this equation for a) developing and b) developed countries: 1 - (P)(A)(T)

  • I wonder how to a problem 5.13. This problem is related to applied numerical methods with Matlab(third edition). I want Matlab code. 5.13 Figure P5.13a shows a uniform beam subject to a lin- early...

    I wonder how to a problem 5.13. This problem is related to applied numerical methods with Matlab(third edition). I want Matlab code. 5.13 Figure P5.13a shows a uniform beam subject to a lin- early increasing distributed load. The equation for the result- ing elastic curve is (see Fig. P5.13b) htm U) (P5.13) 3 3" Use bisection to determine the point of maximum deflection (i.e, the value of x where dy/dx 0). Then substitute this value into Eq. (P5 13) to...

  • I’m part a what do I put in fx= to execute the function A chemical reaction...

    I’m part a what do I put in fx= to execute the function A chemical reaction is being carried out in a well-stirred tank. The concen- tration of the substance being created can be calculated as a function of time using the formula 59 where C is the concentration in moles per liter and t is the time in seconds. (a) Construct a table of concentration versus time within an Excel work- sheet for the case where a 8 mole/L...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT