6 \section{Arbitrary Order, Arbitrary Dimensional Polynomial Solve With Smoothing}
8 \emph{Chris Rogers, STFC Rutherford Appleton Laboratory, 2015}
10 Below I outline the mathematical foundation
for higher order polynomial solving.
12 \subsection{Generalised Indexing
and Notation}
14 The polynomial
solve is a quite straightforward consequence of a simultaneous
15 equation
solve. The only really tricky thing
is one of notation. For a
16 polynomial in higher dimensional space, we have
to be quite careful how things
17 are indexed. For
example, consider the generalised quadratic polynomial in two
21 y = a_{00} + a_{10} x_0 + a_{01} x_1 + a_{11} x_0 x_1 + a_{20} x_0^2 + a_{02} x_1^2
24 The polynomial coefficients $a_{jk}$ have been indexed by the power
on the
25 corresponding products of
$x_i$. Explicitly,
28 y = a_{00} x_0^0 x_1^0 + a_{10} x_0^1 x_1^0 + a_{01} x_0^0 x_1^1 + a_{11} x_0^1 x_1^1 + a_{20} x_0^2 x_1^0 + a_{02} x_0^0 x_1^2
32 \emph{index by power}. Occasionally we also use the concept
of \emph{index by
33 vector}. In
this indexing scheme, we index the $i$ in the product of
$x_i$,
so
37 y = b+ b_{0} x_0 + b_{1} x_1 + b_{01} x_0 x_1 + b_{00} x_0 x_0 + b_{11} x_1
x_1
40 Conventionally, a quadratic equation in higher dimension
is one in which the
sum
41 of the powers $<=$ 2, i.e. the
sum of \emph{index by power} $<=$ 2
and the
42 length
of \emph{index by vector} $<=$ 2.
44 For reasons discussed
below, in
this note a polynomial of order $i$ will be one
45 in which no term
in \emph{index by power}
is more than $i$,
or equivalently no
46 integer
in \emph{index by vector}
is repeated more than $i$ times.
48 The coefficients $a_{00}, a_{01}, \ldots$ can be written in shorthand as
49 $a_{\vec{p}}$
where $\vec{p}$
is a vector of integers as discussed
above.
51 This notation can also be used
to extend
to derivatives. Consider the
derivative
53 \frac{\partial^ny_i}{\partial x_0^{q_0} \partial x_1^{q_1} \ldots}
55 which can be written in shorthand
as
60 \subsection{Polynomial Solve with no Smoothing}
61 Consider a polynomial in variables $\vec{x} = x_0, x_1, \ldots x_n$ such
that
63 \vec{y}(x) = \sum_{\vec{p}} a_{\vec{p}}
\prod^{j=
n}_{j=1} x_j^{p_j}
65 If we have a
set of known values $\vec{y}_{\vec{b}}(\vec{x}_{\vec{b}}$ at some
66 known positions $\vec{x}_{\vec{b}}$
e.g.
on a rectangular grid; then we can
67 solve for $a_{\vec{p}}$ in the usual
way as a linear
system of simultaneous
71 \vec{y}_{\vec{b}}(\vec{x}_{\vec{b}}) = \sum_{\vec{p}} a_{\vec{p}}
\prod^{j=
n}_{j=1} x_{b_j}^{p_j}
73 where the measured values
to be fitted, $\vec{y}_{\vec{b}}$ are known, the
74 positions at which those values were measured, $\vec{x}$, are known but the
75 polynomial coefficients $a_{\vec{p}}$ are
not known.
77 This can be written as a
system of linear equations
like
79 \vec{G} = \mathbf{H} \vec{A}
82 where $\vec{G}$
is the vector of $\vec{y}_{\vec{b}}$, $\vec{a}$
is the vector of
83 $a_{\vec{p}}$
and $\mathbf{H}$
is the matrix of $
\prod x_{b_j}^{p_j}$.
85 In order
for the polynomial fit
to be successful, $\mathbf{H}$ must be invertible,
86 so the points $\vec{x}_{\vec{b}}$ need
to be chosen carefully. Otherwise no
87 presumption has been made
on the dimension
or order of the fit.
89 \subsection{Polynomial Solve with Smoothing}
90 Derivatives of the polynomial may be known, in which
case they can be used in
93 Consider the measured derivatives
94 $\vec{y}_{\vec{b}}^{(\vec{q})}(\
vec{x}_{\vec{b}})$. Then
96 y^{\vec{q}}_{\vec{b}} = \sum_{\vec{p}} a_{\vec{p}}
97 \prod^j \frac{p_j!}{(p_j-q_j)!} \
vec{x}_{\vec{b}}^{(p_j-q_j)}
99 The simultaneous equation can then be reformulated
as
101 \vec{G
'} = \mathbf{H'} \vec{A}
103 where $\vec{G
'}$ is the vector of $y^{\vec{p}}$ and $y^{(\vec{q})}$; $\mathbf{H'}$
104 is the matrix of $
\prod x_{b_j}^{p_j}$
and $
\prod p_j!/(p_j-q_j)! x_{b_j}^{p_j-q_j}$
106 In order
for the polynomial fit
to be successful, $\mathbf{H
'}$ must be
110 In this note, no attempt is made to demonstrate that a given set of points
111 result in an invertible matrix. This is found empirically. So there may be a set
112 of pathological cases that break the fitting.
114 Boundary conditions can be an issue. At the moment, boundary condition is taken
115 as derivative is zero.
119 b mention the algorithm in the References section The appropriate citation Luís and Manuel López Ibáñez An improved dimension sweep algorithm for the hypervolume indicator In IEEE Congress on Evolutionary July as a personal note
void solve(double *Matrix, double *Solution, double *rightHandSide, const int &M, const int &N)
we have to be quite careful how things are indexed For example
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is and will automatically terminate your rights under this License parties who have received or from you under this License will not have their licenses terminated so long as such parties remain in full compliance You are not required to accept this since you have not signed it nothing else grants you permission to modify or distribute the Program or its derivative works These actions are prohibited by law if you do not accept this License by modifying or distributing the you indicate your acceptance of this License to do and all its terms and conditions for distributing or modifying the Program or works based on it Each time you redistribute the the recipient automatically receives a license from the original licensor to distribute or modify the Program subject to these terms and conditions You may not impose any further restrictions on the recipients exercise of the rights granted herein You are not responsible for enforcing compliance by third parties to this License If
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
and give any other recipients of the Program a copy of this License along with the Program You may charge a fee for the physical act of transferring a and you may at your option offer warranty protection in exchange for a fee You may modify your copy or copies of the Program or any portion of thus forming a work based on the and copy and distribute such modifications or work under the terms of Section provided that you also meet all of these that in whole or in part contains or is derived from the Program or any part to be licensed as a whole at no charge to all third parties under the terms of this License c If the modified program normally reads commands interactively when you must cause when started running for such interactive use in the most ordinary way
b Accompany it with a written valid for at least three to give any third for a charge no more than your cost of physically performing source a complete machine readable copy of the corresponding source code
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is and will automatically terminate your rights under this License parties who have received or from you under this License will not have their licenses terminated so long as such parties remain in full compliance You are not required to accept this since you have not signed it nothing else grants you permission to modify or distribute the Program or its derivative works These actions are prohibited by law if you do not accept this License by modifying or distributing the you indicate your acceptance of this License to do so
clearpage the user may choose between constant or variable radius This model includes fringe fields begin
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that they
we have to be quite careful how things are indexed For consider the generalised quadratic polynomial in two dimensions this is termed we index the $i in the product of $x_i
the intent is to exercise the right to control the distribution of derivative or collective works based on the Program In addition
T::PETE_Expr_t::PETE_Return_t sum(const PETE_Expr< T > &expr)
T::PETE_Expr_t::PETE_Return_t prod(const PETE_Expr< T > &expr)
set(_SRCS Action.cpp Attribute.cpp AttributeBase.cpp AttributeHandler.cpp BeamSequence.cpp Definition.cpp Directory.cpp Element.cpp Invalidator.cpp OpalData.cpp Object.cpp ObjectFunction.cpp PlaceRep.cpp RangeRep.cpp Table.cpp TableRowRep.cpp ValueDefinition.cpp) include_directories($
and give any other recipients of the Program a copy of this License along with the Program You may charge a fee for the physical act of transferring a and you may at your option offer warranty protection in exchange for a fee You may modify your copy or copies of the Program or any portion of thus forming a work based on the and copy and distribute such modifications or work under the terms of Section above
we have to be quite careful how things are indexed For consider the generalised quadratic polynomial in two dimensions this is termed emph
PETE_TTTree< OpWhere, typename Cond_t::PETE_Expr_t, typename True_t::PETE_Expr_t, PETE_Scalar< Vektor< T, Dim > > > where(const PETE_Expr< Cond_t > &c, const PETE_Expr< True_t > &t, const Vektor< T, Dim > &f)
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details IMPORTANT which obligates you to give appropriate credit!If you write a scientific paper describing research that made substantive use of this it is your obligation as a scientist to(a) mention the fashion in which this software was used in the Methods section
b mention the algorithm in the References section The appropriate citation is
bool eq(double x, double y)
constexpr double e
The value of .
this section has the sole purpose of protecting the integrity of the free software distribution system
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The below
GNU GENERAL PUBLIC LICENSE June Free Software Inc Temple MA USA Everyone is permitted to copy and distribute verbatim copies of this license document
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed on