Repository navigation
UPDATE 2.2 - #241
Draft
nscheuer wants to merge 9 commits into
Draft
UPDATE 2.2#241nscheuer wants to merge 9 commits into
nscheuer wants to merge 9 commits into
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
* 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
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.