Prev Next

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\W}[1]{ \; #1 \; }@)@This is dismod_at-20221105 documentation: Here is a link to its current documentation .
Compute The Average Integrand

Syntax
Purpose
rate
integrand_name
grid
     age
     time
abs_tol
avg_integrand
Example

Syntax
avg_integrand = dismod_at.average_integrand(
   
rateintegrand_namegridabs_tol
)


Purpose
The predict_command is a much faster way to calculate these values. This routine is easier to use and provides independent testing of the dismod_at integrators.

rate
This is a dictionary and it's possible keys are the rate names . If a key is a key in the dictionary,
   
value = rate[key](agetime)
returns a float equal to the value of the specified rate at the specified age and time. Note that age will always be zero when evaluating
   
value = rate['pini'](agetime)
If a rate name is not in the dictionary, the corresponding rate is zero.

integrand_name
This string is one of the integrand names .

grid
This argument defines the grid for trapezoidal integration. (The dismod_at integrands are often non-smooth and so a low order integration method is called for.) The grid is a dictionary with the following keys:

age
grid['age'] is a list of floats containing the grid points for the average w.r.t. age. These points are monotone increasing, the first (last) point is the lower (upper) age limit for the average

time
grid['time'] is a list of floats containing the grid points for the average w.r.t. time. These points are monotone increasing, the first (last) point is the lower (upper) time limit for the average

abs_tol
This float is an absolute error bound, that the integrator will achieve.

avg_integrand
This is the calculated value for the average integrand .

Example
The file user_average_integrand.py contains an example and test of this routine.
Input File: python/dismod_at/average_integrand.py