Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RDStackingProject
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yifan Wang
RDStackingProject
Commits
29f8a6cd
Commit
29f8a6cd
authored
Jul 6, 2020
by
Rayne Liu
Browse files
Options
Downloads
Patches
Plain Diff
Alpha and beta fixed bugs
parent
cca1d9f2
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
code/RDownScriptalphabeta.m
+18
-12
18 additions, 12 deletions
code/RDownScriptalphabeta.m
code/RDownScriptalphabeta.nb
+3600
-336
3600 additions, 336 deletions
code/RDownScriptalphabeta.nb
with
3618 additions
and
348 deletions
code/RDownScriptalphabeta.m
+
18
−
12
View file @
29f8a6cd
...
...
@@ -30,10 +30,10 @@ SetDirectory[rootpath<>"code"];
SetOptions
[
InputNotebook
[]
,
AutoGeneratedPackage
->
Automatic
]
mysxscase
=
"/Users/RayneLiu/Desktop/Research/AEI/Simulations
/SXS/BBH_SKS_d14.3_q1.22_sA_0_0_0.330_sB_0_0_-0.440"
;
tshift
=
0
;
npoints
=
1
00
;
ntones
=
7
;
mysxscase
=
rootpath
<>
"
/SXS/BBH_SKS_d14.3_q1.22_sA_0_0_0.330_sB_0_0_-0.440"
;
tshift
=
19
;
npoints
=
2
00
;
ntones
=
1
;
allspectrum
=
{
x0
,
x1
,
x2
,
x3
,
x4
,
x5
,
x6
,
x7
}
;
spectrum
=
allspectrum
[[
;;
ntones
+
1
]]
;
\[Omega]fact
=
0.1
;
...
...
@@ -41,7 +41,7 @@ spectrum = allspectrum[[;;ntones+1]];
params
=
{
tshift
,
ntones
,
\[Omega]fact
,
\[Tau]fact
}
combinations
=
DeleteCases
[
Tuples
[
Range
[
0
,
ntones
]
,
2
]
,
Alternatives
@@
Subsets
[
Reverse
[
Range
[
0
,
ntones
]]
,
{
2
}]]
combinations
=
DeleteCases
[
Tuples
[
Range
[
1
,
ntones
]
,
2
]
,
Alternatives
@@
Subsets
[
Reverse
[
Range
[
0
,
ntones
]]
,
{
2
}]]
(* Change them accordingly *)
...
...
@@ -138,7 +138,9 @@ ansatz=OvertoneModelV2[ntones,{\[Eta],\[Chi]1,\[Chi]2},t0,"Fit\[Alpha]"->combina
cfit
=
NonlinearModelFit
[
data
,
ansatz
,
spectrum
,
t
]
;
cfitd
=
Transpose
[{
data
[[
All
,
1
]]
,
Normal
[
cfit
]
/.
t
->
data
[[
All
,
1
]]}]
;
comp\[Alpha]s
=
spectrum
/.
cfit
[
"BestFitParameters"
]
;
{{
randomvar1
,
randomvar2
}
,
combinations
[[
k
]]
,
(*ansatz, cfit["BestFitParameters"], comp\[Alpha]s,*)
Re
[
Sqrt
[
comp\[Alpha]s
*
Conjugate
[
comp\[Alpha]s
]]]
,
Mod
[
Arg
[
comp\[Alpha]s
]
,
2
Pi
]
,
{
tshift
,
1
-
EasyMatchT
[
data
,
cfitd
,
t0
,
t0
+
90
]}}
,
{
j
,
npoints
}]
,
{
k
,
Length
[
combinations
]}]
;
mismatchlist
=
{{
randomvar1
,
randomvar2
}
,
combinations
[[
k
]]
,
{
tshift
,
1
-
EasyMatchT
[
data
,
cfitd
,
t0
,
t0
+
90
]}}
;
ampandphs
=
Transpose
[{
Re
[
Sqrt
[
comp\[Alpha]s
*
Conjugate
[
comp\[Alpha]s
]]]
,
Mod
[
Arg
[
comp\[Alpha]s
]
,
2
Pi
]}]
;
Join
[
mismatchlist
,
ampandphs
]
,
{
j
,
npoints
}]
,
{
k
,
Length
[
combinations
]}]
;
tab\[Alpha]\[Beta]s
=
Flatten
[
Table
[
Table
[
randomvar1
=
RandomReal
[{
-
\[Omega]fact
,
\[Omega]fact
}]
;
randomvar2
=
RandomReal
[{
-
\[Tau]fact
,
\[Tau]fact
}]
;
...
...
@@ -146,7 +148,9 @@ ansatz=OvertoneModelV2[ntones,{\[Eta],\[Chi]1,\[Chi]2},t0,"Fit\[Alpha]"->{k},"Fi
cfit
=
NonlinearModelFit
[
data
,
ansatz
,
spectrum
,
t
]
;
cfitd
=
Transpose
[{
data
[[
All
,
1
]]
,
Normal
[
cfit
]
/.
t
->
data
[[
All
,
1
]]}]
;
comp\[Alpha]\[Beta]s
=
spectrum
/.
cfit
[
"BestFitParameters"
]
;
{{
randomvar1
,
randomvar2
}
,
{
k
,
l
}
,
(*ansatz, cfit["BestFitParameters"], comp\[Alpha]\[Beta]s,*)
Re
[
Sqrt
[
comp\[Alpha]\[Beta]s
*
Conjugate
[
comp\[Alpha]\[Beta]s
]]]
,
Mod
[
Arg
[
comp\[Alpha]\[Beta]s
]
,
2
Pi
]
,
{
tshift
,
1
-
EasyMatchT
[
data
,
cfitd
,
t0
,
t0
+
90
]}}
,
{
j
,
npoints
}]
,
{
k
,
Range
[
0
,
ntones
]}
,
{
l
,
Range
[
0
,
ntones
]}]
,
1
]
;
mismatchlist
=
{{
randomvar1
,
randomvar2
}
,
{
k
,
l
}
,
{
tshift
,
1
-
EasyMatchT
[
data
,
cfitd
,
t0
,
t0
+
90
]}}
;
ampandphs
=
Transpose
[{
Re
[
Sqrt
[
comp\[Alpha]\[Beta]s
*
Conjugate
[
comp\[Alpha]\[Beta]s
]]]
,
Mod
[
Arg
[
comp\[Alpha]\[Beta]s
]
,
2
Pi
]}]
;
Join
[
mismatchlist
,
ampandphs
]
,
{
j
,
npoints
}]
,
{
k
,
Range
[
1
,
ntones
]}
,
{
l
,
Range
[
1
,
ntones
]}]
,
1
]
;
tab\[Beta]s
=
Table
[
Table
[
randomvar1
=
RandomReal
[{
-
\[Tau]fact
,
\[Tau]fact
}]
;
randomvar2
=
RandomReal
[{
-
\[Tau]fact
,
\[Tau]fact
}]
;
...
...
@@ -154,13 +158,15 @@ ansatz=OvertoneModelV2[ntones,{\[Eta],\[Chi]1,\[Chi]2},t0,"Fit\[Alpha]"->{},"Fit
cfit
=
NonlinearModelFit
[
data
,
ansatz
,
spectrum
,
t
]
;
cfitd
=
Transpose
[{
data
[[
All
,
1
]]
,
Normal
[
cfit
]
/.
t
->
data
[[
All
,
1
]]}]
;
comp\[Beta]s
=
spectrum
/.
cfit
[
"BestFitParameters"
]
;
{{
randomvar1
,
randomvar2
}
,
combinations
[[
k
]]
,
(*ansatz, cfit["BestFitParameters"], comp\[Beta]s,*)
Re
[
Sqrt
[
comp\[Beta]s
*
Conjugate
[
comp\[Beta]s
]]]
,
Mod
[
Arg
[
comp\[Beta]s
]
,
2
Pi
]
,
{
tshift
,
1
-
EasyMatchT
[
data
,
cfitd
,
t0
,
t0
+
90
]}}
,
{
j
,
npoints
}]
,
{
k
,
Length
[
combinations
]}]
;
mismatchlist
=
{{
randomvar1
,
randomvar2
}
,
combinations
[[
k
]]
,
{
tshift
,
1
-
EasyMatchT
[
data
,
cfitd
,
t0
,
t0
+
90
]}}
;
ampandphs
=
Transpose
[{
Re
[
Sqrt
[
comp\[Beta]s
*
Conjugate
[
comp\[Beta]s
]]]
,
Mod
[
Arg
[
comp\[Beta]s
]
,
2
Pi
]}]
;
Join
[
mismatchlist
,
ampandphs
]
,
{
j
,
npoints
}]
,
{
k
,
Length
[
combinations
]}]
;
Export
[
rootpath
<>
"plots/params.fits"
,
params
]
Export
[
rootpath
<>
"plots/freq_bfitpars_mmatch_as.fits"
,
tab\[Alpha]s
]
Export
[
rootpath
<>
"plots/freq_bfitpars_mmatch_abs.fits"
,
tab\[Alpha]\[Beta]s
]
Export
[
rootpath
<>
"plots/freq_bfitpars_mmatch_bs.fits"
,
tab\[Beta]s
]
Export
[
rootpath
<>
"plots/params
_n="
<>
ToString
[
ntones
]
<>
"
.fits"
,
params
]
Export
[
rootpath
<>
"plots/freq_bfitpars_mmatch_as
_n="
<>
ToString
[
ntones
]
<>
"
.fits"
,
tab\[Alpha]s
]
Export
[
rootpath
<>
"plots/freq_bfitpars_mmatch_abs
_n="
<>
ToString
[
ntones
]
<>
"
.fits"
,
tab\[Alpha]\[Beta]s
]
Export
[
rootpath
<>
"plots/freq_bfitpars_mmatch_bs
_n="
<>
ToString
[
ntones
]
<>
"
.fits"
,
tab\[Beta]s
]
This diff is collapsed.
Click to expand it.
code/RDownScriptalphabeta.nb
+
3600
−
336
View file @
29f8a6cd
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment