Permalink
Browse files

Fixed a simplification of the calculation of coschi, the angle betwee…

…n the incident irradiating flux and the normal to the surface, is calculation. The exact calculation is now used. This has an effect especially on shorter orbital period systems in which the companion is large, and the terminator does not lie on the meridian passing through the centre of mass, but towards the nose of the star.
  • Loading branch information...
bretonr committed Jan 14, 2017
1 parent e059891 commit a232ea3c3ccb4909c275f3ab1bba3b2ea93845a2
Showing with 23 additions and 8 deletions.
  1. +13 −8 Icarus/Core/Star.py
  2. +10 −0 RELEASES.md
View
@@ -241,16 +241,21 @@ def _Surface(self, debug=False):
self.gradx = -dpsidx/geff
self.grady = -dpsidy/geff
self.gradz = -dpsidz/geff
## coschi is the cosine angle between the rx and the surface element. shape = n_faces
## A value of 1 means that the companion's surface element is directly facing the pulsar, 0 is at the limb and -1 on the back.
## The following is the old way, which is derived from the spherical approximation, i.e. that the normal to the surface is approximately the same as the radial position
if self.oldchi:
self.coschi = -(self.rc-self.cosx)/self.rx
## The better calculation should use the gradient as the normal vector, and the direction to the pulsar as positive x.
## This implies that the angle coschi is simply the x component of the gradient.
else:
self.coschi = self.gradx.copy()
## coschi is the cosine angle between the rx and the surface element. shape = n_faces
## A value of 1 means that the companion's surface element is directly facing the pulsar, 0 is at the limb and -1 on the back.
## The following is the old way, which is derived from the spherical approximation, i.e. that the normal to the surface is approximately the same as the radial position
#self.coschi = -(self.rc-self.cosx)/self.rx
## The better calculation should use the gradient as the normal vector, and the direction to the pulsar as positive x.
## This implies that the angle coschi is simply the x component of the gradient.
self.coschi = self.gradx.copy()
else:
## coschi = (N * rx) / (abs(N) abs(rx))
## N: vector normal to the surface, which is the grad of the potential
## rx: vector from the secondary (e.g. neutron star) to the primary (e.g. companion)
## note that N is normalised already
self.coschi = -self.rc*((self.cosx-1/self.rc)*self.gradx + self.cosy*self.grady + self.cosz*self.gradz) / np.abs(self.rx)
## surface area. shape = n_faces
self.area = self.rc**2 * self.pre_area
logger.log(9, "end")
View
@@ -2,6 +2,16 @@
## Release history
### 2.3.1 (2017-01-14)
Features:
Bug fixes:
- Fixed one further assumption about the was that coschi, the angle between the incident irradiating flux and the normal to the surface, is calculation. The exact calculation is now used. This has an effect especially on shorter orbital period systems in which the companion is large, and the terminator does not lie on the meridian passing through the centre of mass, but towards the nose of the star.
### 2.3.0 (2016-04-15)
Features:

0 comments on commit a232ea3

Please sign in to comment.