?? kineticdatafit.m
字號:
function KineticDataFit
% Analysis of kinetic rate data by using the differential method
%
% Reaction of the type -- rA = kCA^order
% order - reaction order
% rA -- reaction rate vector
% CA -- concentration vector for reactant A
% t -- vector of reaction time
% k- reacion rate constant
%
% Author: HUANG Huajiang
% Copyright 2003 UNILAB Research Center,
% East China University of Science and Technology, Shanghai, PRC
% $Revision: 1.0 $ $Date: 2003/04/26 $
clear all
clc
% 動力學數據
t = [0 20 40 60 120 180 300];
CA = [10 8 6 5 3 2 1];
% 用最小二乘樣條擬合法計算微分dCA/dt--使用不經過實驗點的B樣條插值函數
knots = 3;
K = 3; % 三次B樣條
sp = spap2(knots,K,t,CA)
sp = spap2(newknt(sp),K,t,CA);
pp = fnder(sp) % 計算B樣條函數的導函數
dCAdt = fnval(pp,t) % 計算t處的導函數值
% 繪制圖形
ti = linspace(t(1),t(end),200);
CAi = fnval(sp,ti)
plot(t,CA,'ro',ti,CAi,'b-')
xlabel('t')
ylabel('C_A')
figure
fnplt(pp)
% dCAdti = fnval(pp,ti)
% plot(ti,dCAdti,'-')
xlabel('t')
ylabel('dC/dt')
% 線性擬合
rA = dCAdt;
y = log(-rA);
x = log(CA);
p = polyfit(x,y,1);
k = exp(p(2))
n = p(1)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -