0
$\begingroup$

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 π}]
$\endgroup$
  • $\begingroup$ What happens when you plug in a numerical value for your integration variable into your integrand? (E.g. for NIntegrate[f, {x, 0, 1}] try something like f /. x -> 0.5, substituting your integrand for f, your variable for x, and numerical value in the interval of integration for 0.5.) $\endgroup$ – Michael E2 Jul 21 '17 at 4:37
  • $\begingroup$ Not sure if this is what you meant, but I coudn't get this to work either. f = ((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:53
  • $\begingroup$ I meant for you to plug in an appropriate floating-point number for your variable, which is t not x. Use ReplaceAll to substitute a number for a variable as mentioned (e.g. ...<integrand>... /. t -> 1.). $\endgroup$ – Michael E2 Jul 21 '17 at 5:03
  • $\begingroup$ Thank you. I used ReplaceAll[t -> 1.][f] with f saved as my integrand. That gives me the a vector of a bunch of different numbers that was too long to paste in here ( x component being ` {-0.014 (-0.118 (-0.0535 \ - vdust[{-7000.053, -4999.55, 9999.999}]) - 0.0001282 (-0.0000581 - vdust[{-7000.0536, -4999.55, 9999.999}]) + 0.99298 (0.45001 - vdust[{-7000.053, -4999.55, 9999.9999}])) ` What can I do with that now? @MichaelE2 $\endgroup$ – Scott Field Jul 21 '17 at 5:31
  • $\begingroup$ You seem to have a vdust in there: that's not a number. It's telling you vdust 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 define vdust 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
2
$\begingroup$

There is two errors in your definition of vdust. The following is correct:

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)};

First you want to define the argument as a vector because the output of rOrb is a vector. Second one of the E's was and e, which is undefined.

$\endgroup$
  • $\begingroup$ Thanks that fixed it! $\endgroup$ – Scott Field Jul 21 '17 at 15:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.