Hi everyone, As the title said, I want to plot this function using mathematica:
where the only variable is the redshift z, how can I do that with the function Plot in mathematica ? The goal si to obtain the dL(z) as function of redshift z. Thanks.
Probably because for every value of z it wastes a long time (a couple of seconds on my system) trying (unsuccessfully) to compute the integral symbolically, over and over again:
c = Integrate[3 (4 + 3 u/(1 + u)) D[Log[u + 1], u], {u, 0, 1}]; r = E^c; dSymbolical[z_] := 300000 Integrate[(1 + z)/(75 (.3 (1 + u)^3 + r (1 + u)^(3 (1 + (1 + u/(1 + u)))))), {u, 0, z}]; Timing[dSymbolical[.1]] Timing[N[dSymbolical[.1]]]
Use NIntegrate instead of symbolic integration:
c = Integrate[3 (4 + 3 u/(1 + u)) D[Log[u + 1], u], {u, 0, 1}]; r = E^c; d[z_] := 300000 NIntegrate[(1 + z)/(75 (.3 (1 + u)^3 + r (1 + u)^(3 (1 + (1 + u/(1 + u)))))), {u, 0, z}]; Plot[d[z], {z, 0, 10}]
Yeeahh it works!!! Thank you so much! I don't understand why it didn't work with Integrate. Again, thank you!
Thak you for the answer. I try in this way :
but the command "Plot" run indefinitely (the program remain in "Running" state).
Perhaps you meant to r[z_] instead of r[_z]. Instead of d(ln(u+1)) try writing D[Log[1+u],u] and integrating in the variable u, as in
r[z_]
r[_z]
d(ln(u+1))
D[Log[1+u],u]
Integrate[f[u] D[Log[1 + u], u], {u, 0, 1}]
Okay, I have another problem. I need to define this parametres : ![][2]
where w is:
and then I'll put the density rho into the previuos equation (the equation in the first post ). Now, I set w0 and wa equal to 1 and on mathematic I wrote :
Where I wrong?
Thank you so much, amazing!
you need value of parameters..