Create or alter delay differential equations options structure
options = ddeset('name1',value1,'name2',value2,...)
options = ddeset(oldopts,'name1',value1,...)
options = ddeset(oldopts,newopts)
ddeset
options = ddeset('name1',value1,'name2',value2,...)
creates
an integrator options structure options
in which
the named properties have the specified values. Any unspecified properties
have default values. It is sufficient to type only the leading characters
that uniquely identify the property. ddeset
ignores
case for property names.
options = ddeset(oldopts,'name1',value1,...)
alters
an existing options structure oldopts
. This overwrites
any values in oldopts
that are specified using
name/value pairs and returns the modified structure as the output
argument.
options = ddeset(oldopts,newopts)
combines
an existing options structure oldopts
with a new
options structure newopts
. Any values set in newopts
overwrite
the corresponding values in oldopts
.
ddeset
with no input arguments
displays all property names and their possible values, indicating
defaults with braces {}
.
You can use the function ddeget
to
query the options
structure for the value of a
specific property.
The following sections describe the properties that you can
set using ddeset
. There are several categories
of properties:
At each step, the DDE solvers estimate an error e
.
The dde23
function estimates the local truncation
error, and the other solvers estimate the residual. In either case,
this error must be less than or equal to the acceptable error, which
is a function of the specified relative tolerance, RelTol
,
and the specified absolute tolerance, AbsTol
.
e(i)*max(RelTol*abs(y(i)),AbsTol(i))
For routine problems, the solvers deliver accuracy roughly equivalent
to the accuracy you request. They deliver less accuracy for problems
integrated over "long" intervals and problems that are
moderately unstable. Difficult problems may require tighter tolerances
than the default values. For relative accuracy, adjust RelTol
.
For the absolute error tolerance, the scaling of the solution components
is important: if y
is somewhat smaller than AbsTol
,
the solver is not constrained to obtain any correct digits in y
.
You might have to solve a problem more than once to discover the scale
of solution components.
Roughly speaking, this means that you want RelTol
correct
digits in all solution components except those smaller than thresholds AbsTol(i)
.
Even if you are not interested in a component y(i)
when
it is small, you may have to specify AbsTol(i)
small
enough to get some correct digits in y(i)
so that
you can accurately compute more interesting components.
The following table describes the error control properties.
DDE Error Control Properties
You can use the solver output properties to control the output that the solvers generate.
DDE Solver Output Properties
Property  Value  Description 

 Function handle {  The output function is a function that the solver calls
after every successful integration step. To specify an output function,
set options = ddeset('OutputFcn',... @myfun) sets ' The output function must be of the form status = myfun(t,y,flag) Parameterizing Functions explains
how to provide additional parameters to The solver calls the specified output function with the following flags. Note that the syntax of the call differs with the flag. The function must respond appropriately:
You can use these general purpose output functions
or you can edit them to create your own. Type 
 Vector of indices  Vector of indices specifying which components of the
solution vector the solvers pass to the output function. For example,
if you want to use the options = ddeset... ('OutputFcn',@odeplot,... 'OutputSel',[1 3]); By default, the solver passes all components of the solution to the output function. 

 Specifies whether the solver should display statistics
about its computations. By default,

The step size properties let you specify the size of the first step the solver tries, potentially helping it to better recognize the scale of the problem. In addition, you can specify bounds on the sizes of subsequent time steps.
The following table describes the step size properties.
DDE Step Size Properties
Property  Value  Description 

 Positive scalar  Suggested initial step size. 
 Positive scalar  Upper bound on solver step size.
If the differential equation has periodic coefficients or solutions,
it may be a good idea to set

In some DDE problems, the times of specific events are important. While solving a problem, the solvers can detect such events by locating transitions to, from, or through zeros of userdefined functions.
The following
table describes the Events
property.
DDE Events Property
String  Value  Description 

 Function handle  A function handle that includes one or more event functions.
For [value,isterminal,direction] = events(t,y,YDEL) For [value,isterminal,direction] = events(t,y,YDEL,YPDEL) The
output arguments,
For examples that use an event function
while solving ordinary differential equation problems, see Event Location ( 
The solver functions can solve problems with discontinuities
in the history or in the coefficients of the equations. The following
properties enable you to provide these solvers with a different initial
value, and, for dde23
, locations
of known discontinuities. For more information, see Discontinuities in DDEs.
The following table describes the discontinuity properties.
DDE Discontinuity Properties
String  Value  Description 

 Vector  Location of discontinuities. Points t where
the history or solution may have a jump discontinuity in a loworder
derivative. This applies only to the 
 Vector  Initial value of solution. By default the initial value
of the solution is the value returned by 
To create an options structure that changes the relative error
tolerance of the solver from the default value of 1e3
to 1e4
,
enter
options = ddeset('RelTol',1e4);
To recover the value of 'RelTol'
from options
,
enter
ddeget(options,'RelTol') ans = 1.0000e004