LAMMPS后处理——MATLAB子函数合集整理_matlab处理lammps介电常数-程序员宅基地

技术标签: matlab  lammps后处理  分子动力学后处理集成函数—Matlab  

关注 M r . m a t e r i a l   , \color{Violet} \rm Mr.material\ , Mr.material , 更 \color{red}{更} 多 \color{blue}{多} 精 \color{orange}{精} 彩 \color{green}{彩}


主要专栏内容包括:
  †《LAMMPS小技巧》: ‾ \textbf{ \underline{\dag《LAMMPS小技巧》:}}  LAMMPS小技巧》: 主要介绍采用分子动力学( L a m m p s Lammps Lammps)模拟相关安装教程、原理以及模拟小技巧(难度: ★ \bigstar
  ††《LAMMPS实例教程—In文件详解》: ‾ \textbf{ \underline{\dag\dag《LAMMPS实例教程—In文件详解》:}}  ††LAMMPS实例教程—In文件详解》: 主要介绍采用分子动力学( L a m m p s Lammps Lammps)模拟相关物理过程模拟。(包含:热导率计算、定压比热容计算,难度: ★ \bigstar ★ \bigstar ★ \bigstar
  †††《Lammps编程技巧及后处理程序技巧》: ‾ \textbf{ \underline{\dag\dag\dag《Lammps编程技巧及后处理程序技巧》:}}  †††Lammps编程技巧及后处理程序技巧》: 主要介绍针对分子模拟的动力学过程(轨迹文件)进行后相关的处理分析(需要一定编程能力。难度: ★ \bigstar ★ \bigstar ★ \bigstar ★ \bigstar ★ \bigstar )。
  ††††《分子动力学后处理集成函数—Matlab》: ‾ \textbf{ \underline{\dag\dag\dag\dag《分子动力学后处理集成函数—Matlab》:}}  ††††《分子动力学后处理集成函数—Matlab》: 主要介绍针对后处理过程中指定函数,进行包装,方便使用者直接调用(需要一定编程能力,难度: ★ \bigstar ★ \bigstar ★ \bigstar ★ \bigstar )。
  †††††《SCI论文绘图—Python绘图常用模板及技巧》: ‾ \textbf{ \underline{\dag\dag\dag\dag\dag《SCI论文绘图—Python绘图常用模板及技巧》:}}  †††††SCI论文绘图—Python绘图常用模板及技巧》: 主要介绍针对处理后的数据可视化,并提供对应的绘图模板(需要一定编程能力,难度: ★ \bigstar ★ \bigstar ★ \bigstar ★ \bigstar )。
  ††††††《分子模拟—Ovito渲染案例教程》: ‾ \textbf{ \underline{\dag\dag\dag\dag\dag\dag《分子模拟—Ovito渲染案例教程》:}}  ††††††《分子模拟—Ovito渲染案例教程》: 主要采用 O v i t o \rm Ovito Ovito软件,对 L a m m p s \rm Lammps Lammps 生成的轨迹文件进行渲染(难度: ★ \bigstar ★ \bigstar )。

  专栏说明(订阅后可浏览对应专栏全部博文): ‾ \color{red}{\textbf{ \underline{专栏说明(订阅后可浏览对应专栏全部博文):}}}  专栏说明(订阅后可浏览对应专栏全部博文):
注意: \color{red} 注意: 注意:如需只订阅某个单独博文,请联系博主邮箱咨询。 l a m m p s _ m a t e r i a l s @ 163. c o m \rm lammps\[email protected] [email protected]

\spadesuit † \dag 开源后处理集成程序:请关注专栏《LAMMPS后处理——MATLAB子函数合集整理》
\spadesuit † \dag † \dag 需要付费定制后处理程序请邮件联系: l a m m p s _ m a t e r i a l s @ 163. c o m \rm lammps\[email protected] [email protected]


\spadesuit \spadesuit L a m m p s Lammps Lammps 后处理及编程技巧第一次线上分享论坛( 2021.11.20 2021.11.20 2021.11.20):
视频链接 \color{red}{视频链接} 视频链接(请点击)
资料下载 \color{red}{资料下载} 资料下载 (请点击)
提取码: o a x k 提取码:\color{red}{oaxk} 提取码:oaxk

欢迎关注公众号 : 分子模拟  M D   C l u b   ( M r _ M a t e r i a l s ) \rm \color{red} 欢迎关注公众号:分子模拟\ MD\ Club\ (Mr\_Materials) 欢迎关注公众号:分子模拟 MD Club (Mr_Materials)


关注 M r . m a t e r i a l   , \color{Violet} \rm Mr.material\ , Mr.material , 更 \color{red}{更} 多 \color{blue}{多} 精 \color{orange}{精} 彩 \color{green}{彩}

请添加图片描述

博客介绍

这一部分的内容是独立于博客专栏(《LAMMPS后处理以及编程技巧》)之外的分支。在《LAMMPS后处理以及编程技巧》专栏中博文内容是针对于单个特殊的问题的,并且代码只是提供编程思路,并不是一个集成的子函数。
本博客将会介绍一些集成后子函数,可直接调用,用于Lammps的后处理,子函数内容和功能会及时更新,请关注博客更新时间。

更新于 2021-05-24
更新dump文件的读写函数:readdump_all(“your dump file”),write_dump(fid,martix_name,all_dump,out_matrix,frame_flag);
更新于 2021-06-13
更新热力学量分析函数:thermo_output(all_data,target_name,dim,bin_number)
更新于 2021-06-14
更新热力学量分析函数:thermo_output(all_data,target_name,dim,bin_number) 目前包括,温度、动能,势能和数密度的一维和二维计算
更新于 2021-08-01
更新热力学量分析函数:thermo_output(all_data,target_name,dim,bin_number) ,修改了部分输出,增加了时间统计
更新于 2021-08-02
更新热力学量分析函数:thermo_output(all_data,target_name,dim,bin_number) ,修改了温度NAN bug以及输出问题

需要PDF资料请下载:

链接:请点击
提取码:b1nd

在这里插入图片描述

一、Dump轨迹的读入、写出

(1)读取Dump轨迹

NOTE!!!
Example:
Dump command must be (see below)

# 计算KE
compute          KE all    ke/atom 
# Dump出KE
dump        1    all custom 10000 dump.all                   &
                 id type x y z vx vy vz fx fy fz c_KE 
 all_dump = readdump_all("your dump file")
function [varargout] = readdump_all(varargin)
try
    dump = fopen(varargin{
    1},'r');
catch
    error('Dumpfile not found!');
end

i=1;
while feof(dump) == 0
    id = fgetl(dump);
     if (strncmpi(id,'ITEM: TIMESTEP',numel('ITEM: TIMESTEP')))
            timestep(i) = str2num(fgetl(dump));
    else
     if (strncmpi(id,'ITEM: NUMBER OF ATOMS',numel('ITEM: NUMBER OF ATOMS')))
            Natoms(i) = str2num(fgetl(dump));
     else
      if (strncmpi(id,'ITEM: BOX BOUNDS',numel('ITEM: BOX BOUNDS')))
            x_bound(i,:) = str2num(fgetl(dump));
            y_bound(i,:) = str2num(fgetl(dump));
            z_bound(i,:) = str2num(fgetl(dump));
      else
       if (strcmpi(id(1:11),'ITEM: ATOMS'))
            for j = 1 : 1: Natoms
                atom_data(j,:,i) = str2num(fgetl(dump));
            end
            i=i+1;
       end
      end 
     end
   end
end
%----------Outputs-------------
%OUTPUTS IN SAME VARIABLE STRUCTURE
varargout{
    1}.timestep = timestep;
varargout{
    1}.Natoms = Natoms;
varargout{
    1}.x_bound = x_bound;
varargout{
    1}.y_bound = y_bound;
varargout{
    1}.z_bound = z_bound;
varargout{
    1}.atom_data = atom_data;
%------------------------------
fclose(dump);

(2)写出Dump轨迹

Example:

martix_name = ["water_free_tag"];
frame_flag = frame;
all_dump.out_1 = water_curve_tag;
out_matrix = all_dump.atom_data(:,1:5);
out_matrix(:,6)=water_free_tag;
write_dump(fid,martix_name,all_dump,out_matrix,frame_flag);
function dump = write_dump(file_fid,martix_name,all_dump,out_matrix,frame_flag)
%{
    
%------------------------------------------------%
%      Author_Email: lammps_materials@163.com    %  
%------------------------------------------------%
file_fid   : the file fid for output by MATLAB;
martix_name : new column for dump data, like put new two columns into
dump,namely "watertag1 watertag2". Here the martix_name is
[watertag1;watertag2].Note that the name for each column is divided by ";".The
matrix faultly contains "id type x y z",therefore, the string name is
following: "ITEM: ATOMS id type x y z..."
matrix_data : all dump file includes the info: atom-id, type x y z... 
timestep    : you need to run "readlammps.m" fristly.Then you get timestep
matrix for all frame";
frame_flag  : Here is flag for each frame.please put the loop parameter
into there.
x_bound,y_bound,z_bound: Here is doundary info from readlammps.m. 
%------------------------------------------------%
%}
    title_first    = "ITEM: TIMESTEP";
    title_number   = "ITEM: NUMBER OF ATOMS";
    title_boundary = "ITEM: BOX BOUNDS pp pp pp";
    title_final = [];
    for ii = 1:max(size(martix_name))
        martix_name(ii)= martix_name(ii)+' ';
        title_final = strcat(title_final,martix_name(ii)) ; 
    end
    title_final      = strcat("ITEM: ATOMS id type x y z ",title_final);
       
    fprintf(file_fid,'%s\n',title_first);
    fprintf(file_fid,'%d\n',all_dump.timestep(frame_flag));
    
    fprintf(file_fid,'%s\n',title_number);
    fprintf(file_fid,'%d\n',length(all_dump.atom_data));
    
    fprintf(file_fid,'%s\n',title_boundary);
    fprintf(file_fid,'%d %d\n',[all_dump.x_bound(1,1),all_dump.x_bound(1,2)]);
    fprintf(file_fid,'%d %d\n',[all_dump.y_bound(1,1),all_dump.y_bound(1,2)]);
    fprintf(file_fid,'%d %d\n',[all_dump.z_bound(1,1),all_dump.z_bound(1,2)]);     
        
    fprintf(file_fid,'%s\n',title_final);
    [r,c]=size(out_matrix(:,:));            
        for i=1:r
            for j=1:c
                fprintf(file_fid,'%f\t',out_matrix(i,j));
            end
                fprintf(file_fid,'\r\n');
        end 
   
end

二、热力学量(温度、数密度、动能和势能)计算(一维线图、二维云图)

测试 case 和 code链接(MATLAB 2020a):https://pan.baidu.com/s/1wXmMF9ZsCyCO2jMd8jgJNg
提取码:clw2

基本概念:(具体请参考)
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

Example
Keywords of “terget_name” can be “TEMP”, “KE”, “DEN” for temperature, kinetic energy,potential energy and number density for both one-dimension plot and two-dimension plot.

here is three atom type of SI, O and N, the keyowrd type should be slelected first. For example, the “KE” for x-z axis can be calcluated as " thermo_output(all_data,“KE”,[2,1,0,1],[50,50],[1,2,3]) ".
It means that all_data is your dump matrix, you need to run " all_dump = readdump_all(“your dump file”) " first. “KE” is keywod for kinetic energy.
[2,1,0,1] is dim, first 2 is dimension, [1,0,1] cooresponds the three axis, here x and z are selected.
[50,50] is mesh grid number for x and z axis.
[1,2,3] is all type form dump, which is defaultly form 0 to the max of atom type.

For simplicity, the results form matlab are compared with same paremeters of KE which is calculated by Ovito.

EXAMPLE:
all_data = readdump_all("your dump file")
out = thermo_output(all_data,"KE",[2,1,0,1],[50,50],[0,0,3])

在这里插入图片描述
在这里插入图片描述

function [varargout] = thermo_output(all_data,target_name,dim,bin_number,type)
%{
    
%------------------------------------------------%
%      Author_Email: lammps_materials@163.com    %  
%------------------------------------------------%
The dump file must be "ITEM: ATOMS id type x y z vx vy vz fx fy fz c_ke"
you should run "readdump_all.m" first!
The keywords for target_name can be: TEMP,KE,DEN;
dim: dimension,it should contain 4 parameter,e.i. [2,1,1,0]. 
     the first parameter is dimension,the next three parameters are calculating
     on which axis like [2,1,1,0] is dimension of 2 and x-y axis.If dim is
     1,the next three parameters should only one parameter is equal to 1,like
     [1,1,0,0], which means the simulation box will be sliced along x-axis
bin_number: bin_number is 1*2 matrix, If the dim is 2,the bin_number(2) is no-zero
    number; If the dim is 1,the bin_number(2) is zero number;
type: target atom type, If you have 5 types which are "Si,O,H,C,N" for
    example, the only Si and O is contributed to thermal value. the keywords 
    "type" should be [1,1,0,0,0]
out = thermo_output(all_data,"KE",[2,1,0,1],[50,50],[0,0,3])
%}
t_start_all = cputime;   % record time

if nargin < 5
   error('Error:Input parameter is smaller than 5!');      
elseif(size(bin_number)<2)
   error('Error:All dimension should be given!'); 
elseif(dim(1)==1 && ((bin_number(2))~=0)  )
   error('Error:the dim2 parameter of binnumber should be zero for the one dimension!');
elseif(dim(1)==1 && ((sum(dim(2:4)))>1)  )   
   error('Error:the only one axis should be given in one-dimension!'); 
 
   
elseif(dim(1)==2 && ((bin_number(2))==0)  ) 
   error('Error:the dim2 parameter of binnumber should be given for the two dimension!');    
elseif(dim(1)==2 && ((sum(dim(2:4)))>2)  )   
   error('Error:the two axis should be given in two-dimension!');   
end

if(target_name~="KE"&&target_name~="DEN"&&target_name~="TEMP")
   error('Error:target_name must be "KE", "DEN" or "TEMP"!');
end

disp("-----------------------------------------------------------------------------");

fprintf("Note:the dump file must be ITEM: ATOMS id type x y z vx vy vz fx fy fz c_ke!\n");
fprintf("Note:All unit must be in metal!\n");

disp("-----------------------------------------------------------------------------");
% KB 
KB        = 8.625*1e-5; % ev/k
%all frame number 
all_frame = size(all_data.atom_data,3);
% simulation box region
xl = all_data.x_bound(1,2)-all_data.x_bound(1,1);
yl = all_data.y_bound(1,2)-all_data.y_bound(1,1);
zl = all_data.z_bound(1,2)-all_data.z_bound(1,1);
%bin length for one dimension
unit_dim1_dx = floor(xl/bin_number(1));
unit_dim1_dy = floor(yl/bin_number(1));
unit_dim1_dz = floor(zl/bin_number(1));

unit_dim1    = floor(xl/bin_number(1));

%bin length for two dimension
unit_dim2_1  = floor(bin_number(1));
unit_dim2_2  = floor(bin_number(2));

%define plot matrix 
dim1_plot_matrix_x  = zeros(unit_dim1_dx,1);
dim1_plot_matrix_y  = zeros(unit_dim1_dy,1);
dim1_plot_matrix_z  = zeros(unit_dim1_dz,1);

%define plot temp matrix for one dimension
dim1_plot_matrix      = zeros(bin_number(1),all_frame);
dim1_plot_matrix_temp = zeros(bin_number(1),all_frame);

%define plot temp matrix for two dimension
dim2_mesh_matrix  = zeros(unit_dim2_1,unit_dim2_2);

dim2_mesh_matrix_temp     = zeros(unit_dim2_1,unit_dim2_2,all_frame);
dim2_mesh_matrix_temp_num = zeros(unit_dim2_1,unit_dim2_2,all_frame);

% mesh size
bin_mesh_xsize    = xl/bin_number(1);
bin_mesh_ysize    = yl/bin_number(2);
bin_mesh_zsize    = zl/bin_number(2);

flag_dim1=0;flag_dim2=0;

type_flag = find(type==1);

now_test       = all_data.atom_data(:,:,1);
TYPE_test      = now_test(:,2);

if(max(TYPE_test)<max(type))
   error('Error:Type is out of range!');
end

for frame = 1:all_frame
    
    now_frame = all_data.atom_data(:,:,frame);
    ID        = now_frame(:,1);
    TYPE      = now_frame(:,2);
    XYZ       = now_frame(:,3:5);
    KE        = now_frame(:,12);
    
  for i = 1:length(XYZ) 
      if((TYPE(i)==type)==0)
         continue; 
      end
      if (dim(1)==1)
          %------------------------------------------------------------%
          block = bin_number(1);
          if(dim(2)==1 && dim(3)==0 && dim(4)==0)    %x-axis
             bin_size = xl/block;
             flag_dim1=1;
             for block =1:bin_number(1)
                 if((XYZ(i,1)>(block-1)*bin_size) && (XYZ(i,1)<=block*bin_size))
                     if (strcmp(target_name,'TEMP'))
                         TEMP_now = KE(i)/1.5/KB;
                         dim1_plot_matrix(block,frame)=dim1_plot_matrix(block,frame)+TEMP_now;
                         dim1_plot_matrix_temp(block,frame)=dim1_plot_matrix_temp(block,frame)+1;
                     elseif(strcmp(target_name,'KE'))
                         dim1_plot_matrix(block,frame)=dim1_plot_matrix(block,frame)+KE(i);
                     elseif(strcmp(target_name,'DEN'))
                         dim1_plot_matrix(block,frame)=(dim1_plot_matrix(block,frame)+1)./(zl*yl*bin_size);
                     end  
                 end 
             end
          elseif(dim(2)==0 && dim(3)==1 && dim(4)==0)%y-axis
            flag_dim1=2;
            bin_size = yl/block;
            for block =1:bin_number(1)  
                 if((XYZ(i,2)>(block-1)*bin_size) && (XYZ(i,2)<=block*bin_size))
                     if (strcmp(target_name,'TEMP'))
                         TEMP_now = KE(i)/1.5/KB;
                         dim1_plot_matrix(block,frame)=dim1_plot_matrix(block,frame)+TEMP_now;
                         dim1_plot_matrix_temp(block,frame)=dim1_plot_matrix_temp(block,frame)+1;
                     elseif(strcmp(target_name,'KE'))
                         dim1_plot_matrix(block,frame)=dim1_plot_matrix(block,frame)+KE(i);
                     elseif(strcmp(target_name,'DEN'))
                         dim1_plot_matrix(block,frame)=(dim1_plot_matrix(block,frame)+1)./(xl*zl*bin_size);
                     end  
                 end
            end
          elseif(dim(2)==0 && dim(3)==0 && dim(4)==1)%z-axis
            flag_dim1=3;bin_size = zl/block;
            for  block =1:bin_number(1) 
                 if((XYZ(i,3)>(block-1)*bin_size) && (XYZ(i,3)<=block*bin_size))
                     if (strcmp(target_name,'TEMP'))
                         TEMP_now = KE(i)/1.5/KB;
                         dim1_plot_matrix(block,frame)=dim1_plot_matrix(block,frame)+TEMP_now;
                         dim1_plot_matrix_temp(block,frame)=dim1_plot_matrix_temp(block,frame)+1;
                     elseif(strcmp(target_name,'KE'))
                         dim1_plot_matrix(block,frame)=dim1_plot_matrix(block,frame)+KE(i);
                     elseif(strcmp(target_name,'DEN'))
                         dim1_plot_matrix(block,frame)=(dim1_plot_matrix(block,frame)+1)./(xl*yl*bin_size);
                     end  
                 end
            end
          end
          %------------------------------------------------------------%
      elseif(dim(1)==2)
          x_n = floor((XYZ(i,1)-all_data.x_bound(1,1))/bin_mesh_xsize);
          y_n = floor((XYZ(i,2)-all_data.y_bound(1,1))/bin_mesh_ysize);
          z_n = floor((XYZ(i,3)-all_data.z_bound(1,1))/bin_mesh_zsize);
          if(x_n<=0)
             x_n=1;
          end
          if(x_n>=bin_number(1))
             x_n =bin_number(1);
          end
          if(y_n<=0)
             y_n=1;
          end
          if(y_n>=bin_number(2))
             y_n =bin_number(2);
          end
          if(z_n<=0)
             z_n=1;
          end
          if(z_n>=bin_number(2))
             z_n=bin_number(2); 
          end
          if(dim(2)==1 && dim(3)==1 && dim(4)==0)    %x-y axis
             flag_dim2=1;
             if (strcmp(target_name,'TEMP'))
                 TEMP_now = KE(i)/1.5/KB;
                 dim2_mesh_matrix_temp(x_n,y_n,frame)=(dim2_mesh_matrix(x_n,y_n,frame)+TEMP_now);
                 dim2_mesh_matrix_temp_num(x_n,y_n,frame)=dim2_mesh_matrix_temp(x_n,y_n,frame)+1;
             elseif(strcmp(target_name,'KE'))
                 dim2_mesh_matrix(x_n,y_n)=(dim2_mesh_matrix(x_n,y_n)+KE(i));
             elseif(strcmp(target_name,'DEN'))
                 dim2_mesh_matrix(x_n,y_n)=((dim2_mesh_matrix(x_n,y_n)+1))./zl;
             end
          elseif(dim(2)==0 && dim(3)==1 && dim(4)==1)%y-z axis
             flag_dim2=2;
             if (strcmp(target_name,'TEMP'))
                 TEMP_now = KE(i)/1.5/KB;
                 dim2_mesh_matrix_temp(y_n,z_n,frame)=(dim2_mesh_matrix(y_n,z_n,frame)+TEMP_now);
                 dim2_mesh_matrix_temp_num(y_n,z_n,frame)=dim2_mesh_matrix_temp(y_n,z_n,frame)+1;
             elseif(strcmp(target_name,'KE'))
                 dim2_mesh_matrix(y_n,z_n)=(dim2_mesh_matrix(y_n,z_n)+KE(i));
             elseif(strcmp(target_name,'DEN'))
                 dim2_mesh_matrix(y_n,z_n)=(dim2_mesh_matrix(y_n,z_n)+1)./xl;
             end
          elseif(dim(2)==1 && dim(3)==0 && dim(4)==1)%x-z axis
               flag_dim2=3;
             if (strcmp(target_name,'TEMP'))
                 TEMP_now = KE(i)/1.5/KB;
                 
                 
                 
                 
                 dim2_mesh_matrix_temp(x_n,z_n,frame)=(dim2_mesh_matrix_temp(x_n,z_n,frame)+TEMP_now);
                 dim2_mesh_matrix_temp_num(x_n,z_n,frame)=dim2_mesh_matrix_temp_num(x_n,z_n,frame)+1;
             
             elseif(strcmp(target_name,'KE'))
                 dim2_mesh_matrix(x_n,z_n)=(dim2_mesh_matrix(x_n,z_n)+KE(i));
                 
             elseif(strcmp(target_name,'DEN'))
                 dim2_mesh_matrix(x_n,z_n)=(dim2_mesh_matrix(x_n,z_n)+1)./ly;
             end
          end
      end
  end
  
end
% output dim1_plot_matrix_temp(block,frame)=dim1_plot_matrix_temp(block,frame)+1;
    if(dim(1)==1&& strcmp(target_name,'TEMP')~=1)
        dim1_plot_matrix_new =sum(dim1_plot_matrix,2)./size(dim1_plot_matrix,2);
        x = [0 length(dim1_plot_matrix_new)];
        y = [mean(dim1_plot_matrix_new) mean(dim1_plot_matrix_new)];
        plot(dim1_plot_matrix_new,'bo-');
        line(x,y,'Color','red','LineStyle','--','Linewidth',2);
        
        legend(target_name,'Averaged value');
        xlabel('Axis /Å');
        ylabel(target_name);
    elseif(dim(1)==1 && strcmp(target_name,'TEMP')==1)    
        dim1_plot_matrix_new =sum(dim1_plot_matrix./size(dim1_plot_matrix,2)./dim1_plot_matrix_temp,2);
        dim1_plot_matrix_new(find(isnan(dim1_plot_matrix_new)==1)) = 0;
        plot(dim1_plot_matrix_new,'bo-');hold on;
        
        x = [0 length(dim1_plot_matrix_new)];
        y = [mean(mean(dim1_plot_matrix_new)) mean(mean(dim1_plot_matrix_new))];
        line(x,y,'Color','red','LineStyle','--','Linewidth',2);
        if (flag_dim1==1)
            xlabel('X-Axis /bin\_number');
        elseif(flag_dim1==2)
            xlabel('Y-Axis /bin\_number');
        elseif(flag_dim1==3)
            xlabel('Z-Axis /bin\_number');
        end
        ylabel(target_name);    
        legend('Temperature','Averaged value');
        set(gca, 'fontsize', 16);
       
        set(gca,'fontname','Times');
    elseif(dim(1)==2 && strcmp(target_name,'TEMP')==1)
        
        dim2_mesh_matrix = sum(dim2_mesh_matrix_temp,3)./all_frame;
        surf(dim2_mesh_matrix);view(2);
        if (flag_dim2==1)
            ylabel('X-Axis /bin\_number');
            xlabel('Y-Axis /bin\_number');
        elseif(flag_dim2==2)
            ylabel('Y-Axis /bin\_number');
            xlabel('Z-Axis /bin\_number');
        elseif(flag_dim2==3)
            ylabel('X-Axis /bin\_number');
            xlabel('Z-Axis /bin\_number');
        end
    elseif(dim(1)==2 && strcmp(target_name,'TEMP')~=1)   
        dim2_mesh_matrix = dim2_mesh_matrix./all_frame;
        surf(dim2_mesh_matrix);
        if (flag_dim2==1)
            ylabel('X-Axis /bin\_number');
            xlabel('Y-Axis /bin\_number');
        elseif(flag_dim2==2)
            ylabel('Y-Axis /bin\_number');
            xlabel('Z-Axis /bin\_number');
        elseif(flag_dim2==3)
            ylabel('X-Axis /bin\_number');
            xlabel('Z-Axis /bin\_number');
        end        
        shading interp; view(2);
    end
    
varargout{
    1}.all_data=all_data;     
if(bin_number(2)==0) 
varargout{
    1}.one_dim_mesh_plot=dim1_plot_matrix;
else
varargout{
    1}.two_dim_mesh_plot=dim2_mesh_matrix;    
end
% time record
%--------------------------------------------------%
t_start_stop = (cputime-t_start_all);
if(t_start_stop<1)
    fprintf('Now the used time is: %.1f s.\n',t_start_stop);
else
    fprintf('Now the used time is: %.1f mins.\n',t_start_stop/60);
end
%--------------------------------------------------%
disp("----------------");
fprintf("----ALL DONE----\n");
disp("----------------");
end

(Continue…)

三、结构分析

径向分布

在这里插入图片描述

回旋半径

在这里插入图片描述

配位数

在这里插入图片描述

(Continue…)

四、动力学分析

速度自关联分析

(continue…)

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_43689832/article/details/117197087

智能推荐

十四届蓝桥杯EDA科目客观题汇总_蓝桥杯eda真题-程序员宅基地

文章浏览阅读2.7w次,点赞156次,收藏895次。这是我自己搜集的部分十四届之前的蓝桥杯eda科目的真题和模拟题,有部分答案解释是我自己写的,所以经供参考。_蓝桥杯eda真题

textFormat失效问题的解决。-程序员宅基地

文章浏览阅读147次。import flash.text.TextField;import flash.text.TextFormat;var label:TextField = new TextField();var labelCss:TextFormat = new TextFormat();labelCss.color = "0xff0000";labelCss.leading = 5;labelCss...._format text as code点了没反应

FPGA设计经验谈 —— 10年FPGA开发经验的工程师肺腑之言-程序员宅基地

文章浏览阅读2.4k次,点赞10次,收藏30次。FPGA设计经验谈 —— 10年FPGA开发经验的工程师肺腑之言2014年08月08日 14:08 看门狗关键词: FPGA作者:friends  从大学时代第一次接触FPGA至今已有10多年的时间。至今记得当初第一次在EDA实验平台上完成数字秒表,抢答器,密码锁等实验时,那个兴奋劲。当时由于没有接触到HDL硬件描述语言,设计都是在MAX+plus II原理图环境下用..._fpga开发经验是什么

Java程序设计实验六 Socket网络程序设计-程序员宅基地

文章浏览阅读5.4k次,点赞7次,收藏52次。[1]实验目的:理解Socket通信原理,掌握使用Socket和ServerSocket类进行TCP Socket通信的程序设计方法。[2]实验内容:1、使用ServerSocket类和Socket类实现按如下协议通信的服务器端和客户端程序。服务器程序的处理规则如下:向客户端程序发送Verifying Server!。 若读口令次数超过3次,则发送Illegal User!给客户端,程序退出。否则向下执行步骤3)。 读取客户端程序提供的口令。 若口令不正确,则发送PassWord Wr_实验六 socket网络程序设计

易语言和python混合编程_易语言python交互源码,不需要把易语言编译成静态库-程序员宅基地

文章浏览阅读422次。.版本 2.支持库 spec.子程序 _启动子程序, 整数型, , 本子程序在程序启动后最先执行.局部变量 mothod, PyMethodDef.局部变量 创建结果, 整数型.局部变量 错误类型, 整数型.局部变量 错误信息, 文本型.局部变量 错误信息2, 整数型.局部变量 错误信息3, 文本型.局部变量 错误堆栈, 整数型Py_SetPythonHome (“C:\Python36”)Py_..._易语言python混合开发

数仓建设生命周期_最最最全数据仓库建设指南,速速收藏!-程序员宅基地

文章浏览阅读557次。开讲之前,我们先来回顾一下数据仓库的定义。数据仓库(Data Warehouse)是一个面向主题的、集成的、相对稳定的、反映历史变化的数据集合,用于支持管理决策。这个概念最早由数据仓库之父比尔·恩门(Bill Inmon)于1990年在《建立数据仓库》一书中提出,近年来却被愈发广泛的提及和应用,不信看下图:到底是什么,让一个从上世纪90年代提出的概念,在近几年确越来越热?带着这个问题,我们来了解一..._数仓生命周期管理

随便推点

【04多媒体基础参数】_1分钟的视频信息,要求每秒播放30帧 每帧分辨率为1024*1024,视频的采样率为4比-程序员宅基地

文章浏览阅读246次。04多媒体基础参数参数定义比特率:音视频、图像都可以采用这个指标,它指的是规定时间内传输的比特数,单位是 bps(bit per second),比特率越高,数据传输的速度就越快,流媒体的播放质量就越好(音视频越清晰),所需带宽也越大,比特率有时候也和码率混为一谈,但码率的单位一般是 kbps(千位每秒)采样率:专用于音频多媒体,也称为采样速度或者采样频率,它定义了每秒从连续信号中提取并组成离散信号的采样个数,单位为赫兹(Hz)。采样率的意义在于将模拟信号转换成数字信号时的采样频率,也就是单_1分钟的视频信息,要求每秒播放30帧 每帧分辨率为1024*1024,视频的采样率为4比

python的string模块(字符)和random模块的使用_import string在python中的用法-程序员宅基地

文章浏览阅读2.2k次,点赞3次,收藏18次。一、模块string的简单使用import string #导入string模块,获取大小写字母、特殊字符、数字等#获取大小写字母abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZprint(string.ascii_letters)#获取大写字母ABCDEFGHIJKLMNOPQRSTUVWXYZprint(string.ascii_uppercase)#获取小写字母abcdefghijklmnopqrstuvwxyzprint(s_import string在python中的用法

IntelliJ IDEA导入 Eclipse 项目【山东大学 现代软件开发技术】2023.2.2 Ulitimate Edition_idea导入eclipse-程序员宅基地

文章浏览阅读1.2k次,点赞3次,收藏8次。本文记录了将 Eclipse 项目 导入 IDEA 2023.2.2 的过程,同时也适用于山东大学现代软件开发技术这门课的开发环境迁移。_idea导入eclipse

Chrome浏览器调试教程_chrome 浏览器调试协议-程序员宅基地

文章浏览阅读1.8k次,点赞2次,收藏2次。Chrome浏览器及调试教程引言在web开发过程中,我们在写JavaScript脚本时难免会遇到各种bug,这时,我们就需要去调试我们的JavaScript脚本,然后去修改代码。最简单的调试方法就是使用alert方法,将可信息通过alert方法的弹窗显示出来。但是,alert方法有几个弊端:1)alert方法在弹..._chrome 浏览器调试协议

【小程序开发必备】微信小程序常用API全介绍,附示例代码和使用场景_微信小程序代码大全-程序员宅基地

文章浏览阅读1.1w次,点赞64次,收藏180次。本篇博文介绍了微信小程序常用API,包括网络请求、数据缓存、交互反馈、设备、媒体、界面、开放接口等方面。每个API都附有详细的介绍和示例代码,以及使用场景。这些API可以帮助小程序开发者快速实现各种功能和交互效果,是小程序开发的必备工具。无论是初学者还是有一定经验的开发者,都能从本篇博文中学到很多实用的技巧和知识。_微信小程序代码大全

Lc.exe已退出 代码为-1 解决方法-程序员宅基地

文章浏览阅读92次。打开一个别人曾经做的项目,里面用来三方控件,本机没有安装此控件,只是添加的相应的dll,结果导致了LC.exe错误:"Lc.exe已退出 代码为-1 "解决方法:1、把项目文件夹下Properties文件夹下的licenses.licx文件删除,重新编译即可;2、文本方式打开*.csproj文件,在文件中查找licenses.licx字样,删除对应节点。注意:还有..._错误64“lc.exe”已退出,代码为 -1。printlab

推荐文章

热门文章

相关标签