# The deviation of diffusion coefficients each run

**URL:** <https://root-forum.cern.ch/t/the-deviation-of-diffusion-coefficients-each-run/57415>\
**Category:** Garfield++\
**Created:** [December 6, 2023, 8:26am UTC](https://root-forum.cern.ch/t/the-deviation-of-diffusion-coefficients-each-run/57415 "2023-12-06T08:26:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiangjc-github](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jiangjc-github/32/27278_2.png) [@jiangjc-github](https://root-forum.cern.ch/u/jiangjc-github)\
**Post date:** [December 6, 2023, 8:26am UTC](https://root-forum.cern.ch/t/the-deviation-of-diffusion-coefficients-each-run/57415/1 "2023-12-06T08:26:06Z")

</div>

@hschindl  
Hi hschindl, in Garfield examples, the diffusion coefficients can be obtained from the scripts “~/garfiledpp/Examples/Gasfile/generate.C”, however, I found small difference of the diffusion coefficients （~2%）each run. I‘m not sure whether it depends on the statistic of electrons or number of collisions?  
Because the deviation of ~2% is higher than the impact of other factors (e.g. magnet) we preferred to compared, is there any ways to suppress it (input some other codes)?  
Thank you very much for help.

Best regards,  
Jiechen

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [December 6, 2023, 8:43am UTC](https://root-forum.cern.ch/t/the-deviation-of-diffusion-coefficients-each-run/57415/2 "2023-12-06T08:43:16Z")

</div>

Hi,  
to reduce the statistical error of the diffusion coefficient (and other transport parameters) calculated by Magboltz, you need to increase the number of collisions.

---

<div class="post-metadata">

**Author:** ![jiangjc-github](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jiangjc-github/32/27278_2.png) [@jiangjc-github](https://root-forum.cern.ch/u/jiangjc-github)\
**Post date:** [December 6, 2023, 11:19am UTC](https://root-forum.cern.ch/t/the-deviation-of-diffusion-coefficients-each-run/57415/3 "2023-12-06T11:19:27Z")

</div>

Dear hschindl,

Thanks for your information,  
Which function should be invoked to modify the number of collisions? Is any example referred?

Modify the value of “ncoll” in the following codes?  
“ const int ncoll = 10;  
// Run Magboltz to generate the gas table.  
gas.GenerateGasTable(ncoll);  
”  
But the description means generation of the gas table.

Thanks for help.

Best regards,  
Jiechen

---

<div class="post-metadata">

**Author:** ![jiangjc-github](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jiangjc-github/32/27278_2.png) [@jiangjc-github](https://root-forum.cern.ch/u/jiangjc-github)\
**Post date:** [December 7, 2023, 2:40am UTC](https://root-forum.cern.ch/t/the-deviation-of-diffusion-coefficients-each-run/57415/5 "2023-12-07T02:40:20Z")

</div>

Dear hschindl,

I check the source files “MediumMagboltz.cc”, the function “GenerateGasTable()” include number of collisions when invoke the function “RunMagboltz()”, so the number of Collisions is multiplication of “ncoll” and 10^(7).  
I’m curious about what is the upper limit of the set value of “ncoll”？

Best regards,  
Jiechen

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [December 7, 2023, 7:07am UTC](https://root-forum.cern.ch/t/the-deviation-of-diffusion-coefficients-each-run/57415/6 "2023-12-07T07:07:52Z")

</div>

I don’t think there is an upper limit, but Magboltz will run for a long time if you set the value too high…

---

<div class="post-metadata">

**Author:** ![jiangjc-github](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jiangjc-github/32/27278_2.png) [@jiangjc-github](https://root-forum.cern.ch/u/jiangjc-github)\
**Post date:** [December 7, 2023, 7:26am UTC](https://root-forum.cern.ch/t/the-deviation-of-diffusion-coefficients-each-run/57415/7 "2023-12-07T07:26:20Z")

</div>

Got it, thank you very much for help.

Best regards,

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [December 21, 2023, 7:27am UTC](https://root-forum.cern.ch/t/the-deviation-of-diffusion-coefficients-each-run/57415/8 "2023-12-21T07:27:12Z")

</div>

Closed on December 21, 2023, 7:27am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
