A Mathematica Interface for CAMB (Version 1.1):

By Savvas Nesseris and Leandros Perivolaropoulos


We present a Mathematica interface for CAMB (based on September 2006 version).

It allows the user to specify any two-parameter ansatz for the Dark Energy equation of state

w(a) and calculates the TT, TE and EE CMB power spectra in real time.


This means that in order to use another w(a) ansatz there is no need to recompile

any code! Just change w(a) and hit Enter!


The requirements for using the code is only Mathematica v5.2+.


Download the binaries: Windows Linux


Watch a demo video of the interface: flash avi


In this demo, which was created in just in a few seconds, the user sees how the CMB power

spectrum scales with H0 for a LCDM cosmology!


and this happens without having first to calculate the spectra, then import the

data to some other program etc, therefore making the Interface very suitable for

educational purposes as well.

In Figure 1 a sample of the interface is shown:


Figure 1


(Note that the interface is under continuous improvement, so expect that much more features will be included. See the

To-Do part of the project for details.)



To initiate the interface follow these simple steps:

1) Download the files for your system (Windows or Linux) from the link above.


2) Place them in a directory.


3) Unzip and open with Mathematica (v5.2+) the camb_interface.nb file.

Note: Mathematica 6 users should choose the Do not scan this notebook option

when they first open the notebook.


4) Change the SetDirectory command to where you placed the files.


5) Evaluate the cells and the interface should run.


Your first calculation:


1) Just hit the Run CAMB button! In a few seconds the TT, TE and EE spectra will be shown in the panel below. This model corresponds to LCDM (w0=-1, w1=0)


2) Next, try changing some the parameters or the w(a) ansatz and see what happens!


3) By pressing Ctrl+T a new Tab appears (as in Firefox). The parameters in this tab correspond to that model only. To kill (close) a tab use the kill tab button (write the number of the model you want to delete in the field next to the button and then press it (note that this will change in future versions)).



The Features of the Interface:


  • The users may specify the two-parameter ansatz w(a) they want and the values of the two parameters.

Default: w(a)=w0+w1(1-a), w0=-1, w1=0


  • Various cosmological paramaters including H0, , , ,

Default: The values shown in Figure 1


  • Compare the theoretical curves with the actual WMAP 3 yr data


  • Keybord shortcuts are now supported, eg Ctrl+T creates a new Tab


  • Quickly change various options about the line that represents the data, like color and thickness


  • Besides the basic colors the user may also choose between all available

colors in his system by going to the Plot->More colors menu (or just press Ctrl+B)


  • The PlotStyle option allows for various styles of the plots (Linear, Lograrithmic etc)


  • Export the data for the selected model (Ctrl+1) and figures of the plots in EPS format (Ctrl+2, Ctrl+3 , Ctrl+4 for the TT, TE, EE plots)




1) Add several more features in the interface (cosmological parameters etc)

2) The choice to give any potential V(phi) (Quintessence) besides w(a)

and calculate the power spectra in real time! (coming very soon!)



In this version (1.1) several features were added (keybord shortcuts, Tabs for the plots and models) and

the incompatibility issue with Mathematica 6 was solved.


Also, a bug (pointed out by S. L. Cherkas) that existed in the previous version was corrected.


1) The only limitation to the range of the w(a) that may be used is that the Dark Energy

density may be calculated in a closed form

that can be understood by fortran, ie in terms of elementary functions like Exp, Sin etc.

In the case that the previous requirement is not met, then CAMB will obviously crash and the Interface will

issue a warning.


2) The performance of the code depends on the computer and model used.


3) Remember that the interface is under constant development so check back the web-page often!



For Questions/Bug reports dont hesitate to e-mail me.