Message Boards Message Boards

0
|
11101 Views
|
9 Replies
|
4 Total Likes
View groups...
Share
Share this post:

How can I plot the luminosity distance as function of redshift?

Posted 9 years ago

Hi everyone, As the title said, I want to plot this function using mathematica:

Luminosity distance

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.

POSTED BY: Matteo De Leone
9 Replies

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]]]
POSTED BY: Gianluca Gorni

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}]
POSTED BY: Gianluca Gorni

Yeeahh it works!!! Thank you so much! I don't understand why it didn't work with Integrate. Again, thank you!

POSTED BY: Matteo De Leone

Thak you for the answer. I try in this way : enter image description here

but the command "Plot" run indefinitely (the program remain in "Running" state).

POSTED BY: Matteo De Leone

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

Integrate[f[u] D[Log[1 + u], u], {u, 0, 1}]
POSTED BY: Gianluca Gorni

Okay, I have another problem. I need to define this parametres : density![][2]

where w is:

parametrization

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 :

output

Where I wrong?

POSTED BY: Matteo De Leone

Thank you so much, amazing!

POSTED BY: Matteo De Leone
Posted 9 years ago

enter image description here

POSTED BY: Okkes Dulgerci
Posted 9 years ago

you need value of parameters..

POSTED BY: Okkes Dulgerci
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract