<p>I want to recreate the figure <a href="https://i.sstatic.net/9zSBY.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/9zSBY.jpg" alt="Freeze out of massive particle species" /></a>. This comes from the Cosmological Boltzmann equation which can be modified as the number density equation as</p>
<p><span class="math-container">$$\frac{dY}{dx}=-\frac{s(m)&lt;{\sigma}|v|&gt;[y^2-Y_{eq}^2]}{x^2 H(m)}.$$</span></p>
<p>The equation is attached (Mathematica Codes):</p>
<p>ClearAll[&quot;Global`<em>&quot;];
m = 1000;
sigmav = 0.0000000001;
gstar = 106;
mpl = 2.4</em>10^18,
Sm = (2 pi^2)/45<em>gstar</em>m^3;
Hm = 1.67*[gstar]^(1/2)<em>m^2/mpl;
Yeq[x_] = 0.145</em>x^(3/2)*Exp[-x];</p>
<p>(<em>s1=LogLogPlot[0.145</em>x^(3/2)<em>Exp[-x],{x,3,1000},PlotRange[Rule]All,<br />
Frame[Rule]True,PlotStyle[Rule]Thick];</em>)
s2 = NDSolve[{Y'[x] ==
x^-2<em>Sm/Hm</em>sigmav*(Y[x]^2 - (0.145*x^(3/2)*Exp[-x])^2),
Y<a href="https://i.sstatic.net/9zSBY.jpg" rel="nofollow noreferrer">1</a> == Yeq<a href="https://i.sstatic.net/9zSBY.jpg" rel="nofollow noreferrer">1</a>}, Y, {x, 1, 1000}];
LogLogPlot[{Evaluate[Y[x] /. s2], Yeq[x]}, {x, 1, 1000},
PlotRange -&gt; All, AxesLabel -&gt; Automatic, Frame -&gt; True]</p>
<p>These results are derived using the help of &quot;[The Early Universe][4]&quot; by Kolb and Turner</p>
<p><strong>Question:</strong> How to plot the freeze-out equation for massive particle species in Mathematica?</p>

CC BY-SA 4.0
2023-05-22T02:13:15.057Z
@ProfRob I've adjusted the wording to make the question clearer (I hope!)
uhoh
CC BY-SA 4.0
2023-05-22T02:14:19.670Z
@TrinayanSaikia *Welcome to Astronomy Stack Exchange!* I've made some small edits to help your question fit the site's format better, please check it and feel free to edit further. *Thanks!* Also, when we include figures we need to credit the source - is the plot you show from  Kolb and Turner?
uhoh
CC BY-SA 4.0
2023-05-22T07:13:24.880Z
I’m voting to close this question because this is  question about [mathematica.se], not astronomy.
StephenG - Help Ukraine
CC BY-SA 4.0
2023-05-22T07:36:28.903Z
As this is purely a programming question, the main, SO, site might be appropriate.
planetmaker
CC BY-SA 4.0
2023-05-22T08:34:04.973Z
Hi @TrinayanSaikia some folks think that you have everything here to make the plot except Mathematica skills. I'm not sure they are right. Is your question about how to get some of the results mathematically that you don't yet have, or do you have everything and just need help plotting? *Thanks!*
uhoh
CC BY-SA 4.0
2023-05-22T08:36:29.343Z
@StephenG-HelpUkraine are you *absolutely sure* of that, such that you want to vote to prevent answer posts from being written? What's the rush? Why not give the OP some time to respond. The reopen process is slow; I don't see how a few more days is doing such harm that the insta-close and its resulting answer-blocking is really necessary yet. Instead, why not just *ask the OP* if it's a Mathematica or Astronomy question instead of pre-deciding?
uhoh
CC BY-SA 4.0
2023-05-22T10:04:49.530Z
@uhoh There's surely no ambiguity.  The OP is clearly asking how to duplicate a specific plot in mathematica.  I don't see any astronomy issue.
StephenG - Help Ukraine
CC BY-SA 4.0
2023-05-22T11:00:24.663Z
@StephenG-HelpUkraine new user's first question: what one person sees from a literal reading may not be what the OP actually want's to ask. It's better to give them a chance to respond. It's really disheartening as a new user to have your question closed due to word choice.
uhoh
CC BY-SA 4.0
2023-05-22T15:44:32.643Z
@uhoh Thanks for editing the Question and making it more comfortable to understand. My question is regarding both Mathematica and Astronomy. I want to study the freeze out of various species manipulating the masses and their thermally averaged interaction cross-section. This plot essentially helps as an initial basis but i have no prior knowledge about plotting in Mathematica. This is an assignment of our Physics course and I am stuck at this position. can you please help?
Trinayan Saikia
CC BY-SA 4.0
2023-05-22T15:45:58.027Z
@StephenG-HelpUkraine Thanks for waiting so much time and not closing the question at first glance. As per my viewpoint I see this question as in for astronomy and Mathematica both.
Trinayan Saikia
CC BY-SA 4.0
2023-05-22T21:55:33.383Z
@TrinayanSaikia okay got it, so then I think you need to split this up into two different questions, one for each site. I see you have also cross-posted the same question in Mathematica, cross-posting is strongly discouraged, but asking two simultaneous and related about two different *aspects* of a question on two sites is perfectly fine - each question should link to the other. Also, while "do my homework for me" questions are not welcome in Stack Exchange, showing *what you've tried so far* and asking for guidance and suggestions how to get past where you are stuck is always welcome.
uhoh
CC BY-SA 4.0
2023-05-22T22:01:49.150Z
So for plotting, you might not be ready for the Mathematica SE question yet. In that case you can click "delete" under your question there and it will disappear from view from others. You can still find it under your "deleted questions" when you are ready to revive it later. But it needs to have two things 1) the explicit equations you want to plot - ideally written out in [MathJax](https://math.meta.stackexchange.com/q/5020/284619) not a white board photo, and 2) your first attempt at writing Mathematica code. Even if it doesn't work, you'll need to make some progress first - show your work.
uhoh
CC BY-SA 4.0
2023-05-22T22:03:35.197Z
you can get some help/ideas at https://www.wolframalpha.com/ BUT Mathematica SE does not allow questions *about* Wolfram Alpha. So I think you should either quickly modify that question to include 1) and 2) or temporarily delete it with the "delete" button and then "undelete" when you are read, or ask a new question there. For your question here, remove all reference to Mathematica. Just ask the Astronomy aspect of your question. I can't tell - do you believe you have all the equations you need to make the plot? Or maybe you think they are on the white board but you don't fully understand...
uhoh
CC BY-SA 4.0
2023-05-22T22:07:10.743Z
...how to use them? If so THAT can be your Astronomy SE question. "I see all these equations but I need help getting them in the proper form to make a plot like this." It sounds like a lot of work, but it also sounds like your assignment is not simple! Stack Exchange won't do your homework for you, but it will *help* if you show your effort and explain the point where you get stuck. So please take action on both posts, make them different and in each one add a link to the other one. That will help. *Thanks!*
uhoh
CC BY-SA 4.0
2023-05-22T22:17:02.480Z
It currently takes (AFAIK) 5 votes to close a question on Astronomy SE (only 3 on Physics SE by the way) so there's usually plenty of time for someone to change their question to meet objects.  I did also explain my close vote (and members do not have to explain their votes, BTW), and I don't (at this time) see any great improvement.  You need to edit the question to update it, not just comment.  Comments are not considered permanent on SE and can be deleted or purged at any time.
StephenG - Help Ukraine
<astrophysics><cosmology><density>
How to plot the freeze out equation for massive particle species in Mathematica?
Trinayan Saikia
# How to plot the freeze out equation for massive particle species in Mathematica?

(Asked by: username_0 on 2023-05-21)

I want to recreate the figure [![Freeze out of massive particle species](https://i.sstatic.net/9zSBY.jpg)](https://i.sstatic.net/9zSBY.jpg). This comes from the Cosmological Boltzmann equation which can be modified as the number density equation as

$$\frac{dY}{dx}=-\frac{s(m)<{\sigma}|v|>[y^2-Y\_{eq}^2]}{x^2 H(m)}.$$

The equation is attached (Mathematica Codes):

ClearAll["Global`*"];
m = 1000;
sigmav = 0.0000000001;
gstar = 106;
mpl = 2.4*10^18,
Sm = (2 pi^2)/45*gstar*m^3;
Hm = 1.67\*[gstar]^(1/2)*m^2/mpl;
Yeq[x\_] = 0.145*x^(3/2)\*Exp[-x];

(*s1=LogLogPlot[0.145*x^(3/2)*Exp[-x],{x,3,1000},PlotRange[Rule]All,  
Frame[Rule]True,PlotStyle[Rule]Thick];*)
s2 = NDSolve[{Y'[x] ==
x^-2*Sm/Hm*sigmav\*(Y[x]^2 - (0.145\*x^(3/2)\*Exp[-x])^2),
Y[1](https://i.sstatic.net/9zSBY.jpg) == Yeq[1](https://i.sstatic.net/9zSBY.jpg)}, Y, {x, 1, 1000}];
LogLogPlot[{Evaluate[Y[x] /. s2], Yeq[x]}, {x, 1, 1000},
PlotRange -> All, AxesLabel -> Automatic, Frame -> True]

These results are derived using the help of "[The Early Universe][4]" by Kolb and Turner

**Question:** How to plot the freeze-out equation for massive particle species in Mathematica?

**Tags:** astrophysics, cosmology, density

> **Comments:**
> **username_1**: @ProfRob I've adjusted the wording to make the question clearer (I hope!)  
> **username_1**: @TrinayanSaikia *Welcome to Astronomy Stack Exchange!* I've made some small edits to help your question fit the site's format better, please check it and feel free to edit further. *Thanks!* Also, when we include figures we need to credit the source - is the plot you show from  Kolb and Turner?  
> **username_2**: I’m voting to close this question because this is  question about [mathematica.se], not astronomy.  
> **username_3**: As this is purely a programming question, the main, SO, site might be appropriate.  
> **username_1**: Hi @TrinayanSaikia some folks think that you have everything here to make the plot except Mathematica skills. I'm not sure they are right. Is your question about how to get some of the results mathematically that you don't yet have, or do you have everything and just need help plotting? *Thanks!*  
> **username_1**: @StephenG-HelpUkraine are you *absolutely sure* of that, such that you want to vote to prevent answer posts from being written? What's the rush? Why not give the OP some time to respond. The reopen process is slow; I don't see how a few more days is doing such harm that the insta-close and its resulting answer-blocking is really necessary yet. Instead, why not just *ask the OP* if it's a Mathematica or Astronomy question instead of pre-deciding?  
> **username_2**: @username_1 There's surely no ambiguity.  The OP is clearly asking how to duplicate a specific plot in mathematica.  I don't see any astronomy issue.  
> **username_1**: @StephenG-HelpUkraine new user's first question: what one person sees from a literal reading may not be what the OP actually want's to ask. It's better to give them a chance to respond. It's really disheartening as a new user to have your question closed due to word choice.  
> **username_0**: @username_1 Thanks for editing the Question and making it more comfortable to understand. My question is regarding both Mathematica and Astronomy. I want to study the freeze out of various species manipulating the masses and their thermally averaged interaction cross-section. This plot essentially helps as an initial basis but i have no prior knowledge about plotting in Mathematica. This is an assignment of our Physics course and I am stuck at this position. can you please help?  
> **username_0**: @StephenG-HelpUkraine Thanks for waiting so much time and not closing the question at first glance. As per my viewpoint I see this question as in for astronomy and Mathematica both.  
> **username_1**: @TrinayanSaikia okay got it, so then I think you need to split this up into two different questions, one for each site. I see you have also cross-posted the same question in Mathematica, cross-posting is strongly discouraged, but asking two simultaneous and related about two different *aspects* of a question on two sites is perfectly fine - each question should link to the other. Also, while "do my homework for me" questions are not welcome in Stack Exchange, showing *what you've tried so far* and asking for guidance and suggestions how to get past where you are stuck is always welcome.  
> **username_1**: So for plotting, you might not be ready for the Mathematica SE question yet. In that case you can click "delete" under your question there and it will disappear from view from others. You can still find it under your "deleted questions" when you are ready to revive it later. But it needs to have two things 1) the explicit equations you want to plot - ideally written out in [MathJax](https://math.meta.stackexchange.com/q/5020/284619) not a white board photo, and 2) your first attempt at writing Mathematica code. Even if it doesn't work, you'll need to make some progress first - show your work.  
> **username_1**: you can get some help/ideas at https://www.wolframalpha.com/ BUT Mathematica SE does not allow questions *about* Wolfram Alpha. So I think you should either quickly modify that question to include 1) and 2) or temporarily delete it with the "delete" button and then "undelete" when you are read, or ask a new question there. For your question here, remove all reference to Mathematica. Just ask the Astronomy aspect of your question. I can't tell - do you believe you have all the equations you need to make the plot? Or maybe you think they are on the white board but you don't fully understand...  
> **username_1**: ...how to use them? If so THAT can be your Astronomy SE question. "I see all these equations but I need help getting them in the proper form to make a plot like this." It sounds like a lot of work, but it also sounds like your assignment is not simple! Stack Exchange won't do your homework for you, but it will *help* if you show your effort and explain the point where you get stuck. So please take action on both posts, make them different and in each one add a link to the other one. That will help. *Thanks!*  
> **username_2**: It currently takes (AFAIK) 5 votes to close a question on Astronomy SE (only 3 on Physics SE by the way) so there's usually plenty of time for someone to change their question to meet objects.  I did also explain my close vote (and members do not have to explain their votes, BTW), and I don't (at this time) see any great improvement.  You need to edit the question to update it, not just comment.  Comments are not considered permanent on SE and can be deleted or purged at any time.  

---

## 0 answers

