Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. function c_t = output_function_constrainedK2(t, a1, a2, a3,b1,b2,b3,td, tmax,k1,k2,k3)
  2.  
  3. K_1 = (k1*k2)/(k2+k3);
  4. K_2 = (k1*k3)/(k2+k3);
  5. DV_free= k1/(k2+k3);
  6.  
  7.  
  8. c_t = zeros(size(t));
  9.  
  10. ind = (t > td) & (t < tmax);
  11.  
  12.  
  13. c_t(ind)= conv(((t(ind) - td) ./ (tmax - td) * (a1 + a2 + a3)),(K_1*exp(-(k2+k3)*t(ind)+K_2)),'same');
  14.  
  15.  
  16. ind = (t >= tmax);
  17.  
  18.  
  19. 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');
  20.  
  21.  
  22.  
  23. plot(t,c_t);
  24. axis([0 50 0 1400]);
  25. xlabel('Time[mins]');
  26. ylabel('concentration [Mbq]');
  27. title('Model :Constrained K2');
  28. end
  29.  
  30. output_function_constrainedK2(0:0.1:50,2501,18500,65000,0.5,0.7,0.3,...
  31. 0.28,0.9,0.014,0.051,0.07)
  32.  
  33. 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');
  34.  
  35. plot(t,c_t);
  36.  
  37. c_t = c_t + normrnd(mu,sigma,length(c_t),1)
  38.  
  39. help normrnd
  40.  
  41. c_t_noise = c_t + normrnd(mu,sigma,1,length(c_t))
  42.  
  43. plot(t,c_t, t,c_t_noise)
  44.  
  45. plot(t,c_t)
  46. hold on %tells matlab to put plots in the same figure
  47. plot(t,c_t_noise)
  48. hold off %this line if you pretend to make some other plot, desactivate hold on
  49.  
  50. help hold
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement