Mercurial > repos > muon-spectroscopy-computational-project > muspinsim
annotate test-data/fitting.in @ 4:8af5948994b0 draft default tip
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit 389608650050596b28bc0c055de9f98c513a6f65
author | muon-spectroscopy-computational-project |
---|---|
date | Thu, 18 Jul 2024 09:07:13 +0000 |
parents | 64e6816a6727 |
children |
rev | line source |
---|---|
0
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
1 # A basic test of fitting. We define a single muon with no interactions except |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
2 # for a dissipation term, causing an exponential decay. We then fit the rate |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
3 # of decay using a single variable g, starting at g=0.1, bounded from 0 to |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
4 # positive infinity. |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
5 # |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
6 # Some target data with added artificial noise is used as the "experiment" |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
7 # that we are trying to fit. We expect the decay to go like |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
8 # |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
9 # 0.5*cos(2*pi*t)*exp(-g*t) |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
10 # |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
11 # with g our variable, t the time, and pi = 3.1415... |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
12 # |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
13 # The 0.5 factor appears in front as that's the moment of the muon. |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
14 # With the data provided, we expect the fitting to find that g = 3.0 |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
15 |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
16 name |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
17 fitting_data |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
18 spins |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
19 mu |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
20 field |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
21 1.0/muon_gyr |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
22 fitting_data |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
23 load("fitting_input.dat") |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
24 fitting_variables |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
25 g 0.1 0.0 inf |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
26 dissipation 1 |
64e6816a6727
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff
changeset
|
27 g |