intval_yp

PURPOSE ^

SYNOPSIS ^

function [varargout] = intval_yp(fit,theta0,theta,a0,an,bn,da0drho,dandrho,dbndrho)

DESCRIPTION ^

 Calculate the local interpolated value at any poloidal angle position and
 radial position of the integral of X and dXdrho (for the phase of the
 plasma fluctations)

 INPUT
    - fit: interpolated structure
    - theta0: initial poloidal angle value (rad) [1,1]
    - theta: poloidal angle value (rad) [1,1]
    - a0,an,bn: Fourier expansion coefficients
    - da0drho,dandrho,dbndrho: 1st order radial derivatives of the Fourier expansion coefficients

 OUTPUT: 
    - int02theta_X: value of the integral of X from 0 to theta at position (rho,theta) [1,1]
    - int02theta_dXdrho:: value of the integral dXdrho from 0 to theta at position (rho,theta) [1,1]

 By Yves Peysson (CEA-DRFC, yves.peysson@cea.fr) and Joan Decker (CEA-DRFC, joan.decker@cea.fr)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [varargout] = intval_yp(fit,theta0,theta,a0,an,bn,da0drho,dandrho,dbndrho)
0002 %
0003 % Calculate the local interpolated value at any poloidal angle position and
0004 % radial position of the integral of X and dXdrho (for the phase of the
0005 % plasma fluctations)
0006 %
0007 % INPUT
0008 %    - fit: interpolated structure
0009 %    - theta0: initial poloidal angle value (rad) [1,1]
0010 %    - theta: poloidal angle value (rad) [1,1]
0011 %    - a0,an,bn: Fourier expansion coefficients
0012 %    - da0drho,dandrho,dbndrho: 1st order radial derivatives of the Fourier expansion coefficients
0013 %
0014 % OUTPUT:
0015 %    - int02theta_X: value of the integral of X from 0 to theta at position (rho,theta) [1,1]
0016 %    - int02theta_dXdrho:: value of the integral dXdrho from 0 to theta at position (rho,theta) [1,1]
0017 %
0018 % By Yves Peysson (CEA-DRFC, yves.peysson@cea.fr) and Joan Decker (CEA-DRFC, joan.decker@cea.fr)
0019 %
0020 if isfield(fit,'x_fit'), fit = fit.x_fit;end%backward compatibility with equilfit_yp
0021 %
0022 if nargin ~= 9 & nargin ~= 6,error('Wrong number of input arguments in intval_yp.m');end
0023 %
0024 if size(an,2) ~= size(fit.n,1), an = an.';end
0025 if size(bn,2) ~= size(fit.n,1), bn = bn.';end 
0026 %
0027 if nargin == 9,
0028     if size(dandrho,2) ~= size(fit.n,1), dandrho = dandrho.';end
0029     if size(dbndrho,2) ~= size(fit.n,1), dbndrho = dbndrho.';end 
0030 end
0031 %
0032 n = fit.n;
0033 %
0034 int02theta_X = a0*(theta - theta0) + (an./n')*(sin(n*theta) - sin(n*theta0)) + (bn./n')*(cos(n*theta0) - cos(n*theta));
0035 %
0036 if nargin == 9,
0037     if ~isempty(da0drho) & ~isempty(dandrho) & ~isempty(dbndrho),
0038         int02theta_dXdrho = da0drho*(theta - theta0) + (dandrho./n')*(sin(n*theta) - sin(n*theta0)) + (dbndrho./n')*(cos(n*theta0) - cos(n*theta));
0039     else
0040         int02theta_dXdrho = [];
0041     end
0042 end
0043 %
0044 if nargout >= 1, varargout{1} = int02theta_X;end
0045 if nargout >= 2, varargout{2} = int02theta_dXdrho;end
0046

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.