Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cosmic_dustbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martin Glatzle
cosmic_dustbox
Commits
fea0677d
Commit
fea0677d
authored
Mar 03, 2019
by
Martin Glatzle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Go to single log normal from double log normal.
parent
11ab45be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
24 deletions
+27
-24
cosmic_dustbox/sdist.py
cosmic_dustbox/sdist.py
+27
-24
No files found.
cosmic_dustbox/sdist.py
View file @
fea0677d
...
...
@@ -171,9 +171,9 @@ class PowerLaw(SizeDist):
return
class
Double
LogNormal
(
SizeDist
):
class
LogNormal
(
SizeDist
):
"""
Sum of two log normal distributions
as in Eq. (2) of [1]_.
Log normal distribution
as in Eq. (2) of [1]_.
References
----------
...
...
@@ -184,28 +184,23 @@ class DoubleLogNormal(SizeDist):
# mass of carbon atom
m_C
=
12.0107
*
_u
.
u
def
B_val
(
i
):
nominator
=
(
3
*
_np
.
exp
(
-
4.5
*
sgma
**
2
)
*
bc
[
i
]
*
m_C
)
denominator
=
(
(
2
*
_np
.
pi
**
2
)
**
1.5
*
rho
*
a0
[
i
]
**
3
*
sgma
*
(
1
+
_erf
((
3
*
sgma
/
_np
.
sqrt
(
2
))
+
(
_np
.
log
((
a0
[
i
]
/
3.5
/
_u
.
angstrom
).
decompose
().
value
)
/
(
sgma
*
_np
.
sqrt
(
2
)))
)
)
nominator
=
(
3
*
_np
.
exp
(
-
4.5
*
sgma
**
2
)
*
bc
*
m_C
)
denominator
=
(
(
2
*
_np
.
pi
**
2
)
**
1.5
*
rho
*
a0
**
3
*
sgma
*
(
1
+
_erf
((
3
*
sgma
/
_np
.
sqrt
(
2
))
+
(
_np
.
log
(
a0
/
3.5
/
_u
.
angstrom
)
/
(
sgma
*
_np
.
sqrt
(
2
)))
)
)
# FIXME: what do we do if the denominator is zero
if
denominator
!=
0
:
B
=
(
nominator
/
denominator
).
decompose
().
value
return
B
_B
=
[
B_val
(
i
)
for
i
in
range
(
2
)]
)
# FIXME: what do we do if the denominator is zero
if
denominator
!=
0
:
B
=
(
nominator
/
denominator
).
decompose
()
def
f
(
a
):
return
sum
([
_B
[
i
]
/
a
*
_np
.
exp
(
-
0.5
*
(
_np
.
log
((
a
/
a0
[
i
]).
decompose
().
value
)
/
sgma
)
**
2
)
for
i
in
range
(
2
)])
return
B
/
a
*
_np
.
exp
(
-
0.5
*
(
_np
.
log
(
a
/
a0
)
/
sgma
)
**
2
)
super
().
__init__
(
sizeMin
,
sizeMax
,
f
)
return
...
...
@@ -273,13 +268,21 @@ def WD01(RV, bc, case):
sizeMin
=
3.5
*
_u
.
angstrom
sizeMax
=
10
*
_u
.
micron
rho
=
2.24
*
_u
.
g
/
_u
.
cm
**
3
s_car
=
DoubleLogNormal
(
s_car
=
LogNormal
(
sizeMin
,
sizeMax
,
rho
,
0.4
,
0.75
*
params
[
2
],
3.5
*
_u
.
angstrom
)
+
\
LogNormal
(
sizeMin
,
sizeMax
,
rho
,
0.4
,
[
0.75
*
params
[
2
],
0.25
*
params
[
2
]
],
[
3.5
*
_u
.
angstrom
,
30
*
_u
.
angstrom
]
0.25
*
params
[
2
],
30
*
_u
.
angstrom
)
l_car
=
WD01ExpCutoff
(
sizeMin
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment