Skip to content

Conversation

@chrisbrahms
Copy link
Collaborator

  1. Adds cycle-averaged ADK rate (possibly useful for Envelope plasma take 2 #241 ?)
  2. Makes the interface for switching cycle-averaging on/off a bit more logical: rather than rcycle with default true, keyword argument is now cycle_average which defaults to false.

@chrisbrahms chrisbrahms requested a review from jtravs September 28, 2021 20:05
*exp(-4/3*ω_p/(ω_t_prefac*abs(E))))
if cycle_average
(avfac*sqrt(abs(E))*ω_p*cn_sq*
(4*ω_p/(ω_t_prefac*abs(E)))^(2*nstar-1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be nice to factorise the common parts of the two cases? So just the part that changes is inside the conditional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes--I thought it would slow it down (by adding an extra step) but actually it makes no measurable difference

(4*ω_p/(ω_t_prefac*abs(E)))^(2*nstar-1)
*exp(-4/3*ω_p/(ω_t_prefac*abs(E))))
if cycle_average
(avfac*sqrt(abs(E))*ω_p*cn_sq*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a reference for this, or did you just work it out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's from Zenghu Chang's book:
image
I've added a comment

@chrisbrahms chrisbrahms merged commit c9ff7db into LupoLab:master Oct 7, 2021
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