Guest User

Untitled

a guest
Mar 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. u = -x^2 + 10 x
  2. phiD6[x_] = WaveletPhi[DaubechiesWavelet[6], x]
  3.  
  4. c = Integrate[u phiD6[x], {x, 0, 10}]
  5.  
  6. dw6 = Head[Simplify[WaveletPhi[DaubechiesWavelet[6], x], 0 <= x <= 11]];
  7.  
  8. dw6["InterpolationOrder"]
  9.  
  10. pts = Transpose[{Flatten[dw["Grid"]], dw["ValuesOnGrid"]}];
  11.  
  12. pw[u_] = Piecewise[{InterpolatingPolynomial[#, u], #[[1, 1]] <= u < #[[2, 1]]} &
  13. /@ Partition[pts, 2, 1]];
  14.  
  15. Integrate[(10 x - x^2) pw[x], {x, 0, 10}]
  16. 11.911233499644986
  17.  
  18. Total[Integrate[(10 x - x^2) InterpolatingPolynomial[#, x], {x, #[[1, 1]], #[[2, 1]]}] & /@
  19. Partition[Select[pts, 0 <= #[[1]] <= 10 &], 2, 1],
  20. Method -> "CompensatedSummation"]
  21. 11.911233499644995
  22.  
  23. quad[{{x0_, y0_}, {x1_, y1_}}] =
  24. Simplify[Integrate[(10 x - x^2) InterpolatingPolynomial[{{x0, y0}, {x1, y1}}, x],
  25. {x, x0, x1}]]
  26.  
  27. Total[quad /@ Partition[Select[pts, 0 <= #[[1]] <= 10 &], 2, 1],
  28. Method -> "CompensatedSummation"]
  29. 11.911233499644984
  30.  
  31. u = -x^2 + 10 x;
  32. phiD6[x_] := WaveletPhi[DaubechiesWavelet[6], x];
  33.  
  34. NIntegrate[u*phiD6[x], {x, 0, 10}, Method -> "GaussKronrodRule", AccuracyGoal -> 6,
  35. MaxRecursion -> 20, WorkingPrecision -> 10]
  36.  
  37. (* 11.91115887 *)
Add Comment
Please, Sign In to add comment