# Modelling of the orbital mechanics of a 3U cubesat for the determination of propulsive, energetic and temporary costs in predetermined low thrust orbital maneuvers.
If you want, you can checkout <a href="https://ricardoramos.me/orbital-mechanics-simulator">the blog entry I wrote for this project.<a>
### Explanation of the code written so far:
There are 5 files:
- <strong>constants.py:</strong> contains all the constants used in the rest of the code, like the standard gravitational constants of the Earth, the Moon and the Sun, the radius of the Earth, the gravitational constant and the masses of the Earth, the Moon and the Sun, among others.
- <strong>coordinates.py:</strong> contains functions which help in the transfomation of coordinates, from keplerian to cartesian, cartesian to equinoctial and equinoctial to cartesian.
- <strong>models.py:</strong> contains classes and functions which represent the physical models for use. For example the atmospheric density model, the lunar and solar positioning and finally the models used in the satellite units, like the thrusters, the solar panels, batteries, energy balance and even the satellite itself (incorporating stuff like mass, ballistic coefficient, etc). The idea is to keep adding models which are diverse and more complex over time.
- <strong>maneuvers.py:</strong> this is the core of the simulator and contains the functions which do the job of calculating the actual orbital dynamics, and the functions which the user interacts with to be able to add and remove perturbations, and propagate movement over time. In this case various methods of integration for the movement of the satellite have been defined, like the Cowell's method, Gauss with equinoctial coordinates (which I call Betts). The `Maneuver` object calculates the trajectory and logs it in a history class which can be further used.
- <strong>auxiliary.py:</strong> contains auxiliary or miscellaneous functions which don't classify under the other files. At the moment it only has an orbital elements extractor from a TLE, and a function to aid in keeping the aspect ratio of the 3D plot.
### Usage:
You must first declare the spacecraft model you wish to use, the initial orbital elements and the date they correspond to.
The example below defines the from a TLE, but they can be manually defined.
`coe` are the orbital elements expressed in keplerian form and in a list of the form `[a,e,i,omega,Omega,nu]`.
The date is simply a `datetime` object.
The `Spacecraft` model internally defines a configuration for the thrusters, solar panels and batteries.
If you choose to use the thrusters, solar panels or batteries, you have to define the n in `Spacecraft.thruster`, `Spacecraft.solarPanles` and `Spacecraft.battery`. These can all be defined generically with `models.Thruster`, `models.solarPanels` and `models.Battery`, or any available model in <i>models.py</i>.
All these parameters are passed to the constructor of the `Maneuvers` object to define the initial state of the maneuver:
```python
coe,date = auxiliary.parseTle("suchai0.tle")
# Spacecraft Definition
satellite = models.Cubesat("3U")
# Thruster Definition (1mN thrust, 720s Isp)
satellite.thruster = models.Thruster(thrust=1e-3,isp=720)
# Solar Panels Definition
satellite.solarPanels = models.solarPanel()
satellite.solarPanels.area = 30e-2*30e-2
satellite.solarPanels.efficiency = 0.4
# Battery Definition
satellite.battery = models.NanoPowerBP4("2S-2P")
# Define maneuvers object
maneuvers = Maneuvers(coe,satellite,date)
```
We can then add the perturbations to the maneuvers object (so far only `atmosphere`, `solar_pressure`, `moon_gravity`, `sun_gravity`, `J2` and `thrust` have been implemented).
The `propagate` method propagates the time and accepts time in seconds, with a timestep in seconds.
```python
# Add solar pressure and atmospheric drag perturbations to maneuver
maneuvers.addPerturbation("solar_pressure")
maneuvers.addPerturbation("atmosphere")
# Propagate 1 day
maneuvers.propagate(60*60*24*1, 60)
# Start thrust
maneuvers.addPerturbation("thrust")
# Propagate for 18 days
maneuvers.propagate(60*60*24*18, 60)
# Stop thrust
maneuvers.removePerturbation("thrust")
# Propagate for 1 day
maneuvers.propagate(60*60*24*1, 60)
```
To orient thrust, it is possible to define callback functions which accept `coe` (Classical Orbital Elements) as input, and output angles `alpha` and `beta` which define the orientation in the RSW reference system (also called RCN) of the satellite:
<img src="rswFrame.png"/>
```python
def alphaCallback(coe):
# Alpha is such that is always pointing in the direction of velocity
e = coe[1]
nu = coe[5]
alpha = np.arctan2(e*np.sin(nu),1+e*np.cos(nu))
return alpha
def betaCallback(coe):
# Beta is always 30 deg w/r to rsw frame
return 30*np.pi/180
maneuver.addPerturbation("thrust")
maneuver.thrustProfile = (alphaCallback,betaCallback)
maneuver.propagate(60*60*24*10,60)
```
You can checkout many examples of the above in <a href="https://github.com/MrPapasFritas/frames-days/blob/master/Demo - Single Orbital Parameter Modification.ipynb">this demo</a>.
I've also implemented a method to define a target orbit and let the thrust orientation be calculated in order to reach that target orbit:
```python
# Add thrust
maneuvers.addPerturbation("thrust")
# Set Target Orbit
targetOrbitElements = [50000e3,0.01,10*np.pi/180,None,None]
maneuvers.setTargetOrbit(targetOrbitElements)
# Propagate for 18 days
maneuvers.propagate(60*60*24*18, 60)
```
An example of the above can be seen in <a href="https://github.com/imricardoramos/orbital-mechanics/blob/master/Notebooks/Demos/Demo - Target Run.ipynb">this demo</a>
In each propagation the data is saved in the histiry of the maneuver:
```python
# Spacecraft distance vectors from Earth Center
maneuvers.history.r
# Spacecraft velocity vectors history
maneuvers.history.v
# Classical Orbital Elements History
maneuvers.history.coe
# Modified Equinoctial Elements History
maneuvers.history.mee
# Propellant Mass History
maneuvers.history.propMass
# Time elapsed history
maneuvers.history.t
# Datetime history
maneuvers.history.datetime
```
Some variables can also be calculated a posteriori, for example:
```python
maneuvers.calculateEclipseHours()
maneuvers.calculatePower()
```
Some examples of usage:
<strong>Note: many of the examples below use the `ipyvolume` to create 3D plots. It is very recommended to try and install this library.</strong>
- <a href="https://github.com/imricardoramos/orbital-mechanics/blob/master/Notebooks/Demos/Demo - Deorbiting.ipynb">Demo - Deorbiting</a>
- <a href="https://github.com/imricardoramos/orbital-mechanics/blob/master/Notebooks/Demos/Demo - Inclination Change.ipynb">Demo - Inclination Change</a>
- <a href="https://github.com/imricardoramos/orbital-mechanics/blob/master/Notebooks/Demos/Demo - Perturbations.ipynb">Demo - Perturbations</a>
- <a href="https://github.com/imricardoramos/orbital-mechanics/blob/master/Notebooks/Demos/Demo - Eclipse.ipynb">Demo - Eclipse</a>
- <a href="https://github.com/imricardoramos/orbital-mechanics/blob/master/Notebooks/Demos/Demo - Energy.ipynb">Demo - Energy</a>
- <a href="https://github.com/imricardoramos/orbital-mechanics/blob/master/Notebooks/Demos/Demo - Relative Motion.ipynb">Demo - Relative Motion</a>
- <strong><a href="https://github.com/imricardoramos/orbital-mechanics/blob/master/Notebooks/Demos/Demo - Single Orbital Parameter Modification.ipynb">Demo - Single Orbital Parameter Modification</a></strong>
- <a href="https://github.com/imricardoramos/orbital-mechanics/blob/master/Notebooks/Demos/Demo - Target Run.ipynb">Demo - Target Run</a>
- <a href="https://github.com/imricardoramos/orbital-mechanics/blob/master/Notebooks/Validation/Validation - Perturbations.ipynb">Validation - Perturbations</a>
- <a href="https://github.com/imricardoramos/orbital-mechanics/blob/master/Notebooks/Validation/Validation - STK.ipynb">Validation - STK</a>
- <a hr
没有合适的资源?快使用搜索试试~ 我知道了~
用于模拟轨道机动的轨道力学库。_Jupyter Notebook_.zip
共67个文件
ipynb:18个
txt:17个
png:12个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 131 浏览量
2023-04-10
23:42:49
上传
评论 1
收藏 12.14MB ZIP 举报
温馨提示
用于模拟轨道机动的轨道力学库。_Jupyter Notebook_.zip
资源推荐
资源详情
资源评论
收起资源包目录
用于模拟轨道机动的轨道力学库。_Jupyter Notebook_.zip (67个子文件)
orbital-mechanics-master
Notebooks
Demos
Demo - Single Orbital Parameter Modification.ipynb 711KB
Demo - Elias Obreque.ipynb 50KB
Demo - Target Run.ipynb 547KB
Demo - Inclination Change.ipynb 209KB
Demo - Energy.ipynb 279KB
Demo - Deorbiting.ipynb 154KB
Demo - Eclipse.ipynb 175KB
Demo - Relative Motion.ipynb 187KB
figs
eAngles.svg 58KB
RAANAngles.svg 85KB
omegaAngles.svg 148KB
aAngles.svg 63KB
iAngles.svg 87KB
Calculations
Calculations - Delta-V.ipynb 405KB
Calculations - Optimal thrust angles.ipynb 1.03MB
Validation
atmDrag.png 282KB
J2.png 390KB
atmDragExample.png 82KB
Validation - Perturbations.ipynb 3.41MB
J2Example.png 75KB
lunarGravityExample.png 101KB
solarGravity.png 137KB
matlabSTK.m 4KB
Validation - STK.ipynb 694KB
radPressureExample.png 90KB
J2_2.png 512KB
radPressure.png 272KB
STKValidationScriptMatlab.m 4KB
lunarGravity.png 239KB
Studies
Study - Deorbiting.ipynb 3.58MB
Study - Deorbiting Model vs TLE Data.ipynb 853KB
Historic_TLEs
PhoneSat 2.4a.txt 166KB
Tiangong-1.txt 216KB
Swayam COEP.txt 226KB
CAPE-2.txt 62KB
KYSAT II.txt 72KB
SUCHAI_Last.txt 146B
ChargerSat-1.txt 114KB
BEESAT-4.txt 203KB
SUCHAI_First.txt 146B
DragonSat 1.txt 146KB
Nayif-1.txt 185KB
Black Knight 1.txt 84KB
SwampSat.txt 108KB
STEP-1.txt 90KB
NPS-SCAT.txt 101KB
COPPER.txt 117KB
SUCHAI.txt 151KB
Study - Moon Mission.ipynb 195KB
Study - Station Keeping .ipynb 1.45MB
Study - Historic SUCHAI TLE Data View.ipynb 324KB
Study - Orbiting bodies.ipynb 113KB
src
coordinates.py 4KB
models.py 16KB
maneuvers.py 35KB
auxiliary.py 3KB
constants.py 430B
figs
eAngles.svg 58KB
RAANAngles.svg 85KB
omegaAngles.svg 148KB
rswFrame.png 103KB
aAngles.svg 63KB
iAngles.svg 87KB
suchai0.tle 164B
rswFrame.png 103KB
.gitignore 54B
README.md 8KB
共 67 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功