📄 potential_calculation.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [potE,potW]=potential_calculation(mv_x,mv_y,mv_u,mv_v)
%% potE: the curl-free potential function W
%% potW: the divergence-free potential funciton W
%% mv_x: horizontal coordinates of the grids
%% mv_y: vertical coordinates of the grids
%% mv_u: horizontal components of the input motion field
%% mv_v: vertical components of the input motion field
[M,N]=size(mv_x);
S1=construct_S1(mv_x,mv_y); %% construct the element matrix S1
[sa,sb]=size(S1);
%Sr=S1(2:sa,2:sb);
ISr=inv(S1(2:sa,2:sb));
potE=zeros(M,N);
potW=zeros(M,N);
[B,C]=construct_BC(mv_x,mv_y,mv_u,mv_v); %% construct the two vector B and C
Br=B(2:sa);
Cr=C(2:sa);
Er=ISr*Br; %% solve for the (L-1)x1 vector Er
Wr=ISr*Cr; %% solve for the (L-1)x1 vector Wr
E_pot=[0;Er]; %% reconstruct the Lx1 vector E
W_pot=[0;Wr]; %% reconstruct the Lx1 vector W
potE=reshape(E_pot,M,N); %% re-organize the MxN potential surface E
potW=reshape(W_pot,M,N); %% re-organize the MxN potential surface W
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -