view test-data/fitting.in @ 1:b30217097125 draft

planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit 6a07c4caed5ef35f35198d54ebafd7d1d6d60edb
author muon-spectroscopy-computational-project
date Thu, 15 Sep 2022 10:23:28 +0000
parents 64e6816a6727
children
line wrap: on
line source

# A basic test of fitting. We define a single muon with no interactions except
# for a dissipation term, causing an exponential decay. We then fit the rate
# of decay using a single variable g, starting at g=0.1, bounded from 0 to
# positive infinity.
#
# Some target data with added artificial noise is used as the "experiment"
# that we are trying to fit. We expect the decay to go like
#
#    0.5*cos(2*pi*t)*exp(-g*t)
#
# with g our variable, t the time, and pi = 3.1415...
#
# The 0.5 factor appears in front as that's the moment of the muon.
# With the data provided, we expect the fitting to find that g = 3.0

name
    fitting_data
spins
    mu
field
    1.0/muon_gyr
fitting_data
    load("fitting_input.dat")
fitting_variables
    g 0.1 0.0 inf
dissipation 1
    g