Question
use the linearize model to estimate k and C0 based on the following data using matlab
Required information Linear regression provides a powerful technique for fitting a best line to data. The below figure shows
comm ucation.com work: Chapter 14 Help Save & Exit Submit Required information 56:06 Linearization Lineariation Slope Interce
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Screenshot of the program:  linearizeModel.m

24 moliz. anti koji Data : Initialize time vector t = [0 0.5 1 1.5 2 3 4 5); Initialize concentrations vector at each time c

Sample output:

Command Window >> linearizeModel The value of k is 0.1332 L^2/ (mg 2 d) and the value of co is 3.0324 mg/L. fx >>

- O X Figure 1 File Edit View Insert Tools Desktop Window Help Data -Untransformed Model Concentration 0 0.5 1 1.5 2 3 3.5 4

- O X Figure 2 File Edit View Insert Tools Desktop Window Help o Transformed Data - Transformed Model Concentration 0 0.5 1 1

Code to copy:

%Data : Initialize time vector
t = [0 0.5 1 1.5 2 3 4 5];
%Initialize concentrations vector at each time
c = [3.26 2.09 1.62 1.48 1.17 1.06 0.9 0.85];
X =t;
Y = 1./c.^2;
a = polyfit(X,Y,1);
a0 = a(2);
a1 = a(1);
k = a1/2;
c0 = 1/sqrt(a0);
fprintf('The value of k is %.4f L^2/(mg^2 d)', k);
fprintf('and the value of c0 is %.4f mg/L.\n', c0);
%find error
e = (Y-a0-a1.*X).^2;
%find sum of squares of error
sr = sum(e);
%find standard deviation
Sy = sqrt(sr/(28-1));
C =c0./(sqrt(1+2*k*c0^2*t));
C_e = polyval(a,X);
%plot the data
plot(t,c, 'o',t,C);
xlabel('Time (d)');
ylabel('Concentration');
legend('Data','Untransformed Model');
grid on
figure(2)
plot(X,Y,'o',X,C_e)
xlabel('Time (d)');
ylabel('Concentration');
legend('Transformed Data','Transformed Model');
grid on

Add a comment
Know the answer?
Add Answer to:
use the linearize model to estimate k and C0 based on the following data using matlab...
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