I am having trouble with the NIntegrate
at the bottom. I've tried using NumericQ
in different ways but keep getting an error message (NIntegrate::inumr
) saying that it evaluates to non-numerical values for all sampling points.
For more context the problem is question 9 here .
rOrb[t_] =
{-1769.42 - 5230.58 Cos[0.0001 t] - 536.31 Sin[0.0001 t],
1233.56 - 6233.56 Cos[0.0001 t] + 4499.51 Sin[0.0001 t],
4187.62 + 5812.38 Cos[0.0001 t]};
T[t_] := Simplify[ rOrb'[t] / Norm[ rOrb'[t] ], t ϵ Reals];
vOrb[t_] := D[rOrb[t], t];
vdust[x_, y_, z_] :=
1.7 {E^(-4 10^(-8) x^2), E^(-4 10^(-8) y^2), e^(-1.6 10^(-9) z^2)};
ρdust = 2 10^-6;
NIntegrate[((vOrb[t] - vdust[rOrb[t]]).T[t]) ρdust rOrb[t], {t,
0, 20000 π}]
NIntegrate[f, {x, 0, 1}]
try something likef /. x -> 0.5
, substituting your integrand forf
, your variable forx
, and numerical value in the interval of integration for0.5
.) $\endgroup$ – Michael E2 Jul 21 '17 at 4:37f = ((vOrb[t] - vdust[rOrb[t]]).T[t]) \[Rho]dust rOrb[t]; NIntegrate[f, {x, 0, 0.5}]
@MichaelE2 $\endgroup$ – Scott Field Jul 21 '17 at 4:53t
notx
. UseReplaceAll
to substitute a number for a variable as mentioned (e.g....<integrand>... /. t -> 1.
). $\endgroup$ – Michael E2 Jul 21 '17 at 5:03vdust
in there: that's not a number. It's telling youvdust
is not defined right, or you're not using it right; otherwise, it would evaluate to a number. There are two choices: change how you definevdust
or change how you are using it. The first way is fairly simple: just add braces to the def.:vdust[{x_, y_, z_}] :=...
$\endgroup$ – Michael E2 Jul 21 '17 at 5:55