0001 function [Zpp_f] = interpequilpt_yp(method,f,rho,theta,nharm)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 if nargin == 3,
0023
0024 if isvector(f),f = f(:)';end
0025 Zpp_f.pp_f = ppinterp_yp(rho(:),f',size(f'),method);
0026
0027 if ~isfield(Zpp_f.pp_f,'orient'),
0028 Zpp_f.pp_f.orient = 'first';
0029 end
0030
0031 Zpp_f.pp_dfdrho = Zpp_f.pp_f;
0032 Zpp_f.pp_d2fdrho2 = Zpp_f.pp_f;
0033
0034 if Zpp_f.pp_f.order == 2,
0035 Zpp_f.pp_dfdrho.coefs = [Zpp_f.pp_f.coefs(:,1)];
0036 Zpp_f.pp_d2fdrho2.coefs = zeros(size([Zpp_f.pp_f.coefs(:,1)]));
0037 elseif Zpp_f.pp_f.order == 3,
0038 Zpp_f.pp_dfdrho.coefs = [2*Zpp_f.pp_f.coefs(:,1),Zpp_f.pp_f.coefs(:,2)];
0039 Zpp_f.pp_d2fdrho2.coefs = [2*Zpp_f.pp_f.coefs(:,1)];
0040 elseif Zpp_f.pp_f.order == 4,
0041 Zpp_f.pp_dfdrho.coefs = [3*Zpp_f.pp_f.coefs(:,1),2*Zpp_f.pp_f.coefs(:,2),Zpp_f.pp_f.coefs(:,3)];
0042 Zpp_f.pp_d2fdrho2.coefs = [6*Zpp_f.pp_f.coefs(:,1),2*Zpp_f.pp_f.coefs(:,2)];
0043 end
0044
0045 Zpp_f.pp_dfdrho.order = Zpp_f.pp_f.order - 1;
0046 Zpp_f.pp_d2fdrho2.order = Zpp_f.pp_f.order - 2;
0047
0048 elseif nargin >= 4,
0049 if min(size(f)) == 1, error('Matrix dimensions do not agree !');end
0050 rho = rho(:);
0051 theta = theta(:);
0052
0053 if nargin == 4,nharm = length(theta)-1;end
0054
0055 if nargin == 5 & nharm > length(theta)-1,
0056
0057
0058 end
0059
0060 if nargin == 5 & isempty(nharm),
0061 nharm = length(theta)-1;
0062 end
0063
0064 FScoef = zeros(size(f,1),2*nharm + 1);
0065 for ii = 1:size(f,1),
0066 FSfun = fscreate(theta,f(ii,:),nharm,'foh');
0067 FScoef(ii,:) = FSfun('coef');
0068 end
0069
0070 Zpp_f.n = [1:nharm]';
0071
0072 a0 = FScoef(:,nharm+1);
0073 an = 2*real(FScoef(:,[nharm+2:end]));
0074 bn = -2*imag(FScoef(:,[nharm+2:end]));
0075
0076 Zpp_f.pp_a0 = ppinterp_yp(rho,a0,size(a0),method);
0077 Zpp_f.pp_an = ppinterp_yp(rho,an,size(an),method);
0078 Zpp_f.pp_bn = ppinterp_yp(rho,bn,size(bn),method);
0079
0080 if ~isfield(Zpp_f.pp_a0,'orient'),
0081 Zpp_f.pp_a0.orient = 'first';
0082 Zpp_f.pp_an.orient = 'first';
0083 Zpp_f.pp_bn.orient = 'first';
0084 end
0085
0086 Zpp_f.pp_da0drho = Zpp_f.pp_a0;
0087 Zpp_f.pp_dandrho = Zpp_f.pp_an;
0088 Zpp_f.pp_dbndrho = Zpp_f.pp_bn;
0089 Zpp_f.pp_d2a0drho2 = Zpp_f.pp_a0;
0090 Zpp_f.pp_d2andrho2 = Zpp_f.pp_an;
0091 Zpp_f.pp_d2bndrho2 = Zpp_f.pp_bn;
0092
0093 if Zpp_f.pp_a0.order == 2,
0094 Zpp_f.pp_da0drho.coefs = [Zpp_f.pp_a0.coefs(:,1)];
0095 Zpp_f.pp_dandrho.coefs = [Zpp_f.pp_an.coefs(:,1)];
0096 Zpp_f.pp_dbndrho.coefs = [Zpp_f.pp_bn.coefs(:,1)];
0097 Zpp_f.pp_d2a0drho2.coefs = zeros(size([Zpp_f.pp_a0.coefs(:,1)]));
0098 Zpp_f.pp_d2andrho2.coefs = zeros(size([Zpp_f.pp_an.coefs(:,1)]));
0099 Zpp_f.pp_d2bndrho2.coefs = zeros(size([Zpp_f.pp_bn.coefs(:,1)]));
0100 elseif Zpp_f.pp_a0.order == 3,
0101 Zpp_f.pp_da0drho.coefs = [2*Zpp_f.pp_a0.coefs(:,1),Zpp_f.pp_a0.coefs(:,2)];
0102 Zpp_f.pp_dandrho.coefs = [2*Zpp_f.pp_an.coefs(:,1),Zpp_f.pp_an.coefs(:,2)];
0103 Zpp_f.pp_dbndrho.coefs = [2*Zpp_f.pp_bn.coefs(:,1),Zpp_f.pp_bn.coefs(:,2)];
0104 Zpp_f.pp_d2a0drho2.coefs = [2*Zpp_f.pp_a0.coefs(:,1)];
0105 Zpp_f.pp_d2andrho2.coefs = [2*Zpp_f.pp_an.coefs(:,1)];
0106 Zpp_f.pp_d2bndrho2.coefs = [2*Zpp_f.pp_bn.coefs(:,1)];
0107 elseif Zpp_f.pp_a0.order == 4,
0108 Zpp_f.pp_da0drho.coefs = [3*Zpp_f.pp_a0.coefs(:,1),2*Zpp_f.pp_a0.coefs(:,2),Zpp_f.pp_a0.coefs(:,3)];
0109 Zpp_f.pp_dandrho.coefs = [3*Zpp_f.pp_an.coefs(:,1),2*Zpp_f.pp_an.coefs(:,2),Zpp_f.pp_an.coefs(:,3)];
0110 Zpp_f.pp_dbndrho.coefs = [3*Zpp_f.pp_bn.coefs(:,1),2*Zpp_f.pp_bn.coefs(:,2),Zpp_f.pp_bn.coefs(:,3)];
0111 Zpp_f.pp_d2a0drho2.coefs = [6*Zpp_f.pp_a0.coefs(:,1),2*Zpp_f.pp_a0.coefs(:,2)];
0112 Zpp_f.pp_d2andrho2.coefs = [6*Zpp_f.pp_an.coefs(:,1),2*Zpp_f.pp_an.coefs(:,2)];
0113 Zpp_f.pp_d2bndrho2.coefs = [6*Zpp_f.pp_bn.coefs(:,1),2*Zpp_f.pp_bn.coefs(:,2)];
0114 end
0115
0116 Zpp_f.pp_da0drho.order = Zpp_f.pp_a0.order - 1;
0117 Zpp_f.pp_dandrho.order = Zpp_f.pp_an.order - 1;
0118 Zpp_f.pp_dbndrho.order = Zpp_f.pp_bn.order - 1;
0119 Zpp_f.pp_d2a0drho2.order = Zpp_f.pp_a0.order - 2;
0120 Zpp_f.pp_d2andrho2.order = Zpp_f.pp_an.order - 2;
0121 Zpp_f.pp_d2bndrho2.order = Zpp_f.pp_bn.order - 2;
0122 else
0123 error('Coordinates are missing !');
0124 end