New Features in DFIELD & PPLANE for MATLAB version 5.2 |
These revisions incorporate one important new feature, a number of
smaller ones, and the correction of some code in pplane5
which lead to warnings. The changes are not substantial enough to call
for a name change, so they are still called dfield5 and
pplane5.
dfield5 but not in pplane5.
New method to change
default settings. I have been experimenting with different ways
of allowing the user to change some of the defaults. This is the best
way I have found to date. It uses an optional startup file. These
are different for the two routines, and they will be explained in more
detail in what follows.
dfield5.
New method to change
default settings. This requires the use of an optional auxillary
file with the name dfstart.m. Here is an example of such
a file:
function H = dfstart
% DFSTART is a function m-file that is read when DFIELD5
% is started and which inputs certain data that
% are used to change defaults. Only four items
% may be changed. To do so it is necessary to enter
% one or more of the following lines. The entries
% here are the defaults.
H = []; % DO NOT REMOVE THIS LINE!
% If there is a dfstart.m file, it must contain this line.
% H.style = 'display'; % Must be 'white', 'black', or 'display'.
% 'white' is the default.
% H.size = 15; % Any number is allowed. This is the
% main font size used in DFIELD5. It
% determines the size of all windows,
% and everything else.
% The default is 10
% H.npts = 20; % The number of field points per line.
% The default = 20.
% H.solver = 'Euler'; % The choices are 'Euler', 'Runge-Kutta 2',
% 'Runge-Kutta 2', and 'Dormand-Prince'.
% The default is 'Dormand-Prince'.
As can be seen, it is possible to change only four of the defaults. To change a default it is necessary to remove the comment character (%) from the appropriate line. The defaults that can be changed and the options are:
| style | This determines the appearance of dfield5. The options are
'white', 'black', and 'display'. 'white' is the default option
and is the same as the default MATLAB option. 'black' makes
the backgrounds of the figures black. 'display' a modification
of 'white' which we have found is more suitable for use with a
computer projection system. |
| size | This parameter determines the size of all the winodws. It
refers to the main point size used for the text, but
everyting else is resized accordingly. The default is 10.
15 is good for use with a projection system. dfield5 will
ensure that no figure is too large to fit on the
screen. |
| npts | This is the number of field points per line in the dfield5 Display
window. The default is 20. |
| solver | The user can choose the default solver that is used to solve the ODEs. The options are 'Dormand-Prince' (this is the default), 'Runge-Kutta 4', 'Runge-Kutta 2', and 'Euler'. |
pplane5.
New method to change
default settings. This requires the use of an optional auxillary
file with the name ppstart.m. Here is an example of such
a file:
function H = ppstart
% PPSTART is a function m-file that is read when PPLANE5
% is started and which inputs certain data that
% are used to change defaults. Only three items
% allowed. If only one item is to be changed, all
% three should be included. The following are the
% defaults as written in PPLANE5, and changes can
% be made as needed.
H =[]; % DO NOT REMOVE THIS LINE!
% This command is essential to the working of this function. It
% is necessary if this file exists, even if no changes follow it.
% H.style = 'display'; % Choices are 'white','black', or 'display',
% The default is 'white'.
% H.size = 15; % Any number is allowed. This is the
% main font size used in PPLANE5. It
% determines the size of all windows,
% and everything else. The default is 10.
%H.ppdir = 'c:\matlab'; % The directory where systems and
% galleries are to be found. This must be
% a string like:
% 'c:\Matlab\files' (PC)
% '/home/polking/matlab/files' (UNIX)
% 'Macintosh HD:Matlab:files' (Mac)
%H.npts = 15; % The number of field points per line. The default is 20.
% H.solver = 'Runge-Kutta 4'; % The choices are 'Dormand Prince', 'ode15s',
% and 'Runge-Kutta 4'. The default is
% 'Dormand Prince'.
% H.tolerance = 1e-5; % The tolernace used by the Dormand Prince and ode15s
% solvers. It should be at most 1e-3 and at least
% 1e-12. The default is 5e-4.
% H.stepsize = 0.01; % The step size used by the Runge-Kutta 4 solver.
% The default is 0.1;
As can be seen, it is possible to change only some of the defaults. To change a default it is necessary to remove the comment character (%) from the appropriate line. The defaults that can be changed and the options are:
| style | This determines the appearance of pplane5. The options are
'white', 'black', and 'display'. 'white' is the default option
and is the same as the default MATLAB option. 'black' makes
the backgrounds of the figures black. 'display' a modification
of 'white' which we have found is more suitable for use with a
computer projection system. |
| size | This parameter determines the size of all the winodws. It
refers to the main point size used for the text, but
everyting else is resized accordingly. The default is 10.
15 is good for use with a projection system. pplane5 will
ensure that no figure is too large to fit on the
screen. |
| npts | This is the number of field points per line in the pplane5 Display
window. The default is 20. |
| solver | The user can choose the default solver that is used to solve the ODEs. The options are 'Dormand-Prince' (this is the default), 'Runge-Kutta 4', 'Runge-Kutta 2', and 'Euler'. |
| ppdir | This is the the directory in which pplane5 looks first for
systems and galleries. This must be a string like:
'c:\Matlab\files' (PC)
'/home/polking/matlab/files' (UNIX)
'Macintosh HD:Matlab:files' (Mac)
| tolerance | The tolerance used by the Dormand Prince and ode15s solvers. It should be at most 1e-3 and at least 1e-12. The default is 5e-4. It is not at all unreasonable to set this to be something like 1e-5 or 1e-6. |
| stepsize | The step size used by the Runge-Kutta 4 solver. The default is 0.1; |