OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
TrimCoilFit.h
Go to the documentation of this file.
1//
2// Class TrimCoilFit
3// Abstract TrimCoilFit class
4// General rational function fit
5//
6// Copyright (c) 2018 - 2019, Jochem Snuverink, Paul Scherrer Institut, Villigen PSI, Switzerland
7// All rights reserved
8//
9// Implemented as part of the PhD thesis
10// "Precise Simulations of Multibunches in High Intensity Cyclotrons"
11// and the paper
12// "Matching of turn pattern measurements for cyclotrons using multiobjective optimization"
13// (https://doi.org/10.1103/PhysRevAccelBeams.22.064602)
14//
15// This file is part of OPAL.
16//
17// OPAL is free software: you can redistribute it and/or modify
18// it under the terms of the GNU General Public License as published by
19// the Free Software Foundation, either version 3 of the License, or
20// (at your option) any later version.
21//
22// You should have received a copy of the GNU General Public License
23// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
24//
25#ifndef TRIM_COILFIT_H
26#define TRIM_COILFIT_H
27
28#include "TrimCoils/TrimCoil.h"
29
30#include <vector>
31
32class TrimCoilFit : public TrimCoil {
33
34public:
35 TrimCoilFit(double bmax,
36 double rmin,
37 double rmax,
38 const std::vector<double>& coefnum,
39 const std::vector<double>& coefdenom,
40 const std::vector<double>& coefnumphi,
41 const std::vector<double>& coefdenomphi);
42
43 virtual ~TrimCoilFit() {};
44
45protected:
47 enum FunctionType {RADIUS=0, PHI=2};
48
50 void calculateRationalFunction(FunctionType, double value, double& quot, double& der_quot) const;
52 void calculateRationalFunction(FunctionType, double value, double& quot, double& der_quot, double& der2_quot) const;
53
54private:
55 TrimCoilFit() = delete;
56
58 std::vector<std::vector<double>> coefs;
59};
60
61#endif //TRIM_COILFIT_H
virtual ~TrimCoilFit()
Definition: TrimCoilFit.h:43
void calculateRationalFunction(FunctionType, double value, double &quot, double &der_quot) const
calculate rational function and its first derivative
Definition: TrimCoilFit.cpp:57
std::vector< std::vector< double > > coefs
rational function coefficients
Definition: TrimCoilFit.h:58
TrimCoilFit()=delete