Project

curve fit

clear all
close all
clc

%preparing the data

cp_data=load(\'data\');
temperature=cp_data(:,1);
cp=cp_data(:,2);

%curve fi
%cp=a*T^2+b*T+c
co_effi=polyfit(temperature,cp,3)
predicted_cp=polyval(co_effi,temperature);
% compare my curve fit with the orijinal

%plot 
plot(temperature,cp,\'linewidth\',3);
hold on
plot(temperature,predicted_cp,\'linewidth\',3,\'color\',\'r\');

xlabel(\'temperature[k]\')
ylabel(\'specificheat[kj/kmol-k]\')
legend(\'original_dataset\',\'curve fit\')

\"curve

the blue color curve shows the varying cp which has to be constant but in practile it is varying. to correct the varying constant we draw a curved fit as above shown.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.