orbital-mechanics

Python implementation of n-body problem issue

筅森魡賤 提交于 2021-02-16 08:59:07
问题 I am currently trying to implement the N-body problem using Euler's method for solving differential equations. However, the graphical outputs do not seem correct, and I'm not sure where the issue in my code is after a while of testing. I'm currently using approximate values for Alpha Centauri A and B to test. This is my code: import numpy as np import matplotlib.pyplot as plt from math import floor # gravitation constant G = 6.67430e-11 # astronomical units au = 1.496e11 sec_in_day = 60 * 60

Plot orbit of two body using rk4

元气小坏坏 提交于 2021-01-29 11:10:26
问题 I've been trying to solve the two body problem using rk4 in python. I have some problem with the plot however and can't seem to get an orbit instead it's just a slightly bent line. I've tried to change the stepsize and initial values but it hasn't gotten me anywhere. Here is my code of the sun and earth system. from __future__ import division import numpy as np from numpy import linalg as LA import matplotlib.pyplot as plt #from VPython import * #from VPython.graph import * AU=1.5e11 a=AU

Rk4 Integrator of a nonlinear second order ODE in Python

和自甴很熟 提交于 2020-12-26 20:02:25
问题 I'm in a project in my University and I have to implement the Runge-Kutta 4-order integrator using Python. I know I can use for example Sympy, but the goal here is implement the method, the code is ready written in Fortran language, so basically I have a data base with the correct values of solutions and I have to get similar solutions in my code. However, we have some problems; I did the same several times using linear equations ( first and second order ), however this is a second order

Rk4 Integrator of a nonlinear second order ODE in Python

给你一囗甜甜゛ 提交于 2020-12-26 19:58:20
问题 I'm in a project in my University and I have to implement the Runge-Kutta 4-order integrator using Python. I know I can use for example Sympy, but the goal here is implement the method, the code is ready written in Fortran language, so basically I have a data base with the correct values of solutions and I have to get similar solutions in my code. However, we have some problems; I did the same several times using linear equations ( first and second order ), however this is a second order

ThreeJS orbit controls set target without lookAt

风格不统一 提交于 2020-02-22 04:28:42
问题 I am trying to make a 3D viewer for building models. We have the model loaded and are trying to make some sort of interaction with the model. Therefor we are using OrbiControls for rotating, panning and zooming the model. We want to have the behaviour in the viewer that when a user clicks and drags (thus rotating), the rotation center is at the point of the building where the user clicks. I thought I was wise by changing the target of the OrbitControl as such: control.target.set(newX, newY,

ThreeJS orbit controls set target without lookAt

喜你入骨 提交于 2020-02-22 04:21:59
问题 I am trying to make a 3D viewer for building models. We have the model loaded and are trying to make some sort of interaction with the model. Therefor we are using OrbiControls for rotating, panning and zooming the model. We want to have the behaviour in the viewer that when a user clicks and drags (thus rotating), the rotation center is at the point of the building where the user clicks. I thought I was wise by changing the target of the OrbitControl as such: control.target.set(newX, newY,

ThreeJS orbit controls set target without lookAt

放肆的年华 提交于 2020-02-22 04:21:51
问题 I am trying to make a 3D viewer for building models. We have the model loaded and are trying to make some sort of interaction with the model. Therefor we are using OrbiControls for rotating, panning and zooming the model. We want to have the behaviour in the viewer that when a user clicks and drags (thus rotating), the rotation center is at the point of the building where the user clicks. I thought I was wise by changing the target of the OrbitControl as such: control.target.set(newX, newY,

ThreeJS orbit controls set target without lookAt

非 Y 不嫁゛ 提交于 2020-02-22 04:21:31
问题 I am trying to make a 3D viewer for building models. We have the model loaded and are trying to make some sort of interaction with the model. Therefor we are using OrbiControls for rotating, panning and zooming the model. We want to have the behaviour in the viewer that when a user clicks and drags (thus rotating), the rotation center is at the point of the building where the user clicks. I thought I was wise by changing the target of the OrbitControl as such: control.target.set(newX, newY,

ThreeJS orbit controls set target without lookAt

和自甴很熟 提交于 2020-02-22 04:20:12
问题 I am trying to make a 3D viewer for building models. We have the model loaded and are trying to make some sort of interaction with the model. Therefor we are using OrbiControls for rotating, panning and zooming the model. We want to have the behaviour in the viewer that when a user clicks and drags (thus rotating), the rotation center is at the point of the building where the user clicks. I thought I was wise by changing the target of the OrbitControl as such: control.target.set(newX, newY,

Does anybody know how should I use animatedline in order to draw me an orbit immediately?

荒凉一梦 提交于 2019-12-24 19:36:00
问题 This is the main code %%%%%%%%%%%% Valori pentru Rcsc %%%%Pozitiile si vitezele pe cele 3 axe y0(1,1)= 743322.3616 ; y0(2,1)= -6346021.219 ; y0(3,1)= -3394131.349 ; y0(4,1)= 5142.38067; y0(5,1)= 4487.44895 ; y0(6,1)= -7264.00872; %%%% Timpul tspan=[0 :864]; %%%% Masa(kg) si aria suprafetei satelitului (m^2) m = 217 ; %320; A = 1.2; %8; %%%% Metoda Runge-Kutta de ordin 4 h=1; y = zeros(6, tspan(end)/h); y(:,1) = y0; for i=1:(tspan(end)/h) H=sqrt(y(1,i)^2+y(2,i)^2+y(3,i)^2); k_1 = proiectia