Exercises lecture 4

ClearAll["Global`*"];SetDirectory[NotebookDirectory[]]

Exercise 1: find graphically (or numerically) the minimum order of the series expansion around 0 that approximates the Sin up to better than 0.1 absolute error  over the interval (0,5)

Exercise 2: Solve the growth equation in FRW , in a LCDM model, from N = log a = -5 to N = 0
delta'' + (2+E’/E)*delta' - 3/2*Omega_m*delta = 0
where 
Omega_m=Omega_m0 *(1+z)^3/E^2
E^2=Omega_m0 *(1+z)^3+1-Omega_m0
E’/E=-3/2*Omega_m
with delta[-5]=1 and delta’[-5]=1
Note that 1+z=1/a=Exp[-N]; choose, eg, omegam0=0.3.

Compare then with the approximate solution
f=d log delta /d N = Omega_m ^0.545

Exercise 3: Solve numerically a differential equation for the motion of a spring with friction and plot the solution; you might use the constant below, or define them as you prefer

(*Define the constants*)
m=1;         (*Mass*)
k=2;         (*Spring constant*)
c=0.5;       (*Friction coefficient*)
x0=1;        (*Initial displacement*)
v0=0;        (*Initial velocity*)
tmax=10;     (*Maximum time*)