cosmo.el 17.9 KB
Newer Older
1
;;; cosmo.el --- Cosmological Calculator    -*- lexical-binding: t; -*-
2

Francesco Montanari's avatar
Francesco Montanari committed
3
;; Copyright (C) 2017 Francesco Montanari
4
;;
Francesco Montanari's avatar
Francesco Montanari committed
5
;; Author: Francesco Montanari <fmnt@fmnt.info>
Francesco Montanari's avatar
Francesco Montanari committed
6
;; Maintainer: Francesco Montanari <fmnt@fmnt.info>
Francesco Montanari's avatar
Francesco Montanari committed
7
;; Created: 22 April 2017
8
;; Version: 0.1
Francesco Montanari's avatar
Francesco Montanari committed
9
;; Keywords: tools
10
;; Homepage: https://gitlab.com/montanari/cosmo-el
11
;;
Francesco Montanari's avatar
Francesco Montanari committed
12
;; This file is not part of GNU Emacs.
13
;;
Francesco Montanari's avatar
Francesco Montanari committed
14 15 16 17
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
18
;;
Francesco Montanari's avatar
Francesco Montanari committed
19 20 21 22
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
23
;;
Francesco Montanari's avatar
Francesco Montanari committed
24 25
;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
26

27
;;; Commentary:
28

Francesco Montanari's avatar
Francesco Montanari committed
29
;; This package provides a cosmological calculator for Lambda-CDM
Francesco Montanari's avatar
Francesco Montanari committed
30
;; models.  Such a framework describes a homogeneous and isotropic
31
;; universe containing a cosmological constant (Lambda) and a Cold
Francesco Montanari's avatar
Francesco Montanari committed
32
;; Dark Matter (CDM) component, besides ordinary species.  The
33
;; model is characterized by the following parameters:
34
;;
Francesco Montanari's avatar
Francesco Montanari committed
35
;; - H_0 :: Hubble parameter (expansion rate) today.
36 37 38 39
;; - Omega_m0 :: Matter density parameter today.
;; - Omega_Lambda :: Cosmological constant density parameter.
;; - Omega_r0 :: Relativistic species (e.g., photons plus
;;               neutrinos) density parameter today.
Francesco Montanari's avatar
Francesco Montanari committed
40
;; - Omega_k0 :: Curvature density parameter today.  This
41 42
;;               parameter is derived from the others above
;;               according to Friedmann's equation
Francesco Montanari's avatar
Francesco Montanari committed
43
;;               Omega_m0 + Omega_Lambda + Omega_r0 + Omega_k0 = 1.
44
;;
45 46
;; All cosmological quantities are computed at a given redshift
;; value:
47
;;
48 49
;; - redshift :: Gravitational redshift of photons frequency due to the
;;               expansion of the Universe.
50 51
;;
;; Definitions follow Hogg (1999)
Francesco Montanari's avatar
Francesco Montanari committed
52
;; <https://arxiv.org/abs/astro-ph/9905116>.
53
;;
54 55 56 57 58
;; Names with "--" are for functions and variables that are meant to
;; be for internal use only.

;;; Bugs:

59
;; - None known.
60 61 62

;;; Todo:

63
;; In priority order:
64
;;
Francesco Montanari's avatar
Francesco Montanari committed
65
;; - Refactor tests, now they are too cumbersome and repetitive.
66 67 68
;;
;; - Add all quantities from Hogg 1999.
;;
69 70
;; - Suggest default parameters when reading them with the related
;;   command; set the to default values if none is entered.
Francesco Montanari's avatar
Francesco Montanari committed
71 72 73 74 75 76 77 78 79 80
;;
;; - Allow users to load a customized file with the cosmo-pedia
;;   command (or describe how to do it from ~/.emacs).
;;
;; - (Consider the following only if performance becomes critical.) At
;;   a fixed redshift, only cosmo-get-los-comoving-distance perform
;;   the integral. Other distances are defined in terms of this
;;   one. However, each time that other distances are required this
;;   distance is called once again. This is not necessary, it can be
;;   called just once for a given redshift (or use memoization).
81 82

;;; Code:
Francesco Montanari's avatar
Francesco Montanari committed
83

84 85
;;; Global variables.

Francesco Montanari's avatar
Francesco Montanari committed
86 87 88 89 90 91 92 93 94 95 96 97
(defgroup cosmo nil
  "Cosmological calculator."
  :group 'convenience)

(defcustom cosmo-int-prec 1e-3
  "Fractional accuracy for numerical integrals."
  :group 'cosmo)

(defcustom cosmo-int-maxsteps 20
  "Maximum number of steps in the numerical integral algorithm."
  :group 'cosmo)

98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
(defvar cosmo-pedia-text
  ;; Text appearing in the *Cosmopedia* buffer.
  "(`q` to quite)

Units system: hbar = c = k_Boltzmann = 1.

Distances relations
-------------------
- Comoving distance (transverse): D_M
- Angular diameter distance:      D_A = D_M / (1+z)
- Luminosity distance:            D_L = (1+z) D_M = (1+z)^2 D_A

Conversion factors, units
-------------------------
- 1GeV = 1.6022e-3 erg
       = 1.1605e13 K
       = 1.7827e-24 g
       = 5.0684e13 1/cm
       = 1.5192 1/s
- 1 pc = 3.2612 light years
       = 3.0856e18 cm
- 1 Mpc = 1e6pc ~ 3e24 cm ~ 1e14 s
- 1 AU = 1.4960e13 cm
- 1 Jy = 1e-23 erg/cm^2/s/Hz
       = 2.4730e-48 GeV^3
123
- 1 yr ~ pi * 1e17 s
124 125 126 127 128 129 130 131 132

Important constants
-------------------
- Hubble constant: H0 = 100h km/s/Mpc
                      = 2.1332e-42 h GeV
- Hubble time, distance: 1/H0 = 3.0856e17/h s
                               = 9.7776e9/h yr
                               = 2997.9/h Mpc
                               = 9.2503e27/h cm")
133 134

;; Hash table containing all independent cosmological parameters.
135
(defvar cosmo--params
136
  (let ((table (make-hash-table :test #'equal)))
137 138 139 140
    (puthash "H0 [Km/s/Mpc]" 70.0 table) ; Hubble today km/s/Mpc.
    (puthash "omatter" 0.3 table)        ; Matter density today.
    (puthash "olambda" 0.7 table)        ; Curvature density today.
    (puthash "orel" 0.0 table)           ; Relativistic density today.
141
    table)
Francesco Montanari's avatar
Francesco Montanari committed
142
  "Table containing Lambda-CDM cosmological parameters.")
Francesco Montanari's avatar
Francesco Montanari committed
143

144 145
;;; Handle input.

146 147 148 149 150 151
(defun cosmo--string-number-p (string)
  "Test whether STRING represents a number."
  (if (string-match "\\`[-+]?[0-9]+\\.?[0-9]*\\'" string)
      t
    nil))

Francesco Montanari's avatar
Francesco Montanari committed
152
(defun cosmo--read-param (name)
Francesco Montanari's avatar
Francesco Montanari committed
153
  "Read parameter NAME from minibuffer and convert it to a number."
154 155 156 157
  (let ((value (read-from-minibuffer (format "Enter %s: " name))))
    (if (cosmo--string-number-p value)
        (string-to-number value)
      (error "Error: parameter must be a number"))))
Francesco Montanari's avatar
Francesco Montanari committed
158

159
(defun cosmo--put-param (name)
160
  "Read parameter NAME from minibuffer and add it to the parameter table."
161 162
  (puthash name (cosmo--read-param name) cosmo--params))

Francesco Montanari's avatar
Francesco Montanari committed
163
(defun cosmo--check-param (name value)
164
  "Check the validity of NAME (a cosmological parameter) VALUE."
165
  (cond ((or (string= name "omatter")
166
             (string= name "olambda")
167
             (string= name "orel"))
168
         (unless (>= value 0.0)
169
           (error "Error: density parameter must be positive")))))
Francesco Montanari's avatar
Francesco Montanari committed
170 171

(defun cosmo-set-params ()
172
  "Change the values of cosmological parameters."
Francesco Montanari's avatar
Francesco Montanari committed
173
  (interactive)
174
  (maphash (lambda (key _value)
175 176 177
             (cosmo--put-param key)
             (cosmo--check-param key (gethash key cosmo--params)))
           cosmo--params))
Francesco Montanari's avatar
Francesco Montanari committed
178

Francesco Montanari's avatar
Francesco Montanari committed
179
;;; Numerical utilities.
180

181
(defun cosmo-sinh (x)
182 183 184
  "Hyperbolic sine of real arguments X."
  (* 0.5 (- (exp x) (exp (- x)))))

185 186 187 188
(defun cosmo-asinh (x)
  "Inverse hyperbolic sine of real arguments X."
  (log (+ x (sqrt (1+ (* x x))))))

Francesco Montanari's avatar
Francesco Montanari committed
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
(defun cosmo--trapzd (func lo hi sum niter)
  "Extended trapezoidal rule to integrate FUNC from LO to HI.
Compute the refinement to an old SUM result, previous to the
current NITER stage of refinement.  The function must be called
for NITER = 1, 2, 3, ... in order.  Boundaries LO and HI are
always converted to floats."
  (let ((lo (float lo))                 ; Always assume float boundaries.
        (hi (float hi)))
    ;; NITER=1 corresponds simply to integrate(func(x), x, lo, hi)
    (if (= niter 1)
        (* 0.5 (- hi lo) (+ (funcall func lo) (funcall func hi)))
      ;; Subsequent calls NITER = 2, 3, ... (in order) improve the
      ;; accuracy by adding 2^(NITER-2) interior points.
      (let* ((iter (expt 2 (- niter 2)))
             (step (/ (- hi lo) iter))
             (xval (+ lo (* 0.5 step)))
             (sumf 0.0)
             (j 0))
        (while (< j iter)
          (setq sumf (+ sumf (funcall func xval)))
          (setq xval (+ xval step))
          (setq j (1+ j)))
        (* 0.5 (+ sum (* (- hi lo) (/ sumf iter))))))))

(defun cosmo-qsimp (func lo hi &optional eps jmax)
  "Simpson's integration.
Argument FUNC integrand.
Argument LO lower bound.
Argument HI upper bound.
Optional argument EPS fractional accuracy.
Optional argument JMAX maximum number of steps."
  (let ((eps (or eps 1e-6))             ; Set defaults.
        (jmax (or jmax 20))
        (nsum 0.0)                      ; N-th iteration sum.
        (nsumt 0.0)
        (osum 0.0)                      ; Old sum.
        (osumt 0.0)
        (converged nil)
        (j 1))
    (while (and (<= j jmax) (not converged))
      (setq nsumt (cosmo--trapzd func lo hi nsum j))
      (setq nsum (/ (- (* 4.0 nsumt) osumt) 3.0))
      (if (and (> j 5)                  ; Avoid spurious early convergence.
               (or (< (abs (- nsum osum)) (* eps (abs osum)))
                   (and (= nsum 0.0) (= osum 0.0))))
          (setq converged t))
      (setq osum nsum)
      (setq osumt nsumt)
      (setq j (1+ j)))
    (if converged
        nsum
      (error "Error: the integral did not converge, try to
      increase the number of steps"))))
242

243
;;; Compute cosmological functions.
244

245 246 247 248 249 250 251
(defun cosmo-get-ocurvature ()
  "Get curvature density parameter today from Friedmann equations."
  (let ((omatter (gethash "omatter" cosmo--params))
        (olambda (gethash "olambda" cosmo--params))
        (orel (gethash "orel" cosmo--params)))
    (- 1.0 omatter olambda orel)))

252
(defun cosmo-efunc (redshift)
253
  "E(z) function at a given REDSHIFT."
Francesco Montanari's avatar
Francesco Montanari committed
254
  (let ((omatter (gethash "omatter" cosmo--params))
255
        (olambda (gethash "olambda" cosmo--params))
256
        (orel (gethash "orel" cosmo--params))
257
        (ocurvature (cosmo-get-ocurvature))
Francesco Montanari's avatar
Francesco Montanari committed
258
        (zp1 (+ 1 redshift)))
259
    (sqrt (+ (* orel (expt zp1 4.0))
260 261 262 263
             (* omatter (expt zp1 3.0))
             (* ocurvature (expt zp1 2.0))
             olambda))))

264
(defun cosmo-inv-efunc (redshift)
265
  "Inverse E(z) function at a given REDSHIFT."
Francesco Montanari's avatar
Francesco Montanari committed
266
  (/ 1.0 (cosmo-efunc redshift)))
267

268
(defun cosmo-get-hubble (redshift)
269
  "Hubble parameter [Km/s/Mpc] for Lambda-CDM at a given REDSHIFT."
270
  (let ((H0 (gethash "H0 [Km/s/Mpc]" cosmo--params)))
271
    (* H0 (cosmo-efunc redshift))))
Francesco Montanari's avatar
Francesco Montanari committed
272 273 274 275 276

(defun cosmo-hubble ()
  "Display Hubble parameter in mini-buffer."
  (interactive)
  (let ((z (cosmo--read-param "redshift")))
277
    (message (format "%s km/s/Mpc" (cosmo-get-hubble z)))))
Francesco Montanari's avatar
Francesco Montanari committed
278

279
(defun cosmo-get-hubble-distance ()
280
  "Hubble distance c/H0 [Mpc] for Lambda-CDM."
281 282 283
  (let ((H0 (gethash "H0 [Km/s/Mpc]" cosmo--params)))
    (/ 3.0e5 H0)))

284
(defun cosmo-hubble-distance ()
285
  "Display Hubble distance c/H0 [Mpc] in mini-buffer."
286
  (interactive)
287
  (message (format "%s Mpc" (cosmo-get-hubble-distance))))
288

289 290 291 292 293 294 295 296 297 298
(defun cosmo-get-hubble-time ()
  "Hubble time 1/H0 [Gyr] for Lambda-CDM."
  (let ((H0 (gethash "H0 [Km/s/Mpc]" cosmo--params)))
    (/ 9.78e2 H0)))

(defun cosmo-hubble-time ()
  "Display Hubble distance 1/H0 [yr] in mini-buffer."
  (interactive)
  (message (format "%s Gyr" (cosmo-get-hubble-time))))

299
(defun cosmo-get-los-comoving-distance (redshift)
300
  "Line-of-sight comoving distance [Mpc] for Lambda-CDM at a given REDSHIFT."
301
  (let ((DH (cosmo-get-hubble-distance))
Francesco Montanari's avatar
Francesco Montanari committed
302 303
        (int (cosmo-qsimp #'cosmo-inv-efunc 0.0 redshift
                          cosmo-int-prec cosmo-int-maxsteps)))
304 305 306 307 308 309
    (* DH int)))

(defun cosmo-los-comoving-distance ()
  "Display line-of-sight comoving distance in mini-buffer."
  (interactive)
  (let ((z (cosmo--read-param "redshift")))
310
    (message (format "%s Mpc" (cosmo-get-los-comoving-distance z)))))
311

312
(defun cosmo-get-transverse-comoving-distance (redshift)
313
  "Line-of-sight comoving distance [Mpc] for Lambda-CDM at a given REDSHIFT."
314 315 316 317
  (let* ((DH (cosmo-get-hubble-distance))
         (DC (cosmo-get-los-comoving-distance redshift))
         (ocurvature (cosmo-get-ocurvature))
         (sqrt-ok (sqrt (abs (cosmo-get-ocurvature))))
318 319
         (DH-over-sqrtok (/ DH sqrt-ok)))
    (cond ((> ocurvature 0)
320
           (* DH-over-sqrtok (cosmo-sinh (/ DC DH-over-sqrtok))))
321 322 323 324 325 326 327 328 329 330
          ((= ocurvature 0)
           DC)
          ((< ocurvature 0)
           (* DH-over-sqrtok (sin (/ DC DH-over-sqrtok)))))))

(defun cosmo-transverse-comoving-distance ()
  "Display transverse comoving distance in mini-buffer."
  (interactive)
  (let ((z (cosmo--read-param "redshift")))
    (message (format "%s Mpc"
331
                     (cosmo-get-transverse-comoving-distance z)))))
332

333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
(defun cosmo-get-angular-diameter-distance (redshift)
  "Angular diameter distance [Mpc] for Lambda-CDM at a given REDSHIFT."
  (let* ((DM (cosmo-get-transverse-comoving-distance redshift)))
    (/ DM (1+ redshift))))

(defun cosmo-angular-diameter-distance ()
  "Display angular diameter distance in mini-buffer."
  (interactive)
  (let ((z (cosmo--read-param "redshift")))
    (message (format "%s Mpc"
                     (cosmo-get-angular-diameter-distance z)))))

(defun cosmo-get-luminosity-distance (redshift)
  "Luminosity distance [Mpc] for Lambda-CDM at a given REDSHIFT."
  (let* ((DM (cosmo-get-transverse-comoving-distance redshift)))
    (* DM (1+ redshift))))

(defun cosmo-luminosity-distance ()
  "Display luminosity distance in mini-buffer."
  (interactive)
  (let ((z (cosmo--read-param "redshift")))
    (message (format "%s Mpc"
                     (cosmo-get-luminosity-distance z)))))

357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396
(defun cosmo-get-parallax-distance (redshift)
  "Parallax distance [Mpc] for Lambda-CDM at a given REDSHIFT."
  (let* ((DH (cosmo-get-hubble-distance))
         (DM (cosmo-get-transverse-comoving-distance redshift))
         (dM (/ DM DH))
         (ocurvature (cosmo-get-ocurvature)))
    (/ DM (+ dM (sqrt (1+ (* ocurvature dM dM)))))))

(defun cosmo-parallax-distance ()
  "Display parallax distance in mini-buffer."
  (interactive)
  (let ((z (cosmo--read-param "redshift")))
    (message (format "%s Mpc"
                     (cosmo-get-parallax-distance z)))))

(defun cosmo--get-comoving-volume-nonflat (DM DH ocurvature)
  "Return the comoving volume for non-vanishing curvature."
  (let* ((DM-over-DH (/ DM DH))
         (sqrt-ok (sqrt (abs (cosmo-get-ocurvature))))
         (pref (* 2.0 float-pi (/ (expt DH 3.0) ocurvature)))
         (func (cond ((> ocurvature 0.0)
                      #'cosmo-asinh)
                     ((< ocurvature 0.0)
                      #'asin)
                     (t (error "Error: wrong curvature parameter value")))))
    (setq term1 (* DM-over-DH
                   (sqrt (1+ (* ocurvature (expt DM-over-DH 2.0))))))
    (setq term2 (/ (funcall func (* sqrt-ok DM-over-DH)) sqrt-ok))
    (* pref (- term1 term2))
    ))

(defun cosmo-get-comoving-volume (redshift)
  "Comoving volume [Mpc^3] for Lambda-CDM at a given REDSHIFT."
  (let* ((DH (cosmo-get-hubble-distance))
         (DM (cosmo-get-transverse-comoving-distance redshift))
         (ocurvature (cosmo-get-ocurvature)))
    (if (= ocurvature 0.0)
        (* (/ 4.0 3.0) float-pi (expt DM 3.0))
        (cosmo--get-comoving-volume-nonflat DM DH ocurvature))))

397
;;; Handle output.
398

399 400 401
(defun cosmo--write-calc-header ()
  "Write header for the cosmological calculator summary buffer."
  (let ((head "Cosmology calculator.\n\n")
402
        (help "(`q` to quite)\n\n"))
403
    (insert (propertize help 'font-lock-face 'italic))
404 405
    (insert head)))

406 407 408
(defun cosmo--write-calc (redshift H0 omatter olambda orel hubble
                                   los-dist transverse-dist
                                   luminosity-dist angular-dist)
409 410 411 412
  "Format and insert cosmological table in buffer.
Argument REDSHIFT redshift.
Argument H0 Hubble parameter today.
Argument OMATTER matter density parameter.
413
Argument OLAMBDA cosmological constant density parameter.
414
Argument OREL density parameter.
415
Argument HUBBLE Hubble parameter at given redshift.
416 417 418 419
Argument LOS-DIST line-of-sight comoving distance at given redshift.
Argument TRANSVERSE-DIST transverse comoving distance at given redshift.
Argument LUMINOSITY-DIST luminosity distance at given redshift.
Argument ANGULAR-DIST angular diameter distance at given redshift."
420
  ;; Input parameters.
421 422
  (cosmo--write-calc-header)
  (insert "Input Parameters\n"
423
          "----------------\n"
424
          (format "- Redshift:                                 %s\n"
425
                  redshift)
426
          (format "- Hubble constant, now [km/s/Mpc]:          %s\n"
427
                  H0)
428
          (format "- Matter fractional density, now:           %s\n"
429
                  omatter)
430 431
          (format "- Cosmological constant fractional density: %s\n"
                  olambda)
432 433
          (format "- Relativistic fractional density, now:     %s\n"
                  orel)
434
          "\n")
435
  ;; Derived parameters.
436
  (insert "Derived parameters\n"
437
          "------------------\n"
438
          (format "- Curvature fractional density: %s\n"
439
                  (cosmo-get-ocurvature))
Francesco Montanari's avatar
Francesco Montanari committed
440
          (format "- Hubble distance [Mpc]:        %s\n"
441
                  (cosmo-get-hubble-distance))
Francesco Montanari's avatar
Francesco Montanari committed
442
          (format "- Hubble time [Gyr]:            %s\n"
443
                  (cosmo-get-hubble-time))
444
          "\n")
445
  ;; Cosmological functions.
446
  (insert "Cosmography at required redshift\n"
447
          "--------------------------------\n"
Francesco Montanari's avatar
Francesco Montanari committed
448
          (format "- Hubble parameter [km/s/Mpc]:             %s\n"
449
                  hubble)
Francesco Montanari's avatar
Francesco Montanari committed
450
          (format "- Comoving distance (line-of-sight) [Mpc]: %s\n"
451
                  los-dist)
Francesco Montanari's avatar
Francesco Montanari committed
452
          (format "- Comoving distance (transverse) [Mpc]:    %s\n"
453
                  transverse-dist)
Francesco Montanari's avatar
Francesco Montanari committed
454
          (format "- Angular diameter distance [Mpc]:         %s\n"
Francesco Montanari's avatar
Francesco Montanari committed
455
                  angular-dist)
Francesco Montanari's avatar
Francesco Montanari committed
456
          (format "- Luminosity distance [Mpc]:               %s\n"
Francesco Montanari's avatar
Francesco Montanari committed
457
                  luminosity-dist))
458
  nil)
Francesco Montanari's avatar
Francesco Montanari committed
459 460 461 462

(defun cosmo-calculator ()
  "Compute cosmology and display summary table in a new buffer."
  (interactive)
463 464
  (let* ((cosmo-buffer "*Cosmo*")
         (redshift (cosmo--read-param "redshift"))
Francesco Montanari's avatar
Francesco Montanari committed
465
         (omatter (gethash "omatter" cosmo--params))
466
         (olambda (gethash "olambda" cosmo--params))
467
         (orel (gethash "orel" cosmo--params))
Francesco Montanari's avatar
Francesco Montanari committed
468
         (H0 (gethash "H0 [Km/s/Mpc]" cosmo--params))
469
         (hubble (cosmo-get-hubble redshift))
470 471 472 473
         (los-dist (cosmo-get-los-comoving-distance redshift))
         (transverse-dist (cosmo-get-transverse-comoving-distance redshift))
         (luminosity-dist (cosmo-get-luminosity-distance redshift))
         (angular-dist (cosmo-get-angular-diameter-distance redshift)))
474 475
    (with-output-to-temp-buffer cosmo-buffer
      (pop-to-buffer cosmo-buffer)
476
      (cosmo--write-calc redshift H0 omatter olambda orel hubble
477 478
                         los-dist transverse-dist luminosity-dist
                         angular-dist))))
Francesco Montanari's avatar
Francesco Montanari committed
479

480 481 482 483 484 485
(defun cosmo-pedia ()
  "Display a reference to basic cosmological definitions."
  (interactive)
  (let* ((cosmo-buffer "*Cosmopedia*"))
    (with-output-to-temp-buffer cosmo-buffer
      (pop-to-buffer cosmo-buffer)
486
      (insert cosmo-pedia-text))))
487

Francesco Montanari's avatar
Francesco Montanari committed
488
(provide 'cosmo)
489 490

;;; cosmo.el ends here