Question about g

23 views
Skip to first unread message

Aleh Sudakou

unread,
Mar 27, 2024, 9:33:21 AM3/27/24
to mcx-users
Dear Dr. Qianqian Fang,

Could you please clarify what happens when the optional variable "gscatter" is set to its default -1 value? (The maximum allowed number is 1e9)
Does -1 mean the g value is always ignored or never ignored?

"gscatter" is briefly explained in Section 1.7:

Thanks!
Best wishes,
Aleh Sudakou

Qianqian Fang

unread,
Mar 28, 2024, 12:46:38 PM3/28/24
to mcx-...@googlegroups.com, Aleh Sudakou

hi Aleh,

there is a typo in the help page - the default value of gscatter is 1e9. it has been fixed.

it's restriction should be "can not be negative". this is because gscatter is defined as an "unsigned int", see source code here

https://github.com/fangq/mcx/blob/v2024.2/src/mcx_core.h#L187
https://github.com/fangq/mcx/blob/v2024.2/src/mcx_utils.c#L335

if you accidentally set g as -1 (0xFFFFFFFF), it is actually going to set the unsigned value to 0xFFFFFFFF=2^32=4.295e9, which is even higher than 1e9.

you can try it in the mcxlab examples, set cfg.gscatter=-1 and see the printed value.


either 1e9 or -1 won't ignore g, rather strictly following g in all scattering events.

if you want to ignore it, you should set gscatter to 0. This will completely ignore g, and use mus' = mus*(1-g) for all scattering events.

let me know if this makes sense to you.

Qianqian

--
You received this message because you are subscribed to the Google Groups "mcx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mcx-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mcx-users/67e6ceb7-52a2-4c7c-979e-745d2f457d00n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages