How to smooth seasonal averages into a continuous function?
Show older comments
Hi, I have a system of four non linear ordinary differential equations:
dy(1,1) = (k1(t).*(y(4)-y(1)).*y(3))./(y(2)+y(3)-1e-12) - k2(t).*y(1).*(y(2)./(y(2)+y(3)-1e-12)) ;
dy(2,1) = (mu(t).*(y(2).^2)/(K(t).^2+y(2).^2)).*exp((-y(1)).*k(t))-(k3(t).*y(1).*y(2))./(y(2)+y(3)-1e-12)-(d1(t)+gamma1(t).*y(4)).*y(2);
dy(3,1) = (k3(t).*y(1).*y(2))./(y(2)+y(3)-1e-12)-(d2(t)+gamma2(t).*y(4)).*y(3);
dy(4,1) = r(t).*y(4).*(1-(y(4)./(alpha(t).*(y(2)+y(3)-1e-12))));
% Nested k1
function y = k1(t)
y = [0.1593,0.1460,0.1489,0.04226];
idx = logical(histc(t,[0,91.25,182.5,273.75,365]));
y = y(idx);
end
% Nested k2
function y = k2(t)
y = [0.04959,0.03721,0.04750,0.008460];
idx = logical(histc(t,[0,91.25,182.5,273.75,365]));
y = y(idx);
end
There are 12 parameters(like k1,k2 and so on) involved in the model and they are known as their seasonal averages in the literature. I want to construct continuous functions from the seasonal averages by using interpolation/approximation. I have no idea where to start from! Your guidance, comments, reference to any book or code will be greatly appreciated. Thanks
2 Comments
Jan
on 25 Mar 2013
The question is not clear. Actually the posted code does not concern theproblem at all, when I understand correctly, but you only want a continuos function to approximate your k1(t) to k12(t). So please post the available values of these parameters and explain, which function should be used for fitting.
Rose
on 13 Apr 2013
Accepted Answer
More Answers (0)
Categories
Find more on Structural Mechanics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!