{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "from scipy.integrate import quad\n",
    "\n",
    "import numpy as np\n",
    "\n",
    "import PyCosmo"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2.1.1'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PyCosmo.__version__"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1. Wavenumber at equality\n",
    "1. Assume that around equality the dominant components are matter and radiation. Use the first Friedmann equation i.e.: \n",
    "\n",
    "\t\\begin{equation}\n",
    "\tH^2 = H_0^2[\\sum_i \\Omega_i a^{-3(1+w)}],\n",
    "\t\\end{equation}\n",
    "    \n",
    "    to calculate $a_{eq}$, $H(a_{eq})$ and therefore $k_{eq}$.\n",
    "    \n",
    "    How might you identify $k_{eq}$ in a cosmological observable? Can you make a plot which includes this scale using PyCosmo? Do yout think this has been observed in data?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2. Growth factor\n",
    "\n",
    "Here compute the growth factor for various cosmologies. The basic command in PyCosmo is shown below"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (4003919975.py, line 4)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;36m  Cell \u001b[0;32mIn[10], line 4\u001b[0;36m\u001b[0m\n\u001b[0;31m    Cosmo.set(h=0.7, omega_b=, omega_m=)\u001b[0m\n\u001b[0m                             ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "# Define the Cosmology\n",
    "Cosmo = PyCosmo.build()\n",
    "#TODO: Set the parameters accordingly\n",
    "Cosmo.set(h=0.7, omega_b=, omega_m=)\n",
    "\n",
    "# Function to calculate the growth factor\n",
    "# uses the scaling parameter as input\n",
    "growth_factor = Cosmo.lin_pert.growth_a(a=...)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}