Skip to content

UPDATE 2.2 - #241

Draft
nscheuer wants to merge 9 commits into
mainfrom
2_2/update
Draft

nscheuer wants to merge 9 commits into
mainfrom
2_2/update

Conversation

* first pass on environmental refactor

* updated default ephemeris to DE442S, removed densitymodel and legacy files that were stuck in orbit/ and not environment/

* updated default ephemeris to de442s

* fixed sphinx compilation errors

* shared assetmanager for external files, useful also for visuals later

* fix nrlmsise atmosphere bug

* make de421 the default ephemeris

* default magnetic field and star catalogue

* added citations
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Benchmark Report

Benchmark multiplication factors

Tests Outside Green Range

status category test multiplier
0.10x goals environment_vector_goal_group 0.10x
0.12x goals eci_goal_error 0.12x
0.13x orbital_state propagate_orbit_rk4_full_state 0.13x
0.13x orbit get_os_interpolated 0.13x
0.14x orbit new_orbit_from_times_small 0.14x
0.22x orbit construct_propagated_orbit_small 0.22x
0.65x goals coordinate_goal_error 0.65x
0.71x controllers mtq_lovera_find_u 0.71x
0.74x sensors star_tracker_reading 0.74x
0.79x sensors earth_horizon_reading 0.79x
0.80x controllers mtq_wisniewski_find_u 0.80x

Color bands: green 0.8x-1.2x, yellow 0.5x-0.8x or 1.2x-1.5x, red outside that range.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Test Results

1 634 tests  +73   1 632 ✅ +73   3m 47s ⏱️ + 2m 3s
    1 suites ± 0       2 💤 ± 0 
    1 files   ± 0       0 ❌ ± 0 

Results for commit 2c96a96. ± Comparison against base commit 2f4a589.

♻️ This comment has been updated with latest results.

patrickmckeen and others added 8 commits October 26, 2026 22:37
* Add a force interface to disturbances and Satellite.dist_forces

Disturbance gains force(), force_qjac() and force_qqhess() that return
zeros, mirroring the torque trio, so torque-only disturbances need no
change. Satellite.dist_forces() sums the body-frame forces over the
registered disturbances using the same sat/no-sat call convention as
dist_torques(). The attitude dynamics are untouched; the force is for
orbit propagation and inspection.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add raw (non-renormalising) quaternion finite-difference test helpers

The analytic *_qjac/*_qqhess methods differentiate with respect to the four
raw quaternion components. The existing fd_quat_jac/fd_quat_hess renormalise
the perturbed quaternion, which drops the radial part of the derivative and
only agrees when the output is small enough to hide inside the tolerance.
#246)

* Add a force interface to disturbances and Satellite.dist_forces

Disturbance gains force(), force_qjac() and force_qqhess() that return
zeros, mirroring the torque trio, so torque-only disturbances need no
change. Satellite.dist_forces() sums the body-frame forces over the
registered disturbances using the same sat/no-sat call convention as
dist_torques(). The attitude dynamics are untouched; the force is for
orbit propagation and inspection.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add raw (non-renormalising) quaternion finite-difference test helpers

The analytic *_qjac/*_qqhess methods differentiate with respect to the four
raw quaternion components. The existing fd_quat_jac/fd_quat_hess renormalise
the perturbed quaternion, which drops the radial part of the derivative and
only agrees when the output is small enough to hide inside the tolerance.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add aerodynamic drag force, Jacobian and Hessian to Drag_Disturbance

Taken from 2_2/disturbance_forces_clean (#240), drag portion only.

* Test the drag force against closed forms, the torque and finite differences

Adds fd_quat_jac_raw/fd_quat_hess_raw helpers that do not renormalise the
perturbed quaternion; the analytic Jacobians differentiate with respect to
the raw components, so the renormalising helpers only agree when the output
is small enough to hide inside the tolerance.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fixing [P2] The force method advertises dictionary input but cannot handle it. [drag_disturbance.py (line 253)](/home/nicla/Generalized_ADCS/ADCS/satellite_hardware/disturbances/drag_disturbance.py:253) annotates os as Orbital_State | Dict[...], but [line 288 (line 288)](/home/nicla/Generalized_ADCS/ADCS/satellite_hardware/disturbances/drag_disturbance.py:288) unconditionally calls os.get_state_vector(...). Passing a dictionary as the annotation permits raises AttributeError. Either support a mapping here or remove it from the annotation and docstring. The existing torque method has the same mismatch.

[P3] The raw finite-difference helper drops other state fields. [\\_helpers.py (line 120)](/home/nicla/Generalized_ADCS/testing/test_disturbances/_helpers.py:120) rebuilds a plain State with only w and q. That discards wheel momentum and, for EstimatorState, bias and disturbance-parameter values. A function that depends on those fields will be evaluated at a different state during the finite difference. Copy x and perturb its quaternion instead.

---------

Co-authored-by: Niclas Scheuer <niclas_scheuer@web.de>
Co-authored-by: Nic <102034908+nscheuer@users.noreply.github.com>
… stack) (#247)

* Add a force interface to disturbances and Satellite.dist_forces

Disturbance gains force(), force_qjac() and force_qqhess() that return
zeros, mirroring the torque trio, so torque-only disturbances need no
change. Satellite.dist_forces() sums the body-frame forces over the
registered disturbances using the same sat/no-sat call convention as
dist_torques(). The attitude dynamics are untouched; the force is for
orbit propagation and inspection.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add raw (non-renormalising) quaternion finite-difference test helpers

The analytic *_qjac/*_qqhess methods differentiate with respect to the four
raw quaternion components. The existing fd_quat_jac/fd_quat_hess renormalise
the perturbed quaternion, which drops the radial part of the derivative and
only agrees when the output is small enough to hide inside the tolerance.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add aerodynamic drag force, Jacobian and Hessian to Drag_Disturbance

Taken from 2_2/disturbance_forces_clean (#240), drag portion only.

* Test the drag force against closed forms, the torque and finite differences

Adds fd_quat_jac_raw/fd_quat_hess_raw helpers that do not renormalise the
perturbed quaternion; the analytic Jacobians differentiate with respect to
the raw components, so the renormalising helpers only agree when the output
is small enough to hide inside the tolerance.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add solar radiation pressure force, Jacobian and Hessian to SRP_Disturbance

Taken from 2_2/disturbance_forces_clean (#240), SRP portion only.

* Test the SRP force against closed forms, the torque and finite differences

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Niclas Scheuer <niclas_scheuer@web.de>
Co-authored-by: Nic <102034908+nscheuer@users.noreply.github.com>
…ourth of the force stack) (#248)

* Add a force interface to disturbances and Satellite.dist_forces

Disturbance gains force(), force_qjac() and force_qqhess() that return
zeros, mirroring the torque trio, so torque-only disturbances need no
change. Satellite.dist_forces() sums the body-frame forces over the
registered disturbances using the same sat/no-sat call convention as
dist_torques(). The attitude dynamics are untouched; the force is for
orbit propagation and inspection.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add raw (non-renormalising) quaternion finite-difference test helpers

The analytic *_qjac/*_qqhess methods differentiate with respect to the four
raw quaternion components. The existing fd_quat_jac/fd_quat_hess renormalise
the perturbed quaternion, which drops the radial part of the derivative and
only agrees when the output is small enough to hide inside the tolerance.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add aerodynamic drag force, Jacobian and Hessian to Drag_Disturbance

Taken from 2_2/disturbance_forces_clean (#240), drag portion only.

* Test the drag force against closed forms, the torque and finite differences

Adds fd_quat_jac_raw/fd_quat_hess_raw helpers that do not renormalise the
perturbed quaternion; the analytic Jacobians differentiate with respect to
the raw components, so the renormalising helpers only agree when the output
is small enough to hide inside the tolerance.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add solar radiation pressure force, Jacobian and Hessian to SRP_Disturbance

Taken from 2_2/disturbance_forces_clean (#240), SRP portion only.

* Test the SRP force against closed forms, the torque and finite differences

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add Thrust_Disturbance: a body-fixed force at a point, with its torque

A thrust vector applied at a body-frame location gives both the force on
the centre of mass and the torque (location - COM) x F from one model.
Prop_Disturbance stays as the torque-only model. Attitude derivatives are
zero because the force is body-fixed; noise is drawn once per plant step
in update(), as for the other disturbances.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Niclas Scheuer <niclas_scheuer@web.de>
Co-authored-by: Nic <102034908+nscheuer@users.noreply.github.com>
…fifth of the force stack) (#249)

* Add a force interface to disturbances and Satellite.dist_forces

Disturbance gains force(), force_qjac() and force_qqhess() that return
zeros, mirroring the torque trio, so torque-only disturbances need no
change. Satellite.dist_forces() sums the body-frame forces over the
registered disturbances using the same sat/no-sat call convention as
dist_torques(). The attitude dynamics are untouched; the force is for
orbit propagation and inspection.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add raw (non-renormalising) quaternion finite-difference test helpers

The analytic *_qjac/*_qqhess methods differentiate with respect to the four
raw quaternion components. The existing fd_quat_jac/fd_quat_hess renormalise
the perturbed quaternion, which drops the radial part of the derivative and
only agrees when the output is small enough to hide inside the tolerance.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add aerodynamic drag force, Jacobian and Hessian to Drag_Disturbance

Taken from 2_2/disturbance_forces_clean (#240), drag portion only.

* Test the drag force against closed forms, the torque and finite differences

Adds fd_quat_jac_raw/fd_quat_hess_raw helpers that do not renormalise the
perturbed quaternion; the analytic Jacobians differentiate with respect to
the raw components, so the renormalising helpers only agree when the output
is small enough to hide inside the tolerance.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add solar radiation pressure force, Jacobian and Hessian to SRP_Disturbance

Taken from 2_2/disturbance_forces_clean (#240), SRP portion only.

* Test the SRP force against closed forms, the torque and finite differences

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add Thrust_Disturbance: a body-fixed force at a point, with its torque

A thrust vector applied at a body-frame location gives both the force on
the centre of mass and the torque (location - COM) x F from one model.
Prop_Disturbance stays as the torque-only model. Attitude derivatives are
zero because the force is body-fixed; noise is drawn once per plant step
in update(), as for the other disturbances.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Add Sentman_Drag_Disturbance: free-molecular drag at finite speed ratio

A separate class next to Drag_Disturbance. The cold-beam flat plate gives
zero force on an edge-on face and takes a user-supplied CD; Sentman's
one-sided model keeps the thermal motion of the gas, so the coefficients
follow from the speed ratio, a feathered panel keeps a shear floor that
changes with exospheric temperature, and shadowed faces fade smoothly
instead of being clipped. Same GeometryConfig faces (outward normals,
one-sided). Attitude Jacobians/Hessians chain the orbital state's dv/dq
and d2v/dq2 analytically through central-difference velocity derivatives
of the coefficients. The S -> infinity, no re-emission limit reproduces
Drag_Disturbance with CD = 2 (tested).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* added citation

---------

Co-authored-by: Niclas Scheuer <niclas_scheuer@web.de>
Co-authored-by: Nic <102034908+nscheuer@users.noreply.github.com>
…time (#233)

* Add DensityNoise: reading noise given as a density, scaled by the sample time

A subclass of Noise rather than a change to it. Data sheets quote sensor
noise as a density (angle random walk, nT/root-hertz); a reading averaged
over the sample interval has standard deviation density/sqrt(dt) on top of
a rate-independent floor. DensityNoise takes the density and the sensor's
sample time and stores the combined standard deviation in std_noise, so
the reading draw, the estimator's measurement covariance and the warm
start all see the scaled value with no change elsewhere. at_sample_time()
re-derives the model for another rate; broadcast_to/copy keep the subclass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* added additional tests for the densitynoise, specifically a case where densitynoise sample time and sensor sample time were misaligned

---------

Co-authored-by: nscheuer <niclas_scheuer@web.de>
…ty (#235)

* Add BiasWithInstability: the base bias plus a Gauss-Markov bias instability

A subclass of Bias rather than a change to it. Bias instability is the
slow, bounded wander an Allan-variance plot shows as its floor; it is
neither the constant offset nor the random walk the base class models.
BiasWithInstability adds it as a first-order Gauss-Markov process with
standard deviation instability_std and correlation time instability_time,
stepped exactly for any dt, and adds its low-frequency density
2 sigma^2 / tau to process_psd so a random-walk bias state in the filter
covers it. With instability_std = 0 it draws the base class's sequence
exactly; estimator write-backs to .bias are kept.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fixed inverse-\tau formula

---------
…-up on #235) (#251)

* Add BiasWithInstability: the base bias plus a Gauss-Markov bias instability

A subclass of Bias rather than a change to it. Bias instability is the
slow, bounded wander an Allan-variance plot shows as its floor; it is
neither the constant offset nor the random walk the base class models.
BiasWithInstability adds it as a first-order Gauss-Markov process with
standard deviation instability_std and correlation time instability_time,
stepped exactly for any dt, and adds its low-frequency density
2 sigma^2 / tau to process_psd so a random-walk bias state in the filter
covers it. With instability_std = 0 it draws the base class's sequence
exactly; estimator write-backs to .bias are kept.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fixed inverse-\tau formula

* BiasWithInstability: keep the process PSD term as 2 sigma_g^2 / tau

The term added to the random-walk rate must itself be a rate (bias^2 per
second). The Gauss-Markov step has variance sigma_g^2 (1 - exp(-2 dt/tau)),
which for dt << tau is (2 sigma_g^2 / tau) dt, so 2 sigma_g^2 / tau is the
density of the white noise driving the instability and the quantity a
random-walk filter state has to absorb. 2 sigma_g^2 tau is the zero-frequency
power density of the instability's value (bias^2 x seconds), a different
quantity with different units. Two tests pin this down: one from the class's
own step formula, one Monte Carlo on the simulated increments.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------
Co-authored-by: nscheuer <niclas_scheuer@web.de>
Co-authored-by: Nic <102034908+nscheuer@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants