-
Notifications
You must be signed in to change notification settings - Fork 0
/
convtest.m
34 lines (26 loc) · 1.78 KB
/
convtest.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Hct = 0.42;
A1 = 0.809;
A2 = 0.330;
T1 = 0.17046;
T2 = 0.365;
sigma1 = 0.0563;
sigma2 = 0.132;
alpha = 1.050;
beta = 0.1685;
s = 38.078;
tau = 0.486;
CtPix = [0.0727941874425952,0.164886066516145,0.218595182884553,0.257780263444026,0.269227715850943,0.278855005415181,0.348568081111563,0.375544273738335,0.363018191789040,0.346517993156350,0.392450845035858,0.400993436353260,0.413920734135706,0.411756658376914,0.405287334142554,0.416088643978205,0.449074404881085,0.403138493437243,0.424798828729922,0.413920734135706,0.458021193007713,0.460267975680523,0.440191645080939,0.494462679637029,0.501414469559133,0.487548917706809,0.476109644001471,0.409596406537864];
t = [0.415000000000000,0.705500000000000,0.995958333333333,1.28645833333333,1.57691666666667,1.86741666666667,2.15787500000000,2.44833333333333,2.73883333333333,3.02929166666667,3.31979166666667,3.61025000000000,3.90075000000000,4.19120833333333,4.48170833333333,4.77216666666667,5.06262500000000,5.35312500000000,5.64358333333334,5.93408333333333,6.22454166666667,6.51504166666667,6.80550000000000,7.09600000000000,7.38645833333334,7.67695833333334,7.96741666666667,8.25787500000000];
Cpt = @(x,shift) (A1/(sigma1*sqrt(2*pi)).*exp(-((x-shift)-T1).^2./(2*sigma1.^2)) + A2/(sigma2*sqrt(2*pi)).*exp(-((x-shift)-T2).^2./(2*sigma2.^2)) + alpha.*exp(-beta.*(x-shift))./(1+exp(-s.*((x-shift)-tau))))./(1-Hct);
lowerBound = 13.69/60;
upperbound = t(1);
x0 = [0.3 0.1 0.2];
%With old model I get 0.1194,0.860,0.2283 in s23 12,14,1
expConv = @(kep,x) exp(-kep.*(x));
dtt = t(2)-t(1);
kineticConvModel = @(kep, ktrans, shift, x) ktrans.*conv(Cpt(x,shift),expConv(kep,x),'same').*dtt;
[kFit, kGOF, kOutputs] = fit(t',CtPix',kineticConvModel,'StartPoint',x0,'lower',[0 0 lowerBound],'upper',[100 100 upperbound]);
figure;plot(kFit)
hold on;
plot(t,CtPix);
hold off;