Guest User

Untitled

a guest
Jul 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. lst = Table[X0 = 600;
  2. Y0 = 300; [Mu]x = 0.006; [Mu]y = 0.006; [Mu]2 =
  3. 0.00001; [Lambda] = 1; [Sigma]x = 1; [Sigma]y = 1; [Gamma]x =
  4. 0.1; [Gamma]y = 0.2; [Epsilon]y = 10; [Phi] = 10; [Alpha] =
  5. 0.008;
  6. gx[t_, [Phi]_, [Lambda]_, [Epsilon]x_] :=
  7. If[t < [Epsilon]x, 0,
  8. PDF[GammaDistribution[[Phi], 1/[Lambda]], t - [Epsilon]x]];
  9. gy[t_, [Phi]_, [Lambda]_, [Epsilon]y_] :=
  10. If[t < [Epsilon]y, 0,
  11. PDF[GammaDistribution[[Phi], 1/[Lambda]], t - [Epsilon]y]];
  12. soln[[Epsilon]x_] =
  13. sol := NDSolve[{
  14. !(
  15. *SubscriptBox[([PartialD]), (t)](x1[t])) ==
  16. x3[t] gx[t, [Phi], [Lambda], [Epsilon]x] -
  17. x1[t] ([Gamma]x + [Mu]x),
  18. !(
  19. *SubscriptBox[([PartialD]), (t)](x2[
  20. t])) == [Gamma]x x1[t] - [Mu]2 x2[t],
  21. !(
  22. *SubscriptBox[([PartialD]), (t)](y1[t])) ==
  23. y3[t] gy[t, [Phi], [Lambda], [Epsilon]y] -
  24. y1[t] ([Gamma]y + [Mu]y),
  25. !(
  26. *SubscriptBox[([PartialD]), (t)](y2[
  27. t])) == [Gamma]y y1[t] - [Mu]2 y2[t],
  28. !(
  29. *SubscriptBox[([PartialD]), (t)](x3[t])) == 0,
  30. !(
  31. *SubscriptBox[([PartialD]), (t)](y3[t])) == 0,
  32. x1[0] == 0, x2[0] == 0, y1[0] == 0, y2[0] == 0, x3[0] == X0,
  33. y3[0] == Y0},
  34. {x1, x2, x3, y1, y2, y3}, {t, 0, 120}];
  35. Xtotal = {X0}; Ytotal = {Y0};
  36. For[y = 0, y < 30, y++,
  37. loop = sol;
  38. X0 = [Sigma]x y2[120] /. loop[[1, 4]];
  39. Y0 = [Sigma]y x2[120]/(1 + [Alpha] x2[120]) /. loop[[1, 3]];
  40. Xtotal = Append[Xtotal, X0];
  41. Ytotal = Append[Ytotal, Y0];
  42. ];, {[Epsilon]x, 0, 10, 5}]
  43. ListPlot[Xtotal]
  44. ListPlot[Ytotal]
Add Comment
Please, Sign In to add comment