set almost everything (except, e.g., p.f and p.jac) to 'standard' values %%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION HANDLES %%%%%%%%%%%%%%%%
0001 function p=stanparam(p) 0002 % set almost everything (except, e.g., p.f and p.jac) to 'standard' values 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION HANDLES %%%%%%%%%%%%%%%% 0005 p.headfu=@stanheadfu; % headline 0006 p.ufu=@stanufu; % printout, stop if p.lam<p.lammin or p.lam>p.lammax 0007 p.outfu=@stanbra; % branch output 0008 p.lss=@lss; % linear systems solver, default use \ 0009 p.blss=@blss; % bordered linear system solver, default \ 0010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% STARTUP %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0011 p.deta=0; p.err=0; p.branch=[]; p.bifvals=[]; p.restart=1; 0012 p.meth=' '; p.res=0; p.iter=0; p.ineg=0; p.muv=[]; p.lamd=0; 0013 p.count=1; p.bcount=1; % counter for step/branching points, used for file output 0014 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% PLOTTING %%%%%%%%%%%%%%%%%%%%%%%%%%% 0015 p.pstyle=1; % solution plot style: 1 for mesh-plot of u, 0016 % 2 for contour-plot, 3 for surface, with lightning, 4 for only the mesh 0017 % now fig-nr for branches and "info", e.g., meshplot on adaption etc 0018 set(0,'Units','pixels'); scnsize = get(0,'ScreenSize'); scnw=scnsize(3); scnh=scnsize(4); 0019 p.pfig=1; set(figure(p.pfig),'Position', [scnw-650 scnh-400 300 300]); % screen layout 0020 p.brfig=2;figure(p.brfig);set(figure(p.brfig),'Position', [scnw-300 scnh-400 300 300]); 0021 p.ifig=6;figure(p.ifig);set(figure(p.ifig),'Position', [0 scnh-400 300 300]); 0022 p.pmod=1; % plot every pmod-th step, 0023 p.pcmp=1; p.bpcmp=1; % component of sol. resp. branch for plotting 0024 p.cm='cool'; % colormap 0025 p.lpos=[0 0 10]; % light-pos for pstyle=3 0026 p.axis='tight'; % choose, e.g., 'tight', 'equal', 'image' 0027 p.fs=16; % fontsize for sol-plots, 0028 p.labelsw=0; % 1/0 for labels/no labels in solplot 0029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% FILE HANDLING %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0030 p.pnamesw=1; % automatically set prefix of file names to variable name 0031 p.dirchecksw=1; % ask user if directories need to be created, 0032 % or written into if exist 0033 p.smod=5; % save ev. smod-th step, 0 for none 0034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% NUMERICS %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0035 p.parasw=1; p.lamdtol=0.5; % parametrization switch and tol (for p.parasw=1) 0036 p.jsw=0; % Jacobian switch, 0: "analytically" (assembling) 0037 % 1: Gu ana, Glam finite differences (FD), 2: Gu FD, Glam ana, 3: FD for both 0038 p.nsw=0; % 0=newton, 1=chord, 2=... 0039 p.normsw='inf';p.tol=1e-8; % norm and tol for corrector 0040 p.imax=5; %#of newton-iterations in corrector 0041 p.dsinciter=p.imax/2; % increase ds if iter < dsinciter 0042 p.dsincfac=2; % by this factor 0043 p.errchecksw=1; % 1: put err-est to p.err, but no further action 0044 % 2: meshadac if p.err>p.errbound, 0: off 0045 p.errbound=0; 0046 p.dsmin=0.0001; p.dsmax=5; % min/max stepsize 0047 p.lammin=-1e6; p.lammax=1e6; % Bif.diagram bounds 0048 p.dlammax=1; % max difference in lambda 0049 p.nsteps=10; % #of steps 0050 %%%%% Eigenvalues and Bifurcation 0051 p.spcalcsw=1; % 1/0 to calculate/not calculate EVals 0052 p.neig=50; % # eigenvalues for eigs 0053 p.eigmeth='eigs'; % eigendata computation method 'eigs' or 'sarn' 0054 p.evopts.disp=0; % don't display anything during EVal calculations 0055 p.eigsstart=1; % 0 to use random start for eigs, 1 for [1;...;1] 0056 p.eigref=0; % 0: smallest abs value; 0057 % 'sr': smallest real part eigenvalues. CAN BE SLOW! 0058 p.eigint=[-1 0.1]; % 'sarn' eigenvalue region real part interval 0059 p.bifchecksw=1; % 0: off. 1: consistence with spcalc checked 0060 % 2: only det(A) decides! 0061 p.biflocsw=1; % 0 for tangent, 1 for secant in bif.localization 0062 p.bisecmax=5; % max # of bisections during bif-local. 0063 %%%%% mesh-adaption 0064 p.amod=0; % adapt mesh each amod-th step (0 for never) 0065 % see also p.errchecksw 0066 p.ngen=5; % max number of refinements during adaption 0067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% MISC CONTROLS %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0068 p.npb=2; % #branchcompos for printout 0069 p.brmod=1; % put every brmod-th step on branch 0070 p.spfig=4; % figure number for spectral output with spcalc (or specGu) 0071 p.isw=1;p.vsw=1; % interaction/verbosity switch: 0=none, 1=some, 2=much 0072 %%% TIMING, times only for reference, values set in cont/pmcont %%%%%%%% 0073 p.timesw=1; % 1 for output at end of cont 0074 p.totime=0; p.tstime=0; p.stime=0; % times: total, total for steps, current step 0075 p.biftime=0; p.sptime=0; p.ntime=0; % times for: bifcheck, spcalc, nloop 0076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% PMCONT %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0077 p.resfac=0.2; % resi-improvement for pmcont 0078 p.mst=10; % #predictors for pmcont 0079 p.pmimax=1; % base-max-iterations for pmcont