[一维粒子模拟 version3.6]成功实现初次诊断函数
生活随笔
收集整理的這篇文章主要介紹了
[一维粒子模拟 version3.6]成功实现初次诊断函数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?代碼diagnostics_init.m
% %初次診斷函數,2021-10-29 % function hdiag = diagnostics_initglobal prmglobal flag_exitflag_exit = 0;hdiag.flag_rot = 0; % for rotate3dhdiag.flag_field = 0; % 0: do nothing, 1: save field datahdiag.flag_eng = 0; % 0: do nothing, 1: save energy datahdiag.flag_kspec = 0; % 0: do nothing, 1: save k-spectrum datafor l = 1:length(prm.diagtype)end%**************初始化圖形**************%hdiag.fig = figure;set(0,'lang','en'); % for English menuset(0,'DefaultAxesFontSize',10);set(0,'DefaultAxesFontName','Helvetica');%set(hdiag.fig,'Units','normalized','Position',[0,0,1,0.9]);set(hdiag.fig,'DoubleBuffer','on');set(hdiag.fig,'KeyPressFcn','pauseplot(gcbo)');set(hdiag.fig,'DeleteFcn','exitplot(gcbo)');%---彩虹色圖序---%hdiag.color = [[ 0 0 0.800000]; ... %blue[ 0 0.500000 0]; ... %green[1.000000 0 0]; ... %red[0.750000 0.750000 0]; ... %yellow[0.750000 0 0.750000]; ... %ma[ 0 0.750000 0.750000]; ... %cyan[ 0 0 0]]; %black%----遍歷圖型----%for l = 1:length(prm.diagtype)hdiag.axes(l) = subplot(2,ceil(length(prm.diagtype)/2),l);set(gca,'DrawMode','fast')set(gca,'NextPlot','ReplaceChildren')box onset(gca,'TickDir','out')set(gca,'TickLength',[0.018 0.07]);set(gca,'Layer','top')set(gca,'ColorOrder',hdiag.color);hxlabel = get(gca,'xlabel');set(hxlabel,'Units','Normalized');set(hxlabel,'Position',[0.5,-0.13,10]);switch prm.diagtype(l)case {4,10}view(-37.5,30);grid onhdiag.flag_rot = 1;%case 11hdiag.flag_eng = 1;%能量case {20,21,22,23,24}hdiag.flag_field = 1;%場case {25,26,27,28,29}hdiag.flag_field = 1;%場case {30,31,32,33,34}hdiag.flag_kspec = 1;%色散endendend運行結果
>> kempo1mainstr1 =26×1 cell 數組{'dx ' }{'dt ' }{'nx ' }{'ntime ' }{'cv ' }{'wc ' }{'angle ' }{'ns ' }{'np ' }{'wp ' }{'qm ' }{'vpa ' }{'vpe ' }{'vd ' }{'pch ' }{'iex ' }{'ajamp ' }{'wj ' }{'nplot ' }{'nv ' }{'icolor ' }{'iparam ' }{'vmax ' }{'emax ' }{'bmax ' }{'diagtype '}str2 =26×1 cell 數組{'1.000000' }{'0.040000' }{'128.000000' }{'512.000000' }{'20.000000' }{'-1.000000' }{'0.000000' }{'2.000000' }{'[4096.000000, 4096.000000, ]' }{'[2.000000, 2.000000, ]' }{'[-1.000000, -1.000000, ]' }{'[1.000000, 1.000000, ]' }{'[0.000000, 0.000000, ]' }{'[-3.000000, 3.000000, ]' }{'[0.000000, 0.000000, ]' }{'2.000000' }{'0.000000' }{'0.000000' }{'256.000000' }{'100.000000' }{'1.000000' }{'1.000000' }{'20.000000' }{'10.000000' }{'0.200000' }{'[1.000000, 4.000000, 5.000000, 12.000000, ]'}>>總結
以上是生活随笔為你收集整理的[一维粒子模拟 version3.6]成功实现初次诊断函数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 进BAT一线大厂,前端工程师如何做准备?
- 下一篇: 老子学不动系列:Vue 3.0 新特性预