Message Boards Message Boards

0
|
5302 Views
|
3 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Speed up evaluation of this integral?

Posted 5 years ago

I am trying to evaluate the integral

$$ \int_0^{2\pi}\frac{D_{11}^2+2D_{12}^2+D_{22}^2+D_{33}^2}{1+e\cos x(t)}dx $$

Where $D_{ij}$ are third derivatives wrt $t$ as defined below.

a[psi_] := k1/(1 + e*Cos[psi]);
d[psi_] := p1/(1 + e*Cos[psi]);
D11 = D[a[x[t]]*(Cos[x[t]]^2 - 1/3), {t, 3}];
D12 = D[a[x[t]]*Cos[x[t]]*Sin[x[t]], {t, 3}];
D22 = D[a[x[t]]*(Sin[x[t]]^2 - 1/3), {t, 3}];
D33 = D[-a[x[t]]/3];

To do this I have written the input

Assuming[Element[k1, Reals] && Element[e, Reals] && 
x'[t] == p2/(d[x[t]]^2) && Element[p2, Reals] && 
Element[p2, Reals], 
Integrate[(D11^2 + 2*D12^2 + D22^2 + D33^2)/(1 + e*Cos[x[t]])^2, {x[
t], 0, 2*Pi}]]

This is taking a very long time to evaluate (has been running for hours), is it OK to specify to Mathematica that I have the condition $\dot{x}=\frac{p_2}{d(x(t))^2}$ in this manner? How could this be sped up?

This integral arose in the study of the loss of energy of an orbiting mass due to gravitational radiation.

POSTED BY: tom ri
3 Replies

It takes less than a minute. But first you need to simplify the expression

a[psi_] := k1/(1 + e*Cos[psi]);
d[psi_] := p1/(1 + e*Cos[psi]);
D11 = D[a[x[t]]*(Cos[x[t]]^2 - 1/3), {t, 3}];
D12 = D[a[x[t]]*Cos[x[t]]*Sin[x[t]], {t, 3}];
D22 = D[a[x[t]]*(Sin[x[t]]^2 - 1/3), {t, 3}];
D33 = D[-a[x[t]]/3, {t,3}];


x'[t] = p2/d[x[t]]^2

x''[t] = D[x'[t], t]

x'''[t] = D[x'[t], t, t]

Et = (D11^2 + 2*D12^2 + D22^2 + D33^2)/(1 + e*Cos[x[t]])^2 //FullSimplify
Integrate[Et, {x[t], 0, 2*Pi}] //AbsoluteTiming
{2.57266, ((1536 + 20320 e^2 + 35616 e^4 + 10988 e^6 + 
        315 e^8) k1^2 p2^6 \[Pi])/(24 p1^12)}

Very insightful. There is a problem that the OP's numerator is not dimensionally consistent. The D33 term is the partial derivative with respect to nothing, which bothered me. Presuming that D33 should also be the third derivative with respect to t, your approach is even faster and contains no conditional expression.

a[psi_] := k1/(1 + e*Cos[psi]);
d[psi_] := p1/(1 + e*Cos[psi]);
D11 = D[a[x[t]]*(Cos[x[t]]^2 - 1/3), {t, 3}];
D12 = D[a[x[t]]*Cos[x[t]]*Sin[x[t]], {t, 3}];
D22 = D[a[x[t]]*(Sin[x[t]]^2 - 1/3), {t, 3}];
(*D33=D[-a[x[t]]/3]*)(* From the OP *)
D33 = D[-a[x[t]]/3, {t, 3}];

x'[t] = p2/d[x[t]]^2;

x''[t] = D[x'[t], t];

x'''[t] = D[x'[t], t, t];

Et = (D11^2 + 2*D12^2 + D22^2 + D33^2)/(1 + e*Cos[x[t]])^2 // 
  FullSimplify
Integrate[Et, {x[t], 0, 2*Pi}] // AbsoluteTiming

(* {2.819966958116478`,((1536+20320 e^2+35616 e^4+10988 e^6+315 e^8) \
k1^2 p2^6 \[Pi])/(24 p1^12)} *)
POSTED BY: Tim Laska

Thank you, I did not even notice the error in the definition of D3. After correcting the code, the result has changed. I also changed my post.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract