SDT-nlsim
Contents  
Functions  
 ![]() ![]() |
Purpose
HBM Solver and base utilities commands.
Description
Variables used during the resolution are the opt structure
Performs amplitude/frequency response MAPS, possibly in a given subspace.
Z=hbm_solve('AFMap',model,RO);
model is a standard SDT-HBM model. By default the study is performed on the first harmonic of the model active DOF. It is possible to provide a customized harmhdof vector or even a reduced subspace by using a third argument def as a structure with fields
RO is a structure with fields (that can also be provided in a preemptive way in the RO structure)
Output Z is a standard SDT-HBM Zcurve with multiple dimensions corresponding to Hdof, Freq and Amp.
Provides and performs SDT-HBM specific pre-post assembly operations. The assembly call to be passed to fe_case is provided by
st=hbm_solve('AssembleCall');
AssembleInit and AssembleExit are internal calls handling non-linearity initialization and proper load definitions.
Command fe_time is called back by fe_timeas the base HBM solver, defined by field opt.Method in the opt structure.
Command fe_timeCleanup performs base post-treatments to the raw solver output and handles direct storage in interaction with hbmui. By default the output will be stored in the application, and base results can directly be displayed in iiplot.
This command is usually performed as an internal command at solver exit based on the field opt.FinalCleanupFcn in the opt structure. The command then expects that the caller uses variables out, opt and model to respectively store the solver output as a HBM curve output, the solver running options (opt) and the assembled model used by the solver. An external call is also possible, using out=hbm_solve('fe_timeCleanup',out,opt,model).
The following command options are supported
Harmonic handling utilities. This series of functions provide tools for HDOF definition handling and matching.
model=demosdt('demoUBeam');cf=feplot;model.DOF=cf.def.DOF; hdof=hbm_solve('harmHdof',model,0:3); % adof, {c0,c1,s1,c2,s2,c3,s3} hdof1=hbm_solve('harmHdof',model,1,'s'); % adof, s1 i1=hbm_solve('harmC',hdof,hdof1,'ind',1); sdof=hbm_solve('harmChID',hdof,'c1','dof',1); isequal(hdof1,sdof)
Solver options handling. Reference to data fields is provided in opt for initialization and opt for values used during the solve.
opt=hbm_solve('opt'); opt=hbm_solve('opt fstart=.1 fend=100',opt); RA=struct('fstart',.5,'fend',100,'dsmin',.001); opt=hbm_solve('opt',[],RA); opt=hbm_solve('opt',opt,RA);
Performs model reduction with proper handling of non-linearities.
[model,Case,Load]=hbm_solve('Reduce',model,TR);
model is a SDT-HBM model, TR is a def structure defining the reduction basis.
The model will be fully assembled then reduced, it is possible to provide a pre-assembled model. To do so, it is necessary to define the associated case by providing it in a third argument. The output is an assembled reduced model complying with initialization of SDT-HBM resolution procedures.
Performs a state prediction based on an interpolated curvilinear frequency step.
[Z,opt]=abscHBM(Z0,opt,j1);
Z0 is the initial state provided to the solver, opt is the internal solver structure, j1 is an interaction indicator.
The outputs are Z a predicted state, and opt with updated curvilinear frequency step opt.dS.
For the first iteration j1==1, the initial state Z0 is output.
For the fixed strategy opt.dsOpt.step==0, the curvilinear frequency step is set to 0.5*opt.dsOpt.dsfix, and the predicted state is the initial state Z0 with the new frequency.
For the Lagrange interpolation strategy opt.dsOpt.step==1, the curvilinear frequency step is defined as being between opt.dsOpt.dsmin and opt.dsOpt.dsmax and updated to optimize the number of iterations towards the target opt.dsOpt.iopt. The update is performed by applying a multiplicative coefficient to the current frequency step opt.dS as the ratio between the optimal iteration number opt.dsOpt.iopt and the last number of iterations opt.ite. The multiplicative coefficient is bounded between opt.dsOpt.bmin and opt.dsOpt.bmax. The predicted state is the result of the Lagrange interpolation of degree opt.dsOpt.Ldeg of the last states at the incremented frequency.
Computes the linear dynamic harmonic forces o1=A*z0 in an implicit manner (i.e. without actually building the dynamic harmonic stiffness matrix).
o1=ATimesZ(model,Case,opt,z0)
The output o1 is the linear dynamic harmonic forces.
Initialization and/or generation of the harmonic dynamic stiffness.
opt=buildA(model,Case,opt,Z,i1).
model is a SDT-HBM assembled model, Case is the associated case, opt is the internal solver running option structure, Z is the current harmonic state; these variables must have been initialized by hbm_solve InitHBM. i1 is the output option:
The frequency is recovered from context, either opt.Opt.fvar==1 and the pulsation is taken as the last value of the harmonic state (w=Z(end)), or opt.Opt.fvar==0 and the pulsation is directly taken as w=opt.w.
The output opt is either the running option structure with filled opt.A or directly the harmonic stiffness matrix.
Generation of interlaced harmonic observation or command matrices.
[c,harm]=buildCHarm(c,opt,typ).
c is an observation or command matrix, opt is the internal solver running options that must have been initialized by hbm_solve InitHBM, typ provides the type of matrix c. Either typ='c' to declare an observation matrix, or typ='b' to declare a command matrix.
The output is the interlaced observation or command matrix c. Line ordering is interlaced (i.e.) the sequence is first the harmonics, then the initial line order. harm is the retained harmonics. For command matrices, Fourier coefficients are applied to the matrix terms.
It is possible to define a field opt.subH with a sub-set of harmonics to be used for the observation generation, independently from the initial opt.harm field that is used by default.
Generation of time function space.
opt=buildHkt(opt);
opt is the internal solver running option initialized by hbm_solve InitHBM.
The output is the internal solver running option opt with updated fields opt.Hkt, opt.dHkt and opt.Htk = opt.Hkt', that are the time harmonic components of (1.125). opt.N and opt.harm (representing k/ν) are mandatory fields.
Prepares the external load structure for the HBM solver, based on the usual transient Load representation of fe_time.
Load=buildLoad(Load);
The output has a resolved field .adof providing the harmonic DOF used to described the external load, a command matrix .b, a field .curve providing the optional variations of external loads with the frequency.
Load is a load structure complying to time simulations. See fe_load, fe_load buildu.
Integrated generation of a subharmonic observation matrix based on a HBM output curve.
opt=ctaSubH(cta,d0,subH);
cta is an observation matrix, d0 is an HBM output data structure, subH is a sub-harmonic selection. subH is either directly a vector of harmonics, or a string token set to
The output is the opt data structure with added or updated fields .cta, opt.iadof, opt.idof, opt.harm, opt.hVect, opt.hId to comply with the subharmonic selection.
Optimized trajectory linear amplitude change.
d2=defUpCoef(d2,Amp);
d2 is a trajectory initialized the hbm_post ZTrajGet-initnl, Amp is a scalar amplitude coefficient.
The output is d2 the trajectory linearly set to amplitude Amp, relative to d2.coef, the initial amplitude.
The trajectory and non-linearity observations are updated using Amp/d2.coef, non-linear forces are re-evaluated to provide a linearly updated trajectory.
The subfunction @intHBM performs HBM solver specific initialization based on a SDT model with non-linearities. [model,Case,opt,Z0,Zf]=initHBM(model,Case,opt,u,fext);
model is a standard fully assembled SDT-NL model, Case is the corresponding resolved Case structure, opt is the solver running option structure opt, u is a system state expressed on Case.DOF, usually a static state, fext is the external Load structure expressed on Case.DOF.
model, Case and fext should be compliant to the SDT-HBM data structures, and can be typically obtained from usual models with the provided hbm_solve AssembleCall: [model,Case,fext]=fe_case(hbm_solve('AssembleCall'),model);.
The outputs are data ready to be used in HBM solvers, opt is completed, Z0 is the initial state, Zf is the current harmonic load vector.
The initialization procedure
Performs an iterative resolution for a given initial state.
[Z,ki,opt]=iterHBM(ki,Zf,Z,model,Case,opt,j1);
ki is for the moment reset internally and can be provided empty. Zf is the harmonic load vector, Z is the initial harmonic state, model is the assembled model, Case the corresponding case structure, opt the solver running options. All these variables must have been initialized with hbm_solveInitHBM. j1 is a step indicator, also used in the base solver to know whether the state buffer has been fully filled.
The outputs are Z the resolved HBM state, ki the current Jacobian, and opt the internal solver option structure.
Generates the harmonic external forces vector from the Load context. This is used by hbm_solve @resHBM.
Zf=getZf(Zf,opt);.
Zf is the current load data structure, or a resolved harmonic vector. Nothing is performed in the latter case. opt is the internal solver running option. In particular the current pulsation is found in opt.w.
Initializes the solver output structure, to be filled by hbm_solve @outputHBMFcn.
[out,opt]=outputInitHBM(model,Case,opt);
model is unused at the moment, Case is the case corresponding to the harmonic model, opt is the internal solver running option. These variables must have been initialized by hbm_solve InitHBM.
Output data structure (pointer addressed) filling.
outputHBMFcn(out,Z,opt);
out is an output data structure initialized by hbm_solve @outputInitHBM, Z is the current state to be possibly stored, opt is the internal running option solver.
There is not output associated to this command as input structure out fields are handled by pointer.
The current state is stored if its associated frequency has changed in absolute value by more than opt.SaveFreq.fStep from the last saved frequency point (out.X2(out.cur(2))). The frequency is recovered from context, either opt.Opt.fvar==1 and the pulsation is taken as the last value of the harmonic state (w=Z(end)), or opt.Opt.fvar==0 and the pulsation is directly taken as w=opt.j1. In this case, opt.j1 is differentiated from opt.w to allow customized handling of the saving strategy.
Computation of the harmonic balance residue and associated finite differences Jacobian.
[r,ki]=resHBM(Zf,Z,model,Case,opt,ki,jite);
Zf is the harmonic load vector, Z is the current harmonic state, model is the harmonic model, Case is the corresponding case, opt is the internal solver running option, ki is the current Jacobian, jite is a current iteration indicator.
The outputs are r the harmonic residue, and ki the associated Jacobian.
The Jacobian is computed by finite differences using a dZ amplitude defined by opt.epsi and initialized at 1e-9. It is computed if ki is empty, or if opt.JacobianUpdate is not null.
It is possible to obtaind the external harmonic forces of the current model by setting Z to empty. In such case, the non-linear forces will be obtained from model.FNL and summed with -Zf in the output r.