Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong distribution in rotational diffusion? #95

Closed
mastrof opened this issue Oct 14, 2024 · 1 comment · Fixed by #97
Closed

Wrong distribution in rotational diffusion? #95

mastrof opened this issue Oct 14, 2024 · 1 comment · Fixed by #97
Labels
bug Something isn't working

Comments

@mastrof
Copy link
Owner

mastrof commented Oct 14, 2024

function rotational_diffusion!(microbe::AbstractMicrobe, model)
dt = model.timestep
D_rot = rotational_diffusivity(microbe)
σ = sqrt(2*D_rot*dt)
θ = rand(abmrng(model), Normal(0,σ))
ϕ = rand(abmrng(model), Arccos())
microbe.vel = rotate(direction(microbe), θ, ϕ)
nothing
end

It probably needs to use the new Isotropic distribution

@mastrof mastrof added the bug Something isn't working label Oct 14, 2024
@mastrof
Copy link
Owner Author

mastrof commented Jan 5, 2025

Actually the correct choice in 3D should be Uniform(-π,π). Dispatch can be implemented so that in 2D only θ is sampled since the second angle is not required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant