Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ECheynet committed May 13, 2020
1 parent 68cfcc1 commit 816c76b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Binary file modified Example1.mlx
Binary file not shown.
Binary file modified Example2.mlx
Binary file not shown.
11 changes: 3 additions & 8 deletions windSimFast.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
% the ground in high winds.
% Quarterly Journal of the Royal Meteorological Society, 87(372), 194-211.
%
% Author: E. Cheynet - UiS - last modified : 25-08-2018
% Author: E. Cheynet - UiS - last modified : 13-05-2020

%% Input parser
p = inputParser();
Expand Down Expand Up @@ -104,17 +104,12 @@

[L,D]=ldl(S,'lower'); % a LDL decomposition is applied this time
G = L*sqrt(D);

theta = atan2(imag(G),real(G));
A(ii,:)= (G.*exp(-1i*theta))*exp(1i*2*pi*randPhase);
A(ii,:)= G*exp(1i*2*pi*randPhase);
if ii==2, fprintf(['Expected computation time: From ',num2str(round(min(toc(tStart))*Nfreq/2)),' to ',num2str(round(min(toc(tStart))*Nfreq)),' seconds \n']); end
end

%% Apply IFFT

Nu = [A(1:Nfreq,:) ; real(A(Nfreq,:)); conj(flipud(A(2:end,:)))];
% zero mean
Nu(1,:) = 0;
Nu = [A(1:Nfreq,:) ; real(A(Nfreq,:)); conj(flipud(A(2:Nfreq,:)))];
speed=real(ifft(Nu).*sqrt(Nfreq./(dt)));

u = speed(:,1:Nm);
Expand Down

0 comments on commit 816c76b

Please sign in to comment.