ataddmpolecomppoly
PURPOSE
ataddmpolecomppoly adds a multipole component to an existing polynomial,
SYNOPSIS
function [PolynomOut] = ataddmpolecomppoly(Polynom,refindex,newindex,strength,radius,varargin)
DESCRIPTION
CROSS-REFERENCE INFORMATION
This function calls:
This function is called by:
- ataddmpoleerrors ataddrandmpole adds a random multipole component to all elements of type
- atloadfielderrs ATLOADFIELDERRS will load a field error structure into a ring
SOURCE CODE
0001 function [PolynomOut] = ataddmpolecomppoly(Polynom,refindex,newindex,strength,radius,varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 if (Polynom(refindex)==0)
0016 if nargin==5
0017 error('reference polynomial value is 0');
0018 else
0019 refvalue=varargin{1};
0020 end
0021
0022 else
0023
0024 refvalue = Polynom(refindex);
0025 end
0026
0027
0028 if(newindex > length(Polynom))
0029 PolynomOut=[Polynom zeros(1,newindex-length(Polynom))];
0030 else
0031 PolynomOut=Polynom;
0032 end
0033
0034
0035 val=power(radius,newindex-refindex)*strength/refvalue;
0036 PolynomOut(newindex)=PolynomOut(newindex)+val;
0037 end
Generated on Thu 24-Aug-2017 18:47:33 by m2html © 2005