Guest User

Untitled

a guest
Oct 19th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. u = 2;
  2. c = 3000;
  3. it = 3;
  4. Array[h, {u, c}];
  5. Do[Do[h[i, k] = 0, {i, u}], {k, c}];
  6. F[x_] := Sin[x];
  7. AA[x_] := 1/(x^2 + 1);
  8. w[x_] := F[x] + AA[x];
  9. v[x_] := Sum[w[x + i*2 Pi], {i, -it, it}];
  10.  
  11. Do[n = 1;
  12. If[j == 1,
  13. While[n <= c,
  14. h[j, n] =
  15. NDSolveValue[{y''[x] == Cos[y[x]], y'[0] == 0, y[0] == n},
  16. y, {x, 0, 1},
  17. "Method" -> {"EquationSimplification" -> {Automatic,
  18. "TimeConstraint" -> Infinity}}, AccuracyGoal -> 3]; n++];,
  19. While[n <= c, h[j, n] = NDSolveValue[{y''[x] == Cos[y[x]]
  20. + Sum[v[h[j - 1, n][x] - h[j - 1, i][x]], {i, 1, c}],
  21. y'[0] == 0, y[0] == n}, y, {x, 0, 1},
  22. "Method" -> {"EquationSimplification" -> {Automatic,
  23. "TimeConstraint" -> Infinity}}, AccuracyGoal -> 3.];
  24. n++];];, {j, u}];
Add Comment
Please, Sign In to add comment