Message Boards Message Boards

Solve this integration in a loop?

GROUPS:

I have a ellipse, that i want to clip in equal sized (Area) parts. In a circle it´s simply taking 2 Pi and devide it by the wanted numbers.. At an ellipse it´s more complicated. And I am sure I got the result, but i don´t know how to set my Mathematica to do it... To simplify i set one radius to 1, the other one to 2. I want 30 parts of the ellipse.

The function for the ellipse is: ell=b/Sqrt[1 - ((a^2 - b^2)*Cos[phi]^2)/a^2]

So the Area for a part of the ellipse is (from "start" to "x" in rad): 1/2Integrate[ell^2, {phi, start, x}]

I don´t know, why following code doesn´t work:

a = 1;
b = 2;
step = 30;
start = 0;
ell = b/Sqrt[1 - ((a^2 - b^2)*Cos[phi]^2)/a^2];
For [i = 1, i < step+1, i++,
  Solve[1/2 Integrate[ell^2, {phi, start, x}] == a*b*Pi/step, {x}];
  start = x
  ]

I would appreciate every help!

POSTED BY: Hallo vonMir
Answer
4 months ago

Assuming the formula are right, I do the following to make the program (as you wrote it) to work. Starting at the "For loop".

For[i = 1, i < step + 1, i++,

 (*Assigned integration to variable ans to make the next assignemnt \
easier to understand.*)
 ans = FindRoot[
   1/2 Integrate[ell^2, {phi, start, x}] == a*b*Pi/step, {x, 0.1}];
 (*We had solved for x in the previous line, so we need to extract \
the number other wise we would have {x->number}, which can't be \
re-used.*)
 start = x /. ans[[1]];

 (*This is just a debug print. You could assign the answers into a \
list.*)
 Print[i, " ", start]]

Are these the answers your anticipated (i,start) pairs? You can remove the 0.I with the Chop command. (1, 0.401966) (2, 0.727518+0. I) (3, 0.96804+0. I) (4,1.14777+0. I) (5, 1.28976+0. I) (6,1.40974+0. I) (7, 1.51829+0. I)

POSTED BY: Isaac Abraham
Answer
4 months ago

Group Abstract Group Abstract