Skip to content

Commit 778bcd5

Browse files
committed
add SRP force
1 parent 7de608c commit 778bcd5

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The goal of the Fortran Astrodynamics Toolkit is to produce a comprehensive libr
2727
* Force models
2828
- [ ] point mass gravity field
2929
- [x] geopotential gravity
30-
- [ ] solar radiation pressure
30+
- [x] solar radiation pressure
3131
- [ ] atmospheric drag
3232
- [ ] relativistic effects
3333
* Reference frames
@@ -45,6 +45,7 @@ The goal of the Fortran Astrodynamics Toolkit is to produce a comprehensive libr
4545
* Misc
4646
- [x] orbital element conversions
4747
- [x] halo orbits
48+
- [x] solar eclipsing
4849
- [ ] targeting and optimization
4950
- [ ] spacecraft engine models
5051

src/lighting_module.f90

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
module lighting_module
77

88
use kind_module, only: wp
9-
use numbers_module, only: pi, zero, one, two, c_light
9+
use numbers_module, only: pi, zero, one, two, c_light, fourpi, solar_luminosity
1010
use vector_module, only: unit, cross, axis_angle_rotation
1111
use ephemeris_module, only: ephemeris_class
1212
use transformation_module, only: icrf_frame
1313
use celestial_body_module, only: celestial_body, body_sun, body_ssb
14-
use conversion_module, only: deg2rad, rad2deg
14+
use conversion_module, only: deg2rad, rad2deg, km2m
1515
use math_module, only: wrap_angle
1616

1717
implicit none
@@ -25,12 +25,39 @@ module lighting_module
2525
public :: solar_fraction_alt ! low-level routine
2626
public :: solar_fraction_alt2 ! low-level routine
2727
public :: cubic_shadow_model ! low-level routine
28+
public :: solar_radiation_pressure
2829

2930
public :: lighting_module_test
3031

3132
contains
3233
!*****************************************************************************************
3334

35+
!********************************************************************************
36+
!>
37+
! Compute the solar radiation pressure force vector on a spacecraft.
38+
39+
function solar_radiation_pressure(area, cr, r_sc_sun, sunfrac) result (srp)
40+
41+
real(wp),intent(in) :: area !! cross-sectional area of spacecraft [m^2]
42+
real(wp),intent(in) :: cr !! coefficient of reflectivity
43+
real(wp),dimension(3),intent(in) :: r_sc_sun !! vector from spacecraft to sun [km]
44+
real(wp),intent(in) :: sunfrac !! sun fraction [0=total eclipse, 1=no eclipse]
45+
real(wp),dimension(3) :: srp !! solar radiation pressure force vector [N]
46+
47+
real(wp) :: mag !! srp magnitude
48+
real(wp) :: r_mag !! magnitude of `r_sc_sun`
49+
50+
if (sunfrac==zero) then
51+
srp = zero
52+
else
53+
r_mag = norm2(r_sc_sun) * km2m ! (m)
54+
mag = sunfrac * cr * solar_luminosity * area / (c_light * km2m * fourpi * r_mag**2)
55+
srp = -mag * r_sc_sun * km2m / r_mag ! (N)
56+
end if
57+
58+
end function solar_radiation_pressure
59+
!********************************************************************************
60+
3461
!********************************************************************************
3562
!>
3663
! Compute the "sun fraction" using the selected shadow model.

src/numbers_module.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ module numbers_module
3030
!! constant \( km^3/kg-s^2 \)
3131

3232
real(wp),parameter,public :: c_light = 299792.458_wp !! speed of light in km/s
33+
real(wp),parameter,public :: solar_luminosity = 3.8275e+26_wp !! solar luminosity (W)
34+
!! see: "Resolution B3 on recommended nominal conversion constants for selected solar and planetary properties". IAU. 2015, which has: 3.8274 (+/- 0.0014) x 10^26 W.
3335

3436
!> 3x3 identity matrix:
3537
real(wp),dimension(3,3),parameter,public :: identity_3x3 = reshape(&

0 commit comments

Comments
 (0)