mirror of
https://codeberg.org/Yael-II/MSc1-Internship-Stellar-Cluster.git
synced 2026-03-15 03:16:26 +01:00
Add files via upload
This commit is contained in:
@@ -140,10 +140,10 @@ def create_channels():
|
|||||||
|
|
||||||
def generate_galaxy(stars, params):
|
def generate_galaxy(stars, params):
|
||||||
galaxy_model = galaxy.MilkyWay_AMUSE()
|
galaxy_model = galaxy.MilkyWay_AMUSE()
|
||||||
vc = galaxy_model.vel_circ(stars.center_of_mass().length())
|
|
||||||
stars.x += params["cluster_position_x"]
|
stars.x += params["cluster_position_x"]
|
||||||
stars.y += params["cluster_position_y"]
|
stars.y += params["cluster_position_y"]
|
||||||
stars.z += params["cluster_position_z"]
|
stars.z += params["cluster_position_z"]
|
||||||
|
vc = galaxy_model.vel_circ(stars.center_of_mass().length()).in_(u.km * u.s**(-1))
|
||||||
phi = np.arctan2(stars.center_of_mass().y.value_in(u.pc), stars.center_of_mass().x.value_in(u.pc))
|
phi = np.arctan2(stars.center_of_mass().y.value_in(u.pc), stars.center_of_mass().x.value_in(u.pc))
|
||||||
stars.vx += - vc * np.sin(phi)
|
stars.vx += - vc * np.sin(phi)
|
||||||
stars.vy += vc * np.cos(phi)
|
stars.vy += vc * np.cos(phi)
|
||||||
|
|||||||
Reference in New Issue
Block a user