Skip to content
Snippets Groups Projects
Commit 4a65992d authored by Antoine Cyril David Hoffmann's avatar Antoine Cyril David Hoffmann
Browse files

to retrieve phase space distribution function

parent a60ba891
No related branches found
No related tags found
No related merge requests found
function FF = compute_fa(Napj, spar, xperp)
%% Compute the dispersion function from the moment hierarchi decomp.
% Normalized Hermite
Hp = @(p,s) polyval(HermitePoly(p),s)./sqrt(2.^p.*factorial(p));
% Laguerre
Lj = @(j,x) polyval(LaguerrePoly(j),x);
% Maxwellian factor
FaM = @(s,x) exp(-s.^2-x);
[SS, XX] = meshgrid(spar, xperp); %meshgrid for efficient evaluation
FF = 0 .* SS;
[Pmax,Jmax] = size(Napj);
FAM = FaM(SS,XX);
for p_ = 0:Pmax-1
HH = Hp(p_,SS);
for j_ = 0:Jmax-1
LL = Lj(j_,XX);
FF = FF + Napj(p_+1,j_+1)*HH.*LL.*FAM;
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment