Question

I have a matlab Curve from which i would like to plot and find Concentration values at 17 different time samples

Following is the curve from which i would like to extract Concentration values at 17 different time points

first

following are the time points in minutes

t = 0,0.25,0.50,1,1.5,2,3,4,9,14,19,24,29,34,39,44,49. minutes samples

Following is the Function which i have written to plot the above graph

function c_t = output_function_constrainedK2(t, a1, a2, a3,b1,b2,b3,td, tmax,k1,k2,k3)



K_1   = (k1*k2)/(k2+k3);
K_2   = (k1*k3)/(k2+k3);
DV_free= k1/(k2+k3);


c_t = zeros(size(t));

ind = (t > td) & (t < tmax);


c_t(ind)= conv(((t(ind) - td) ./ (tmax - td) * (a1 + a2 + a3)),(K_1*exp(-(k2+k3)*t(ind)+K_2)),'same');

ind = (t >= tmax);


c_t(ind)= conv((a1 * exp(-b1 * (t(ind) - tmax))+ a2 * exp(-b2 * (t(ind) - tmax))) + a3 * exp(-b3 * (t(ind) - tmax)),(K_1*exp(-(k2+k3)*t(ind)+K_2)),'same');



plot(t,c_t);
axis([0 50  0 1400]);
xlabel('Time[mins]');
ylabel('concentration [Mbq]');
title('Model :Constrained K2');
end

If possible, Kindly please suggest me some idea how i could possibly alter the above function so that i can come up with concentration values at 17 different time points stated above

Following are the input values that i have used to come up with the curve

 output_function_constrainedK2(0:0.1:50,2501,18500,65000,0.5,0.7,0.3,3,8,0.014,0.051,0.07)
Was it helpful?

Solution

This will give you concentration values at the time points you wanted. You will have to put this inside the output_function_constrainedK2 function so that you can access the variables t and c_t.

T=[0 0.25 0.50 1 1.5 2 3 4 9 14 19 24 29 34 39 44 49];
concentration=interp1(t,c_t,T) 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top