Skip to content
Snippets Groups Projects
Commit e83d2fb7 authored by eylim3's avatar eylim3
Browse files

Removed ipynb file

parent 9518e387
Branches anishj2
No related tags found
1 merge request!5Final Version
%% Cell type:code id: tags:
``` python
import numpy as np
def f_true(r_i,r_j,m_j):
"""Returns acceleration for the i-th body in a two-body system. You can find the overall acceleration for a body by summing the acceleration from all bodies in a n-body system.
Parameters
----------
r_i : array
Position vector of body that we are finding acceleration for (i-th body)
r_j : array
Position vector of other body that is affecting the main body (j-th body)
m_j : float_like
Mass of other j-th body
Returns
-------
a : array
Acceleration vector of output dynamics for i-th body
"""
G = 6.6743e-11
a = G*m_j*(r_j-r_i)/(np.linalg.norm(r_j-r_i))**3
return a
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment