Question
matlab please
TABLE P15.5 Dissolved oxygen concentration in water as a function of temperature (°C) and chloride concentration (O/L). Disso
0 0
Add a comment Improve this question Transcribed image text
Answer #1

% temparature

T=[0 5 10 15 20 25 30];

% oxygen concentration for chloride concentration 0 g/L
C0=[14.6 12.8 11.3 10.1 9.09 8.26 7.56];

% oxygen concentration for chloride concentration 10 g/L
C10=[12.9 11.3 10.1 9.03 8.17 7.46 6.85];

% oxygen concentration for chloride concentration 20 g/L
C20=[11.4 10.3 8.96 8.08 7.35 6.73 6.20];


% set all chloride concentration
C=[linspace(0,0,length(T)) linspace(10,10,length(T)) linspace(20,20,length(T))];

% set time
T=[T T T];

% set all oxygen concentration
O=[C0 C10 C20];


% define a fitting function for O = f3(T) + f1(C)

myfun =fittype(@(a,b,c,d,e,cValue,TValue) a*TValue.^3+b*TValue.^2+c*TValue+d+e*cValue, 'ind', {'cValue' 'TValue'},'dep','z');

% plynomial fitting
P=fit([T',C'],O',myfun);

% display polynomial curve
disp(P);

% get value of oxygen concentration
v=P(15,12);

% relative error
error=abs(v-9.09);

fprintf('\nRelative error is %.4f\n',error);

General model: P(cValue, TValue) = a*TValue. ^3+b*TValue. ^2+c*TValue+d+e*cValue efficients (with 95% confidence bounds) : =

Add a comment
Know the answer?
Add Answer to:
matlab please TABLE P15.5 Dissolved oxygen concentration in water as a function of temperature (°C) and...
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
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