Guest User

Untitled

a guest
Nov 17th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. Clear["Global`*"];
  2. n = 30; ke = 0; W = 1.22; wh = 0.12; Wd = 0.005; xx = 4.125; uxing =
  3. 0.028; h = 0.072;
  4. xm = xx/W;
  5. fai = Table[Cos[m*Pi*y], {m, 0, n}]
  6. NN = N[Integrate[fai^2, {y, 0, 1}]]
  7. a1 = 0.479;
  8. b1 = 0.03285;
  9. c1 = -0.1011;
  10. d1 = -31.6;
  11. uu1 = a1*Exp[b1*yy] + c1*Exp[d1*yy]
  12. a2 = -2.461*10^-16;
  13. b2 = 27.55;
  14. c2 = 0.4954;
  15. d2 = -0.02472;
  16. uu2 = a2*Exp[b2*yy] + c2*Exp[d2*yy]
  17. uav = Integrate[uu1, {yy, 0, W/2}]/W + Integrate[uu2, {yy, W/2, W}]/W
  18. e = 4*10^(-4);
  19. u1 = a1*Exp[b1*y*W] + c1*Exp[d1*y*W]
  20. u2 = a2*Exp[b2*y*W] + c2*Exp[d2*y*W]
  21. U1 = u1/uav
  22. U2 = u2/uav
  23. V = 0;
  24. dy = e/(uav*W); t = ke*W/uav; h1 = wh/W; h2 = (Wd + wh)/W;
  25. obsdatao =
  26. Import["https://pastebin.com/raw/Fz38738r", "Table"];
  27. obsdata = First[obsdatao];
  28. c0a = obsdata[[All, 1]]
  29. c0 = Sum[c0a[[i]]*0.01, {i, 1, 122}]/W
  30. eqns = Table[{FullSimplify[
  31. Sum[cc[j]'[x]/Sqrt[NN[[j + 1]]*NN[[m + 1]]]*
  32. Chop[
  33. Integrate[fai[[j + 1]]*fai[[m + 1]]*U1, {y, 0, W/2}] +
  34. Integrate[fai[[j + 1]]*fai[[m + 1]]*U2, {y, W/2, W}]], {j, 0,
  35. n}]] ==
  36. FullSimplify[
  37. Sum[cc[j][x]/
  38. Sqrt[NN[[j + 1]]*NN[[m + 1]]]*(Chop[
  39. Integrate[
  40. fai[[j + 1]]*D[dy*Dt[fai[[m + 1]], y], y], {y, 0, 1}]] -
  41. Integrate[
  42. V*fai[[m + 1]]*Dt[fai[[j + 1]], y], {y, 0, 1}]), {j, 0,
  43. n}] - t*cc[m][x]],
  44. cc[m][0] ==
  45. Sum[Integrate[
  46. fai[[m + 1]]/Sqrt[NN[[m + 1]]]*c0a[[k]]/c0, {y, (k - 1)/122,
  47. k/122}], {k, 1, 122}]}, {m, 0, n}]
  48. vars = Table[cc[j], {j, 0, n}];
  49. s = NDSolve[eqns, vars, {x, 0, xm}, PrecisionGoal -> Infinity,
  50. Method -> {(*"StiffnessSwitching",Automatic,*)
  51. "IndexReduction" -> Automatic,
  52. "EquationSimplification" -> {(*Automatic,*)"Residual",
  53. "TimeConstraint" -> 10, "SimplifySystem" -> True}}];
  54. s1 = Flatten[s]
  55. (* Table[cc[0][x] /. s1, {x, 0, xm}]
  56. Plot[cc[0][x] /. s1, {x, 0, xm}]
  57. Table[Plot[cc[m][x] /. s1, {x, 0, xm}], {m, 0, n}]
  58. Table[cc[m][400/122 + 1/2*25/122] /. s1, {m, 0, n}]*)
  59. c3 = Sum[fai[[m + 1]]/Sqrt[NN[[m + 1]]]*(Re[cc[m][400/122 + 1/2*25/122] /. s1]), {m, 0,
  60. n}]
  61. N[Table[c3, {y, 1/2*1/122, (1 - 1/2*1/122), 1/122}]]
  62. Plot[c3, {y, 1/2*1/122, (1 - 1/2*1/122)}, AxesLabel -> {y, c}]
Add Comment
Please, Sign In to add comment