Skip to content

Commit

Permalink
Merge pull request #48 from ChristopherRabotin/issue-47
Browse files Browse the repository at this point in the history
Stat OD HW1
  • Loading branch information
ChristopherRabotin committed Feb 1, 2017
2 parents 3c8a4b7 + 64203f6 commit b5acdf0
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
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
34 changes: 34 additions & 0 deletions examples/statOD/hw1/main.go
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.

0 comments on commit b5acdf0

Please sign in to comment.