Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- output_function_constrainedK2(0:0.1:50,2501,18500,65000,0.5,0.7,0.3,...
- 0.28,0.9,0.014,0.051,0.07)
- 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);
- c_t = c_t + normrnd(mu,sigma,length(c_t),1)
- help normrnd
- c_t_noise = c_t + normrnd(mu,sigma,1,length(c_t))
- plot(t,c_t, t,c_t_noise)
- plot(t,c_t)
- hold on %tells matlab to put plots in the same figure
- plot(t,c_t_noise)
- hold off %this line if you pretend to make some other plot, desactivate hold on
- help hold
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement