Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- u = -x^2 + 10 x
- phiD6[x_] = WaveletPhi[DaubechiesWavelet[6], x]
- c = Integrate[u phiD6[x], {x, 0, 10}]
- dw6 = Head[Simplify[WaveletPhi[DaubechiesWavelet[6], x], 0 <= x <= 11]];
- dw6["InterpolationOrder"]
- pts = Transpose[{Flatten[dw["Grid"]], dw["ValuesOnGrid"]}];
- pw[u_] = Piecewise[{InterpolatingPolynomial[#, u], #[[1, 1]] <= u < #[[2, 1]]} &
- /@ Partition[pts, 2, 1]];
- Integrate[(10 x - x^2) pw[x], {x, 0, 10}]
- 11.911233499644986
- Total[Integrate[(10 x - x^2) InterpolatingPolynomial[#, x], {x, #[[1, 1]], #[[2, 1]]}] & /@
- Partition[Select[pts, 0 <= #[[1]] <= 10 &], 2, 1],
- Method -> "CompensatedSummation"]
- 11.911233499644995
- quad[{{x0_, y0_}, {x1_, y1_}}] =
- Simplify[Integrate[(10 x - x^2) InterpolatingPolynomial[{{x0, y0}, {x1, y1}}, x],
- {x, x0, x1}]]
- Total[quad /@ Partition[Select[pts, 0 <= #[[1]] <= 10 &], 2, 1],
- Method -> "CompensatedSummation"]
- 11.911233499644984
- u = -x^2 + 10 x;
- phiD6[x_] := WaveletPhi[DaubechiesWavelet[6], x];
- NIntegrate[u*phiD6[x], {x, 0, 10}, Method -> "GaussKronrodRule", AccuracyGoal -> 6,
- MaxRecursion -> 20, WorkingPrecision -> 10]
- (* 11.91115887 *)
Add Comment
Please, Sign In to add comment