Qurak

N integrate integration strategies extrapolating oscillatory strategy

Tutorial 9 stappen, op volgorde uitgevoerd in één sessie. Elke stap is tegen de engine uitgevoerd en de uitvoer hieronder is wat hij opleverde.

Stap 1
NIntegrate[Sin[200 x ^ 2 + 5](1/(x + 1) ^ 2), {x, 0, ∞}, Method -> "ExtrapolatingOscillatory"]
Uitvoer
NIntegrate[Sin[5 + 200*x^2]/(1 + x)^2, {x, 0, Infinity}, Method -> ExtrapolatingOscillatory]
Stap 2
Clear[ω, k, f];
ω = 20;
k[x_] := Sin[ω x];
f[x_] := (1/(x + 1) ^ 2);

Geen uitvoer - deze stap zet iets klaar voor de volgende.

Stap 3
Plot[k[x]f[x], {x, 0, 10}, PlotPoints -> 1000, PlotRange -> All]
Uitvoer
-Graphics-
Stap 4
psum[i_ ? NumberQ] := NIntegrate[k[x]f[x], {x, i(1/ω) π, (i + 1)(1/ω) π}]

Geen uitvoer - deze stap zet iets klaar voor de volgende.

Stap 5
res = NSum[psum[i], {i, 0, ∞}, Method -> "AlternatingSigns", "VerifyConvergence" -> False]
Uitvoer
0.04928412772506762
Stap 6
exact = Integrate[k[x]f[x], {x, 0, ∞}]//N
Uitvoer
0.05692157040109628
Stap 7
(Abs[exact - res]/Abs[exact])
Uitvoer
0.13417484131607102
Stap 8
resEO = NIntegrate[Sin[ω x]f[x], {x, 0, ∞}, Method -> "ExtrapolatingOscillatory"]
Uitvoer
NIntegrate[Sin[20*x]/(1 + x)^2, {x, 0, Infinity}, Method -> ExtrapolatingOscillatory]
Stap 9
(Abs[exact - resEO]/Abs[exact])
Uitvoer
17.568032521828325*Abs[0.05692157040109628 - NIntegrate[Sin[20*x]/(1 + x)^2, {x, 0, Infinity}, Method -> ExtrapolatingOscillatory]]

Gebruikte functies

Gerelateerde recepten

Alle recepten · Functiereferentie · Gebruik dit vanuit een MCP-client