SAE70 - b=%5.4f\n\n',aa,ans(2)); %Need a better fit for...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function SAE70(T,V) %Problem 13.18 % %T=Temperature in degrees celsius %Viscosity,u,N*s/m^2 % %This Program uses linear regression to find the equation of the line %that best fits the data and the r^2 value. x=log10(T); a=log10(V); n=length(T); c=ones(n,1); CM=[c x]; %Coeff Matrix ans=CM\a; aa=10^(ans(1)); ab=ans(2); fprintf('\na=%5.4f,
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: b=%5.4f\n\n',aa,ans(2)); %Need a better fit for this graph %need more points--> TT=linspace(min(T),max(T),100); y=aa.*TT.^ab; plot(T,V,'k o',TT,y,'g'); title('Plot of original data with nonlinear model fit:'); ylabel('T(C)'); xlabel('Viscosity(N*s/m^2)'); for i=1:n St=(ysum-y(i))^2+St_old; St_old=St;...
View Full Document

This note was uploaded on 09/27/2011 for the course EGM 3344 taught by Professor Raphaelhaftka during the Spring '09 term at University of Florida.

Ask a homework question - tutors are online