Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ⚡ improve orbit finder algorithm for breakups #970

Merged
merged 4 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

#### v10.2.2

>

- fix: :zap: improve orbit finder algorithm for breakups
- fix: :bug: fix linter and tests
- docs: :memo: update CHANGELOG

#### v10.2.1

>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "keeptrack.space",
"version": "10.2.1",
"version": "10.2.2",
"type": "module",
"description": "Complex astrodynamics tools designed for non-engineers to make learning about orbital mechanics and satellite operations more accessible.",
"author": "Theodore Kruczek",
Expand Down
31 changes: 22 additions & 9 deletions src/plugins/breakup/breakup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { SelectSatManager } from '../select-sat-manager/select-sat-manager';
export class Breakup extends KeepTrackPlugin {
readonly id = 'Breakup';
dependencies_ = [SelectSatManager.name];
private selectSatManager_: SelectSatManager;
private readonly selectSatManager_: SelectSatManager;

constructor() {
super();
Expand Down Expand Up @@ -69,8 +69,9 @@ export class Breakup extends KeepTrackPlugin {
<div class="input-field col s12">
<select id="hc-inc">
<option value="0">0 Degrees</option>
<option value="0.05" selected>0.05 Degrees</option>
<option value="0.1">0.1 Degrees</option>
<option value="0.2" selected>0.2 Degrees</option>
<option value="0.2">0.2 Degrees</option>
<option value="0.3">0.3 Degrees</option>
<option value="0.4">0.4 Degrees</option>
<option value="0.5">0.5 Degrees</option>
Expand All @@ -85,10 +86,12 @@ export class Breakup extends KeepTrackPlugin {
<div class="input-field col s12">
<select id="hc-per">
<option value="0">0 Percent</option>
<option value="0.025" selected>0.25 Percent</option>
<option value="0.005">0.5 Percent</option>
<option value="0.075">0.75 Percent</option>
<option value="0.01">1 Percent</option>
<option value="0.015">1.5 Percent</option>
<option value="0.02" selected>2 Percent</option>
<option value="0.02">2 Percent</option>
<option value="0.025">2.5 Percent</option>
<option value="0.03">3 Percent</option>
<option value="0.035">3.5 Percent</option>
Expand All @@ -101,8 +104,9 @@ export class Breakup extends KeepTrackPlugin {
<div class="input-field col s12">
<select id="hc-raan">
<option value="0">0 Degrees</option>
<option value="0.05" selected>0.05 Degrees</option>
<option value="0.1">0.1 Degrees</option>
<option value="0.2" selected>0.2 Degrees</option>
<option value="0.2">0.2 Degrees</option>
<option value="0.3">0.3 Degrees</option>
<option value="0.4">0.4 Degrees</option>
<option value="0.5">0.5 Degrees</option>
Expand All @@ -116,12 +120,14 @@ export class Breakup extends KeepTrackPlugin {
</div>
<div class="input-field col s12">
<select id="hc-count">
<option value="5">5</option>
<option value="10">10</option>
<option value="25" selected>25</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
<option value="200">250</option>
<option value="500">500</option>
<option value="750">750</option>
<option value="1000">1000</option>
</select>
<label>Pieces</label>
Expand Down Expand Up @@ -187,6 +193,7 @@ export class Breakup extends KeepTrackPlugin {
(<HTMLInputElement>getEl('hc-scc')).value = (obj as DetailedSatellite).sccNum;
}

// eslint-disable-next-line max-statements
private onSubmit_(): void {
const { simulationTimeObj } = keepTrackApi.getTimeManager();
const catalogManagerInstance = keepTrackApi.getCatalogManager();
Expand Down Expand Up @@ -219,16 +226,22 @@ export class Breakup extends KeepTrackPlugin {
return;
}

const alt = mainsat.apogee - mainsat.perigee < 300 ? 0 : lla.alt; // Ignore argument of perigee for round orbits OPTIMIZE
const alt = mainsat.apogee - mainsat.perigee < 1000 ? 0 : lla.alt; // Ignore argument of perigee for round orbits OPTIMIZE
const tles = new OrbitFinder(mainsat, launchLat, launchLon, <'N' | 'S'>upOrDown, simulationTimeObj, alt as Kilometers).rotateOrbitToLatLon();
const tle1 = tles[0];
const tle2 = tles[1];

if (tle1 === 'Error') {
errorManagerInstance.error(new Error(tle2), 'breakup.ts', i18next.t('errorMsgs.Breakup.ErrorCreatingBreakup'));

return;
}

const newSat = new DetailedSatellite({
...mainsat,
...{
id: satId,
tle1: tle1 as TleLine1,
tle1,
tle2: tle2 as TleLine2,
active: true,
},
Expand Down Expand Up @@ -314,7 +327,7 @@ export class Breakup extends KeepTrackPlugin {
const a5Num = Tle.convert6DigitToA5((CatalogManager.ANALYST_START_ID + i).toString());
const satId = catalogManagerInstance.sccNum2Id(a5Num);

iTle1 = `1 ${a5Num}${iTle1.substring(7)}`;
iTle1 = `1 ${a5Num}${iTle1.substring(7)}` as TleLine1;
iTle2 = `2 ${a5Num} ${incStr} ${iTle2.substring(17, 52)}${meanmoStr}${iTle2.substring(63)}`;

if (iTle1.length !== 69) {
Expand All @@ -331,7 +344,7 @@ export class Breakup extends KeepTrackPlugin {
...catalogManagerInstance.objectCache[satId],
...{
id: satId,
tle1: iTle1 as TleLine1,
tle1: iTle1,
tle2: iTle2 as TleLine2,
active: true,
},
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion src/settings/version.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
export const VERSION = '10.2.0';
export const VERSION = '10.2.1';

2 changes: 1 addition & 1 deletion src/settings/versionDate.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
export const VERSION_DATE = 'October 3, 2024';
export const VERSION_DATE = 'October 24, 2024';
Loading
Loading