SDT-rotor         Contents     Functions         Previous Next     PDF Index

Creating a new non linearity: nl_fun.m

Purpose

The structure of nl_spring allows creating any new non-linearity through the use of a dedicated function, named nl_fun.m. This function which non-linearity name will be fun, will be automatically called by nl_spring for classical operations.

The function structure has been designed to comply with specific needs. Standard calls have been defined, which are detailed below:

The designed nl_fun template is given in the non-linear toolbox, sdtweb nl_fun.m#1. It is a functional non linear function, computing a zero non linear force. The definition of a non linearity using nl_fun in a standard SDT model is given in the following.

% A standard SDT model
model=struct('Node',[1  0 0 0  0 0 0; 2  0 0 0  0 0 1],...
             'Elt',[Inf abs('celas') 0 0; 
             1 2 3 -3  0 1 0  10;   % linear celas
            ]);
% Define a non linearity of type nl_fun
model=nl_spring('SetPro ProId 100',model,nl_fun('db data0'));
%Equivalent to
% model=stack_set(model,'pro','nl_fun',...
% struct('il',[100 fe_mat('p_spring','SI',1)],...
%        'type','p_spring',...
%        'NLdata',struct('type','nl_fun','data',[])));

% Define the case
model=fe_case(model,'FixDof','base',1);
model=fe_case(model,'DofLoad','in',struct('DOF',2.03,'def',1));
model=fe_curve(model,'set','input','TestStep t1=0.02');
model=fe_case(model,'setcurve','in','input');
% Define the TimeOpt and compute the solution
opt=nl_solve('TimeOpt'); opt.Opt([4 5])=[1e-3 1e4];opt.NeedUVA=[1 1 0];
def=fe_time(opt,model);

©1991-2023 by SDTools
Previous Up Next