How to use OpenGoddard 4-python library for nonlinear optimal control and orbit generation

https://github.com/istellartech/OpenGoddard https://istellartech.github.io/OpenGoddard/

How to use OpenGoddard 1 How to use OpenGoddard 2 How to use OpenGoddard 3 How to use OpenGoddard 4 ← Now here

This time, I will talk about the formulation and results using one of the standard techniques for optimization.

Low thrust orbit transition problem

With the development of electric propulsion such as the ion engine, which became famous for being installed in Hayabusa, asteroid explorers are often going from the earth to other planets by electric propulsion instead of chemical propulsion like rocket engines. I did. It is well known that the orbit transition in chemical propulsion can take the orbit called Hohmann orbit with the minimum energy required. However, this is only an engine with sufficient thrust, and at low thrust it will be a trajectory called a spiral trajectory. Most of the orbital transition problems between two points are solved as boundary value problems (Lambert's problem, also known as Lambert's problem), but here we will treat them as optimal control problems.

The original papers are as follows.

Ross, I. Michael, Qi Gong, and Pooya Sekhavat. "Low-thrust, high-accuracy trajectory optimization." Journal of Guidance, Control, and Dynamics 30.4 (2007): 921-933. https://doi.org/10.2514/1.23181

Equation of motion

\begin{align}
\dot{r} &= v_r \\
\dot{v_r} &= v_t^2 / r - 1 / r^2 + u_r \\
\dot{v_t} &= - v_r v_t / r + u_t
\end{align}

Restraint condition

Enter the initial value and the end value to limit the magnitude of thrust.

|u_r| \leq 0.01 \\
|u_t| \leq 0.01 \\
0 < t_f < 55

Evaluation function

The aim is to minimize the total thrust time required.

J = \int_{t_0}^{t_f} |u_r| + |u_t| dt

Absolute value replacement

Since the evaluation function containing absolute values is not smooth, we perform substitution using free variables (also auxiliary variables) as a standard for numerical analysis. http://www.msi.co.jp/nuopt/download/introduction/module/technic.pdf

u = u_1 - u_2 \\
|u| = u_1 + u_2

In consideration of this, describe as 3 state variables ($ r, v_r, v_t ) and 4 control variables ( u_ {r1}, u_ {r2}, u_ {t1}, u_ {t2} $). I will continue.

If the evaluation function has an integral term, specify the content of the integral term in running_cost.

def running_cost(prob, obj):
    ur1 = prob.controls_all_section(0)
    ur2 = prob.controls_all_section(1)
    ut1 = prob.controls_all_section(2)
    ut2 = prob.controls_all_section(3)

    return (ur1 + ur2) + (ut1 + ut2)
prob.running_cost = running_cost

result

4_LTTO_.png

Looking at the graph of u, which is a control variable, we can see that the history of thrust is difficult for humans to understand. Even such a difficult problem can be easily solved (although it requires some trial and error and know-how).

Summary

As mentioned above, we have explained the points that can be noted from a simple example when using OpenGoddard. The following is a brief summary.

Although the area remains as an intuitional part with know-how, it is still possible to easily find the solution (orbit) of nonlinear optimal control. It is important to note that there is no guarantee that it is the optimum value because it is a numerical solution, and that it is a locally optimal solution, but I think that there is no problem in many practices. Please try using Open Goddard!

Serpentine 1

Scipy's SLSQP is currently used in v1.0.0 as a solver for sequential quadratic planning, but the performance of this solver is not suitable for large-scale problems. Problems with a large number of variables and nodes will take a considerable amount of calculation time. It seems that Coco Rahen should use a high-class solver that uses the characteristics of sparse matrices, but it has not been verified. SNOPT and IPOPT are often mentioned in papers.

Serpentine 2

In addition to the Open Goddard explained this time, we have released a program called Open Tsiolkovsky.

These two are a pair of software, the inverse problem and the forward problem.

The original reason for making it is rocket orbit generation, but as a result Open Goddard is a fairly versatile tool. It may be better to use another tool for large-scale optimal control problems, but I think that it is a good tool because simple calculations have few dependencies and are easy to install (hot self-praise).

Recommended Posts

OpenGoddard How to use 2-python library for nonlinear optimal control and orbit generation
How to use OpenGoddard 3-python library for nonlinear optimal control and orbit generation
How to use OpenGoddard 4-python library for nonlinear optimal control and orbit generation
How to use OpenGoddard 1-python library for nonlinear optimal control and orbit generation
How to use Requests (Python Library)
[python] How to use the library Matplotlib for drawing graphs
How to install and use pandas_datareader [Python]
[Python] Organizing how to use for statements
python: How to use locals () and globals ()
How to use "deque" for Python data
How to use Python zip and enumerate
How to use is and == in Python
How to use the C library in Python
[Python] How to use hash function and tuple.
Tips for those who are wondering how to use is and == in Python
How to use Service Account OAuth and API with Google API Client for python
[BigQuery] How to use BigQuery API for Python -Table creation-
[Python] [Django] How to use ChoiceField and how to add options
[Python] How to use the graph creation library Altair
Python # How to check type and type for super beginners
python3: How to use bottle (2)
[Python] How to use list 1
How to use Python argparse
Python: How to use pydub
[Python] How to use checkio
[Python] How to use input ()
How to use Python lambda
[Python] How to use virtualenv
python3: How to use bottle (3)
python3: How to use bottle
How to use Python bytes
[Introduction to Udemy Python 3 + Application] 36. How to use In and Not
How to learn TensorFlow for liberal arts and Python beginners
[Python] Summary of how to use split and join functions
How to use machine learning for work? 03_Python coding procedure
Comparison of how to use higher-order functions in Python 2 and 3
I didn't know how to use the [python] for statement
Python: How to use async with
How to install and use Tesseract-OCR
[Python] How to use Pandas Series
How to use SQLite in Python
[Python] How to import the library
How to use .bash_profile and .bashrc
How to install and use Graphviz
[Python] How to use list 3 Added
How to use Mysql in python
How to use OpenPose's Python API
How to use ChemSpider in Python
How to use FTP with Python
Python: How to use pydub (playback)
How to use PubChem in Python
How to use python zip function
[Python] How to use Typetalk API
How to use functions in separate files Perl and Python versions
How to use Serverless Framework & Python environment variables and manage stages
[Introduction to Python] How to use the in operator in a for statement?
[For beginners] How to register a library created in Python in PyPI
How to use an external editor for Python development with Grasshopper
How to use Python with Jw_cad (Part 2 Command explanation and operation)
[Introduction to Python] How to use the Boolean operator (and ・ or ・ not)
How to set proxy, redirect and SSL authentication for Python Requests module