-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from ChristopherRabotin/issue-47
Stat OD HW1
- Loading branch information
Showing
5 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
# Ignore files with no extensions | ||
# Ignore all | ||
* | ||
# Unignore all with extensions | ||
!*.* | ||
# Unignore all dirs | ||
!*/ | ||
# Specific ignoring | ||
outputdata/ | ||
data/jplhorizon | ||
env.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"github.com/ChristopherRabotin/smd" | ||
) | ||
|
||
/* | ||
Create a numerical simulation of a spacecraft in an orbit with a = 7000 km, e = 0.001, i = 30 degrees, Ω = 80 degrees, ω = 40 degrees, | ||
and an initial true anomaly of ν = 0 degrees. Include only μ and J2 in the dynamics for the system. | ||
Integrate the system for 24 hours. This is your reference trajectory. | ||
Integrate a second trajectory by perturbing the initial state with a state deviation vector, δx = [1km, 0, 0, 0, 10m/s, 0]. | ||
Compare the state of the second trajectory with respect to the reference trajectory over the course of 24 hours. | ||
Use the STM computed around the reference trajectory to perform a second propagation of δx. | ||
*/ | ||
func main() { | ||
dt := time.Now().UTC() | ||
osc := smd.NewOrbitFromOE(7000, 0.001, 30, 80, 40, 0, smd.Earth) | ||
R, V := osc.RV() | ||
fmt.Printf("R=%+v km\tV=%+v km/s\n", R, V) | ||
pert := smd.Perturbations{Jn: 2} | ||
mis := smd.NewMission(smd.NewEmptySC("hw10", 0), osc, dt, dt.Add(24*time.Hour), smd.Cartesian, pert, smd.ExportConfig{Filename: "hw1.0", Cosmo: true, AsCSV: true, Timestamp: false}) | ||
mis.Propagate() | ||
|
||
// Second with initial error δx. | ||
R[0]++ | ||
V[1] += 10e-3 | ||
fmt.Printf("R=%+v km\tV=%+v km/s\n", R, V) | ||
osc = smd.NewOrbitFromRV(R, V, smd.Earth) | ||
mis = smd.NewMission(smd.NewEmptySC("hw11", 0), osc, dt, dt.Add(24*time.Hour), smd.Cartesian, pert, smd.ExportConfig{Filename: "hw1.1", Cosmo: true, AsCSV: true, Timestamp: false}) | ||
mis.Propagate() | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.