Skip to content

Commit cb7b7ae

Browse files
better formatting
1 parent 7a30dda commit cb7b7ae

File tree

1 file changed

+19
-26
lines changed

1 file changed

+19
-26
lines changed

docs/src/examples/perturbation.md

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,51 +41,45 @@ Let's go back to our quintic. We can define a Symbolics variable as `@variables
4141

4242
We introduce a tuning parameter $\epsilon$ into our equation: $x^5 + \epsilon x = 1$. If $\epsilon = 1$, we get our original problem. For $\epsilon = 0$, the problem transforms to an easy one: $x^5 = 1$ which has an exact real solution $x = 1$ (and four complex solutions which we ignore here). We expand $x$ as a power series on $\epsilon$:
4343

44-
$$
44+
```math
4545
x(\epsilon) = a_0 + a_1 \epsilon + a_2 \epsilon^2 + O(\epsilon^3)
46-
\,.
47-
$$
46+
```
4847

4948
$a_0$ is the solution of the easy equation, therefore $a_0 = 1$. Substituting into the original problem,
5049

51-
$$
50+
```math
5251
(a_0 + a_1 \epsilon + a_2 \epsilon^2)^5 + \epsilon (a_0 + a_1 \epsilon + a_2 \epsilon^2) - 1 = 0
53-
\,.
54-
$$
52+
```
5553

5654
Expanding the equations, we get
57-
$$
55+
56+
```math
5857
\epsilon (1 + 5 a_1) + \epsilon^2 (a_1 + 5 a_2 + 10 a1_2) + 𝑂(\epsilon^3) = 0
59-
\,.
60-
$$
58+
```
6159

6260
This equation should hold for each power of $\epsilon$. Therefore,
6361

64-
$$
62+
```math
6563
1 + 5 a_1 = 0
66-
\,,
67-
$$
64+
```
6865

6966
and
7067

71-
$$
68+
```math
7269
a_1 + 5 a_2 + 10 a_1^2 = 0
73-
\,.
74-
$$
70+
```
7571

7672
This system of equations does not initially seem to be linear because of the presence of terms like $10 a_1^2$, but upon closer inspection is found to be in fact linear (this is a feature of the perturbation methods). In addition, the system is in a triangular form, meaning the first equation depends only on $a_1$, the second one on $a_1$ and $a_2$, such that we can replace the result of $a_1$ from the first one into the second equation and remove the non-linear term. We solve the first equation to get $a_1 = -\frac{1}{5}$. Substituting in the second one and solve for $a_2$:
7773

78-
$$
74+
```math
7975
a_2 = \frac{(-\frac{1}{5} + 10(-(\frac{1}{5})²)}{5} = -\frac{1}{25}
80-
\,.
81-
$$
76+
```
8277

8378
Finally,
8479

85-
$$
80+
```math
8681
x(\epsilon) = 1 - \frac{\epsilon}{5} - \frac{\epsilon^2}{25} + O(\epsilon^3)
87-
\,.
88-
$$
82+
```
8983

9084
Solving the original problem, $x(1) = 0.76$, compared to 0.7548 calculated numerically. We can improve the accuracy by including more terms in the expansion of $x$. However, the calculations, while straightforward, become messy and intractable to do manually very quickly. This is why a CAS is very helpful to solve perturbation problems.
9185

@@ -195,10 +189,9 @@ Remember the numerical value is 0.7549. The two functions `collect_powers` and `
195189

196190
Historically, the perturbation methods were first invented to solve orbital calculations of the Moon and the planets. In homage to this history, our second example has a celestial theme. Our goal is solve the Kepler's equation:
197191

198-
$$
192+
```math
199193
E - e\sin(E) = M
200-
\,.
201-
$$
194+
```
202195

203196
where $e$ is the *eccentricity* of the elliptical orbit, $M$ is the *mean anomaly*, and $E$ (unknown) is the *eccentric anomaly* (the angle between the position of a planet in an elliptical orbit and the point of periapsis). This equation is central to solving two-body Keplerian orbits.
204197

@@ -270,10 +263,10 @@ The result is 1.5876, compared to the numerical value of 1.5875. It is customary
270263

271264
Comparing the formula to the one for 𝐸 in the [Wikipedia article on the Kepler's equation](https://en.wikipedia.org/wiki/Kepler%27s_equation):
272265

273-
$$
266+
```math
274267
E = \frac{1}{1-\epsilon}M
275268
-\frac{\epsilon}{(1-\epsilon)^4} \frac{M^3}{3!} + \frac{(9\epsilon^2
276269
+ \epsilon)}{(1-\epsilon)^7}\frac{M^5}{5!}\cdots
277-
$$
270+
```
278271

279272
The first deviation is in the coefficient of $\epsilon^3 M^5$.

0 commit comments

Comments
 (0)