Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions rocketpy/environment/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,21 @@ def __init__(
timezone="UTC",
max_expected_height=80000.0,
):
Comment thread
phmbressan marked this conversation as resolved.
"""Initialize Environment class, saving launch rail length,
launch date, location coordinates and elevation. Note that
by default the standard atmosphere is loaded until another
"""Initialize Environment class, saving parameters of the launch location,
such as launch date, coordinates and elevation. This class also computes
relevant quantities for the Flight simulation, such as air pressure, density
and gravitational acceleration.
Comment thread
phmbressan marked this conversation as resolved.
Outdated

Note that the default atmospheric model is the International Standard Atmosphere
as defined by ISO 2533 unless specified otherwise in
:meth:`Environment.set_atmospheric_model`.

Parameters
----------
gravity : int, float, callable, string, array, optional
Surface gravitational acceleration. Positive values point the
acceleration down. If None, the Somigliana formula is used to
acceleration down. If None, the Somigliana formula is used.
See :meth:`Environment.set_gravity_model` for more information.
date : array, optional
Array of length 4, stating (year, month, day, hour (UTC))
of rocket launch. Must be given if a Forecast, Reanalysis
Expand Down Expand Up @@ -468,8 +474,8 @@ def set_gravity_model(self, gravity):
----------
gravity : None or Function source
Comment thread
phmbressan marked this conversation as resolved.
Outdated
If None, the Somigliana formula is used to compute the gravity
acceleration. Otherwise, the user can provide a Function object
representing the gravity model.
acceleration. Otherwise, the user can provide a Function source
object representing the gravity model.

Returns
-------
Expand Down Expand Up @@ -514,6 +520,10 @@ def somigliana_gravity(self, height):
-------
Function
Function object representing the gravity model.

References
----------
.. [1] https://en.wikipedia.org/wiki/Theoretical_gravity#Somigliana_equation
"""
a = 6378137.0 # semi_major_axis
f = 1 / 298.257223563 # flattening_factor
Expand Down