daily pastebin goal
87%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. NN = 300; n = 30; M = 5;
  2. k = a*(M + 1)^2/NN;
  3. ei[l_] := 1 + 2*k*Cos[Pi*l/(M + 1)] - 2*k;
  4. prod = 1;
  5. For[l = 1, l <= M, l++,
  6.   prod = prod*ei[l];
  7.   ];
  8. dA = Simplify[prod];
  9. R = ConstantArray[0, {M, M}];
  10. For[jj = 1, jj <= M, jj++,
  11. For[l = 1, l <= M, l++,
  12.     R[[jj, l]] = Sin[l*Pi*jj/(M + 1)];
  13.     ];
  14.   ];
  15. Q = Simplify[Sqrt[2/(M + 1)]*R];
  16. Dinvn = ConstantArray[0, {M, M}];
  17. For[l = 1, l <= M, l++,
  18.   Dinvn[[l, l]] = 1/ei[l]^n;
  19.   ];
  20. Ainvn = Q.Dinvn.Transpose[Q];
  21. dAi = 1/dA^n;
  22. f[x_] := PDF[
  23.    ProductDistribution[NormalDistribution[0, 1],
  24.    NormalDistribution[0, 1], NormalDistribution[0, 1],
  25.    NormalDistribution[0, 1], NormalDistribution[0, 1]], x];
  26. w = {x[1], x[2], v, x[4], x[5]};
  27. integrand = f[Ainvn.w]*dAi;
  28. NIntegrate[integrand /. v -> 1, {x[1], -[Infinity], [Infinity]},{x[2],-[Infinity],[Infinity]}, {x[4], -[Infinity], [Infinity]}, {x[5],-[Infinity], [Infinity]}, {a, 1, 2}]
  29.    
  30. NIntegrate::izero: Integral and error estimates are 0 on all integration subregions. Try increasing the value of the MinRecursion option. If value of integral may be 0, specify a finite value for the AccuracyGoal option.
  31.  
  32. 0.
  33.    
  34. dAi /. a -> 1.4
  35.  
  36. 2.06591*10^30
  37.  
  38. Ainvn.w /. {x[1] -> 1, x[2] -> 1, x[4] -> 1, x[5] -> 1, a -> 1.5, v -> -0.5}
  39.  
  40. {-6.71576*10^13, 1.1632*10^14, -1.34315*10^14, 1.1632*10^14, -6.71576*10^13}
RAW Paste Data
Top