# The Error of our solution for the eccentric anomaly.

The idea is to calulate E in any time instant 't_i' using the approximate solution 'E_ap' and plug that E into the actual equation of E 'E_ac' to get a new time instant 't_f'. Then simply the error is equal to the difference between 't_f' and 't_i'.


```python
from sympy import *
init_printing()

E_ac, E_ap, n, e_c, t_i, t_f = symbols("E_ac E_ap n e_c t_i t_f")

exp1 = Eq(E_ac - e_c*sin(E_ac), n*t_f) # The approximate solution

E_ap = n*t_i + e_c*sin(n*t_i) # The actual equation
```

The approximate solution:


```python
Eq(symbols("E_ap"), E_ap)
```

The actual equation:


```python
exp1
```

Substitute E_ap into E_ac:


```python
expr2 = exp1.subs({E_ac:E_ap})
expr2
```

Solve for t_f:


```python
t_ff = solveset(expr2, t_f).args[0]
Eq(t_f, t_ff)
```

Error = t_f - t_i 


```python
expr3 = t_ff - t_i
Eq(symbols('Error'), Eq(t_f - t_i, expr3.simplify()))
```

To get the maximum error, we can differentiate the error with respect to 't_i' and equalize it with zero.


```python
expr4 = expr3.diff(t_i).simplify()
expr4
```


```python
solveset(Eq(expr4, 0), t_i).args[1]
```


```python

```

fa2f9bb485252d4c77f54a2f1e6605f69e25f672
ipynb
Jupyter Notebook
Python Notebooks/Equation Error.ipynb
Yaamani/Satellite-Simulation
f9b3363e79b62a30724c53c99fdb097a68ff324d
MIT
Python Notebooks/Equation Error.ipynb
Yaamani/Satellite-Simulation
f9b3363e79b62a30724c53c99fdb097a68ff324d
MIT
Python Notebooks/Equation Error.ipynb
Yaamani/Satellite-Simulation
f9b3363e79b62a30724c53c99fdb097a68ff324d
MIT
Qwen/Qwen-72B
1. YES
2. YES