home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
spredsht
/
profile.arc
/
PROF.HEL
< prev
next >
Wrap
Text File
|
1990-01-03
|
100KB
|
2,712 lines
#public - Copyright Information on Public Domain Profile
You are now using the Public Domain version of the general purpose
measurement data processor Profile. This software may not be distributed
commercially, that is, for more than the cost of distribution. However,
non-commercial copying of this program package (for example by non-profit
organizations, computer user groups, bulletin board systems or private
users) is strongly encouraged.
In other words: Copy Freely, But Do Not Sell.
You are strongly urged to distribute this software in its original form.
That is a compressed archive file called PROFILE.ARC. It contains not only
the executable program, but also the help file, further documentation and
several example Profile programs.
Every care has been taken to ensure that the Profile package operates
properly. We however make no warranties, explicit or implied, that it is
free of error. If you use Profile to solve a problem whose incorrect
solution might injure people or damage property, you do so at your own
risk.
By using Profile you agree to the terms above. You also agree that the
author and the Delft University of Technology will not be held liable for
any cost you may incur, or potential income you might lose as a result of
using Profile.
Profile is written in portable C and runs on various computer systems,
including the IBM-PC, VAX/VMS and several UNIX dialects. You can acquire
a printed manual, non Public Domain executables for the VAX and the PC
and the source code by signing a licence agreement with the Faculty of
Electrical Engineering of the Delft University of Technology. Send a
written request, stating the desired magnetic carrier, to
dr. Wim Crans
Electrical Materials Laboratory
Delft University of Technology
P.O. Box 5031, Mekelweg 4
2600 GA DELFT
THE NETHERLANDS
Fax: +31-15-783622
You will then be sent the appropiate licence forms. After shipment of the
manual and the software you will be billed for the handling cost, estimated
to be US $50 or Dfl. 100,--, unless you enclose a check for that amount.
A suitable software request form is included as a part of the PROFILE.DOC
file distributed with the public domain Profile package.
Good news for Delft University Users: you do not need a licence agreement.
The manual and executables can be ordered at the above address using an
internal order form. The exchange of the source code is negotiable.
#help - Overview of all available manual pages for Profile.
+------------------------+-------------+-------------------------------+------+
| Subject | Keyword | Contents | page |
+------------------------+-------------+-------------------------------+------+
| General information | intro | possibilities of profile | 1.1. |
| Invoking profile | invoke | call profile from the shell | 1.2. |
| A detailed example | example | process MOS-CV measurements | 1.3. |
| Synthetic data example | example2 | generate a pnp doping profile | 1.4. |
+------------------------+-------------+-------------------------------+------+
| Giving commands | history | repeat a command line | 2.1. |
| | edit | repair typing mistakes | 2.2. |
| | exec | read commands from a file | 2.3. |
| | log | write commands to a file | 2.4. |
| | quit | close a profile session | 2.5. |
| | silent | refrain profile from talking | 2.6. |
| | shell | give a system command | 2.7. |
| | comment | giving comment text | 2.8. |
+------------------------+-------------+-------------------------------+------+
| Data structure | data | introduction to profile data | 3.1. |
| | alloc | allocate data lines | 3.2. |
| | type | declare a data type (column) | 3.3. |
| | var | declare a program variable | 3.4. |
| | assign | give values to type elements | 3.5. |
| | extract | read values of type elements | 3.5. |
| | clear | clear data space | 3.6. |
| | recount | reset default type count | 3.7. |
| | defaults | program defined data | 3.8. |
+------------------------+-------------+-------------------------------+------+
| Evaluation of | expression | what expressions are allowed | 4.1. |
| expressions | define | define standard expressions | 4.2. |
| | functions | available standard functions | 4.3. |
| | show | give overview of definitions | 4.4. |
+------------------------+-------------+-------------------------------+------+
| Iterative processing | do | start a repetitive sequence | 5.1. |
| | od | end of a repetitive sequence | 5.1. |
+------------------------+-------------+-------------------------------+------+
| Input/Output | get | read data from a file | 6.1. |
| | startmark | define a starting point | 6.2. |
| | endmark | define an ending point | 6.3. |
| | put | write data to a file | 6.4. |
| | print | write data to the screen | 6.5. |
| | putvar | write variable values to file | 6.6. |
+------------------------+-------------+-------------------------------+------+
| Graphical Output | view | preview data on the screen | 7.1. |
| | graph | plot with printable chars | 7.2. |
| | plot | plot data on an HP-GL plotter | 7.3. |
| | setplot | set plotstyle per data type | 7.4. |
| | term | select video terminal type | 7.5. |
| | adapt | select video adaptor (IBM-PC) | 7.6. |
| | plotfile | output file for plotter data | 7.7. |
| | viewfile | output file for screen data | 7.7. |
+------------------------+-------------+-------------------------------+------+
| Manipulating data | sort | sort to a named data type | 8.1. |
| | remove | delete lines of data | 8.2. |
| | reduce | delete at regular intervals | 8.3. |
| | insert | add empty data lines | 8.4. |
| | smooth | apply a moving average filter | 8.5. |
| | mono | make data fully monotone | 8.6. |
| | clip | remove noise peaks | 8.7. |
| | polar | from rectangular to polar | 8.8. |
| | rect | from polar to rectangular | 8.8. |
+------------------------+-------------+-------------------------------+------+
| Numerical Analysis | fit | polynomial curve-fit | 9.1. |
| | diff | differentiate numerically | 9.2. |
| | inte | integrate numerically | 9.3. |
| | sum | summation of a data type | 9.4. |
| | compare | compare two data types | 9.5. |
| | map | map data to another x-axis | 9.6. |
| | minmax | find extremes of a data type | 9.7. |
| | poisson | solve Poisson's equation | 9.8. |
+------------------------+-------------+------------------------------++------+
| Non-linear | levmar | Optimization driver | 10.1. |
| Optimization | setext | Define external model names | 10.2. |
| | setlm | Set operational parameters | 10.3. |
| | constrain | Specify parameter constrains | 10.4. |
| | callext | Call the external model once | 10.5. |
| | scanspace | Scan the parameter space | 10.6. |
| | tpled | Input file template editor | 10.7. |
+------------------------+-------------+------------------------------+-------+
#intro (1.1.) Introduction to the possibilities of Profile.
Profile - a measurement data processing command interpreter
===========================================================
by Gertjan L. Ouwerling,
Electrical Materials Laboratory, Faculty of Electrical
Engineering, Delft University of Technology, The Netherlands.
Profile is a program that can be used to process data, obtained
by measurements of simulations or otherwise, fast and flexibly.
A major constraint is that data has to be to be available in
text files, and organized columnwise. Profile can also generate
columnwise organized data files by evaluation of functions.
Profile supports the following features:
- Batch (from a command file) or interactive mode.
- On-line definitions of
+ data types (columns of data);
+ program variables;
+ evaluation sequences (arithmetic operations on data).
- All usual math functions (sin,ln,sqrt, etc).
- Evaluation of expressions (also use as a
pocket calculator).
- Polynomial curve-fit (even on unequally spaced data)
- Numerical differentiation and integration.
- A diversity of data manipulation commands
(such as smoothing, data reduction etc).
- Non-linear optimization and Inverse Modelling driver.
- On-line help on all commands.
- History mechanism and command line editing.
- Graphical output on both screen and plotter.
Nice graphs on ordinary video terminals.
- Runs on both mainframes (UNIX) and PCs.
(C) 1986, 1987, 1988 Electrical Materials Laboratory.
Profile operates as a command interpreter. When invoked it prompts with
prof>
and to this prompt commands and expressions may be typed. A command
tells profile to do something with the data (read it, write it,
perform a numerical transformation, make a plot, etc). An expression
is a mathematical formula that tells profile to compute new data using
data already present.
prof> diff num ydata xdata dydx or
prof> y2=ln(x2/pi)
Data is present in the form of scalars (variables) and 1D vectors
(data types or 'columns'). The names of the variables and data types
must be declared to profile using the commands type and var.
All data is represented by double precision floating point notation.
If a command operates on an undetermined number of data types or
variables, it usually ends in a dollar sign '$', that indicates
the end of data names:
prof> print a1 a2 a3 a4 $
If however profile knows in advance how many names will be given,
the dollar sign is not required:
prof> fit idrain vgate idrfit
When giving commands, profile asks for more data until it is
satisfied. E.g., if you only type the command name fit, it will ask
for the names of the appropriate data types:
prof> fit
y data type: idrain
x data type: vgate
fitted y data type: idrfit
Hence, in case you are unsure, just give the command name.
Help on all commands, and on a number of topics of general interest,
is available by giving
prof> help <keyword>
A list of possible keywords is displayed if you give
prof> help help
Most UNIX or MS-DOS commands can be executed directly without leaving
the program profile. This allows you to use e.g. the system editor for
changing data in files whilst using the profile package.
prof> edit data.dat
prof> get data.dat x y z $
A variety of graphical output can be generated using profile.
In the first place, with the command graph it is possible to make a plot
on the computer line printer using alpha-numerical characters only.
The size of this plot is user controlled.
In the second place, with plot it is possible to produce a much nicer
plot on pen plotters that use HP-GL as an graphical language. This has been
tested for the much used HP7550A eight color pen plotter.
Thirdly, plots may be previewed on the terminal or PC screen using the
command view. Profile knows several terminal protocols (including VT100,
VT52, CIT101 alternate graphics and IBM-PC graphics) and is able to draw
a graph of acceptable resolution on ordinary video terminals such as the
DEC VT100.
A series of Profile commands may be saved in a file and executed as a
Profile 'program'. This can even be done on line using the command exec.
prof> exec subrout.pro
This makes it possible to use previously defined data processing
sequences (comparable to subroutines in programming languages).
Exec statements may be nested, allowing an hierarchical program structure.
The Modified Damped Least Squares non-linear parameter optimization
method, an improved variant of the Levenberg-Marquardt method, is
available through the command levmar. This allows the iterative
determination of the (non-linear) parameters of a (non-linear) model
that describes some measurement data. This model may be either an
internal analytical expression (previously defined) or an external
program that reads the parameters and simulates the measurement.
#invoke (1.2.) Call Profile from the operating system prompt.
Profile is available on the IBM-PC and true compatibles, on VAX/VMS and
on various UNIX dialects. Program invocation and use are almost equal for
the PC versus UNIX, with one exception: on the PC the program is called
prof (unless renamed by the user). Our examples use the name profile.
Possible invocation modes:
System prompt (On the PC: C> and on the VAX: $).
|
v
1. % profile [options] <return>
Profile starts in interactive mode. The profile prompt
prof> indicates that profile is ready to accept your commands.
2. % profile [options] [commandfile] <return>
Profile starts in batch mode and reads commands from the command
file. If this does not end in the profile statement 'quit', profile
switches to interactive mode upon completion of the command file.
All output is written to the screen.
3. % profile [options] [commandfile] > [outputfile] <return> (Unix,PC)
$ profile [options] /output=[outputfile] [commandfile] <return> (Vax)
As above, but now writing all output to the output file
(by the usual data redirect > (Unix,MS-DOS) or /output= (Vax)).
As command line options are available:
-n[number] <- max length of data type
-d[path] <- search path for help files
With the option -n[number] the maximum length of a Profile data type
(data column) may be installed for this Profile run. Any number larger than
2 is allowed but the limited amount of memory present in your computer
must be considered. The default maximum length is 1000 (IBM-PC).
With the option -d[path] the path of the Profile help texts file can be
stated to the program. Usually this is useful on the PC only. Specifying
no path (just -d) will let Profile search in the current directory.
Example Profile Invocations:
% profile <-- Run default Profile
% profile program.pro <-- Run Profile program program.pro
% profile -n500 <-- Maximum data type length 500
% profile -dA: <-- Search helpfile on disk A:
% profile -d <-- Search helpfile in current directory
% profile -n3000 -dB:\Help test.pro <-- Mixed example
% profile mypro.pro > mypro.log <-- Catch Output by Redirect into File
% profile/output=mypro.log mypro.pro <-- The same on VAX/VMS
#example (1.3.) MOS-CV measurements data processing.
: This text is the full profile command input to process
: data obtained by MOS-CV measurements.
: These measurements are meant to find the doping profile
: in the silicon under the MOS-capacitor: the dopant
: concentration versus the depth.
:
: Definition of types and variables
:
type c $ : contains the measured capacitance
type v $ : contains the bias voltage
type dcdv $ : will contain the first derivative of c to v
type nd $ : will contain the dopant concentration
type x $ : will contain the depth into the silicon
:
var real area $ : area of the MOS capacitor
var real dox $ : thickness of the silicon dioxide
var real nd_ave $ : will contain the average dopant concentration
var real q_tot $ : will contain the total charge present
:
: Definition of expressions used to compute nd and xe
: using default variables q, eps0, epssi and epsox
:
define dope = (c~3)/(q*eps0*epssi*sqr(area)*dcdv)
define depth = ((eps0*epssi*area)/ c ) + ((epssi/epsox)*dox)
:
: Setting the values of dox and area for this device
:
dox = 1E-06
: dox = 0.01 um = 1E-06 cm
area = pi*sqr(200E-04)
: device is round with radius of 200 um
:
: Setting the markers that indicate at which lines of the
: input file reading data should start and end
:
startmark meas_#1
endmark meas_#2
:
: Reading data from file
:
get moscv.dat v c $
:
: Remove data lines that are not needed
:
remove 50 $
:
: Reduce the amount of lines to enable numerical differentiation
:
reduce 2
:
: Smooth the C-data to stabilize the numerical derivative
:
nsmooth=3
smooth c
:
:
: Determine the derivative numerically
:
diff num c v dcdv
:
: Compute the wanted quantities x and nd
:
x = depth
nd = dope
:
: Compute the average dope
:
sum nd tmp1
nd_ave = tmp1/ndata
:
: Compute the total charge present
:
inte nd x q_tot
q_tot = q_tot * area * q
:
: Write the results to a file (e.g. for making a plot)
:
put moscv#1.out x nd $
:
: Ready
:
quit
#example2 (1.4.) Data generation (a pnp-structure doping profile).
: This profile program generates a doping profile as generated
: by making one or two implants in uniformly doped background
: material. (In this case, two implants is chosen).
: The plotted result is shown following this text.
:
type x dope absdope logdope efield psi chandope vg $
var int ngrid ngate nred $
var real nrp1 rp1 drp1 nrp2 rp2 drp2 dsub dgate dback
wtot wsub wgate wsmooth
ptype ntype imp1type imp2type gatetype subtype backtype
gatepres imp1pres imp2pres subpres
mu emax vmax eps
$
: p-type dope is negative of sign, n-type positive
: a scaling factor mu gives the length in cm
: eps is set to the epsilon of Silicon
ptype = -1
ntype = 1
mu = 1E-04
eps = eps0*epssi
: p-gate area if x < 0
: p-substrate area if x > wsub
: n-channel area in between
define isgate = neg(x)
define issub = pos(x-wsub)
define ischan = pos(pos(x)+neg(x-wsub)-1.5)
: formulas describing dopant concentration due to
: two implantations (fimp1 and fimp2), background
: channel doping (fback), gate doping (fgate) and
: substrate doping (fsub). A function fsmooth is
: used to smooth the transition between channel and
: substrate.
define fimp1 = imp1type*imp1pres*nrp1*exp(min(sqr(x-rp1)/(2*sqr(drp1))))
define fimp2 = imp2type*imp2pres*nrp2*exp(min(sqr(x-rp2)/(2*sqr(drp2))))
define fgate = gatetype*dgate
define fsub = subtype *dsub
define fback = backtype*dback
define fsmooth = 1 - exp(min(sqr((x-wsub)/wsmooth)))
:
: ********** definition of variable values **********
:
: The values below decribe the exact properties of the
: doping profile that will be generated
:
ngrid = 400
nred = 8
ngate = 10
imp1type=ntype
imp2type=ntype
backtype=ntype
gatetype=ptype
subtype =ptype
gatepres=1
imp1pres=1
imp2pres=1
subpres =1
dback=7E14
dsub =2E14
dgate=1E20
nrp1 = 4E15
rp1 = 0.5*mu
drp1 = 0.7*mu
nrp2 = 3E15
rp2 = 2.5
drp2 = 0.7
wgate = 0.1*mu
wsub = 8.0*mu
wtot = 10.0*mu
wsmooth = 0.2*mu
: definition of the xgrid
: ngrid lines of data space are allocated and the
: x coordinate is filled according to the variable values.
alloc ngrid
x = (count/ndata)*wtot
x = x - (gatepres*wgate)
: the dope is computed using the predefined formulas
dope = fsmooth*((fgate*isgate)+(ischan*(fback+fimp1+fimp2))+(issub*fsub))
: for plotting purposes, the absolute value and the log of the dope
: are computed
absdope = abs(dope)
logdope = log(absdope)
: the channel region is selected by setting gate and substrate
: dope to zero in the data type chandope. Double integration gives
: the electric field strength and the gate voltage for a fully
: depleted channel (according to Poisson's equation).
chandope = dope*pos(dope*backtype)
inte chandope x efield
efield = efield*(q/eps)
emax=efield
efield=efield-emax
efield = efield*pos(dope*backtype)
inte efield x psi
vmax=psi
: A first impression of the result is gotten by viewing on the terminal
: in the channel (x>0.0) and the substrate (x=10 mu).
xls = 0.01*mu
xrs = 10*mu
view x absdope | psi $
: Using this picture, appropriate scaling values are chosen and a
: plot is made using forced scales, no colors and a reduced number
: of markers.
yls = 0.0
yus = 5E15
ryls = -70.0
ryus = +10.0
color=0
marker=1
mreduct=20
plot x absdope | psi $ Profile example2: Generation of a 'camel' dope profile
: The values of the maximal electric field and potential are printed
emax
vmax
quit
The plot obtained by this program is depicted on the next page.
#history (2.1.) Command History Mechanism - reduce typing effort.
The profile history mechanism enables you to repeat previously
entered commands. This may save a lot of typing effort.
The following history commands are valid:
h <- give an overview of the 20 most recently entered
commandlines.
!! <- repeat the last given command.
!-3 <- repeat the command 3 lines above the current
(!-1 equals !!).
!27 <- repeat the 27th command (from the start).
!hoi <- repeat the most recent command starting with "hoi".
The history mechanism may be combined with the command line editor.
See also help edit.
#edit (2.2.) Edit command lines in batch and interactively.
Typing errors may be corrected (or variants of previously given
commands may be generated) by using the command line editor:
prof> ^wrongstr^rightstr
replaces the first instance of 'wrongstr' in the last given
command line by 'rightstr'. Example:
prof> get dta.dat a b c $
Cannot open dta.dat.
prof> ^dta^data
get data.dat a b c $
15 lines.
A command line editor command may be preceded by any kind of
history command to indicate which line should be edited,
for example:
!-3^hoi^hai
!hoi^hoi^hai (See also help history.)
When using Profile in batch mode (by execution of a file with Profile
commands), it is possible to edit the commandline by putting a question
between question marks. This question will be asked on the screen and
will be replaced (including the question marks) by the answer typed by
the user. For example:
prof> get ?give input data file name? x1 y1 $
---- give input data file name: infile.dat <- answer typed by user
get infile.dat x1 y1 $
prof>
Because this operates on strings, it can be used for any required
answer, including numerical values. For example:
prof> var real a1 a2 $
prof> a1 = ?give the value of a1?
prof> a2 = ?give the value of a2?
Moreover, it is possible to temporarily halt the execution of Profile
with the pause command. This is demonstrated in the <tutorial.pro>
Profile command file as provided in the Profile example set. Or:
prof> pause
----------- Give <return> to continue ----->
#exec (2.3.) Read commands from a named file.
With exec it is possible to read profile commands from a file
instead of from the current file or from the screen. Exec's
may be nested up to a certain (high) level. If a profile session
executing from a nesting of exec's is closed (by the statement
quit) prematurely, profile gives an overview of files not read
to end.
Example:
prof> exec mymeas.def
The file mymeas.def may contain all data types and variables
definitions belonging to a certain measurement.
#log (2.4.) Save command lines in a named logfile.
Log enables you to save all your commands in a named file,
so that this file later can easily be used as (or turned into)
a profile batch command file. Log works as a toggle.
Example:
prof> log [logfile]
Logging turned on.
prof> log
Logging turned off.
Profile programs may be made by editting log files of trial sessions.
#quit (2.5.) Terminate a profile session.
The command quit checks if all exec files were closed,
and stops profile from executing. Example:
prof> quit
Cpu user time 12.4 sec. \ UNIX only
Cpu system time 6.9 sec. /
Quit may be issued from the screen and from files alike.
NOTE: if you use a Profile program in the background or with output data
redirect, don't forget to include a quit statement in your program
file, or Profile will wait quietly for it to arrive from the
terminal!
#silent (2.6.) Stop profile from talking to you.
Silent operates as a toggle that switches the verbal capabilities
of profile on and off. It is especially useful for stopping
large amounts of output generated by reading files with
definitions of data types etc. for a certain measurement.
Example:
prof> silent
Profile is muted.
prof> exec mymeas.def
prof> silent
Profile talks again.
#shell (2.7.) Escape to the operating system level.
You may from time to time wish to issue commands to the
operating system without leaving the profile program (and
thus loosing all generated data). This can be done by
using the shell escape %. By nature, profile knowns the names
of almost all relevant system commands and allows you to use
them without using this shell escape!
Example: (with the UNIX command ls)
prof> % ls
data1.dat data2.dat mymeas.def output1.out output2.out
But also:
prof> ls
data1.dat data2.dat mymeas.def output1.out output2.out
#comment (2.8.) Give input that is not executed.
Everything on a line that follows the string ': ' is
regarded to be comment and thus not executed.
Example:
prof> : This is a wonderful program
^
|
note: this space must be present.
prof> silent : now profile is mute.
Comments are not allowed behind expressions.
#data (3.1.) Data structure of the program Profile.
Profile processes data organized columnwise. Each column of
data represents a certain measured (or obtained otherwise)
quantity. Such a column is called a data type.
Data types are internally represented by double precision
floating point numbers.
Lines with data types may be processed (all alike) by specifying
arithmetic expressions involving data types, math functions
constants and also program variables.
Colunms (one or more data type) may be processed with a number
of dedicated processing commands (smoothing, differentiation,
integration etc.). See also help help.
Data types -> a b c count (present by default)
+----+----+----+----+
1 | 0 | 1 | 0 | 0 |
+----+----+----+----+
2 | 2 | 2 | 4 | 1 |
Data lines +----+----+----+----+
3 | 4 | 3 | 12 | 2 |
+----+----+----+----+
4 | 8 | 5 | 40 | 3 |
+----+----+----+----+
This situation may occur after reading a and b from file (see
help get) and applying the expression c=a*b (see help expression).
see also:
help defaults <-- overview of data types and constants that are
present by default.
help alloc <-- allocation of data lines without file reading
and using the data type count for data generation.
help var <-- declaration of a variable.
help type <-- declaration of a data type.
help show <-- get an overview of data types and variables
presently declared.
help clear <-- clear the program data space.
help recount <-- reset the default data type called count.
#alloc (3.2.) Allocate a certain number of data lines.
When data is read from file, enough data lines are allocated
automatically to contain the data. When computations have
to be done without reading data (for instance for data
generation using the default data type count), data lines
can be obtained with alloc. The default integer variable
ndata is set to the number of lines allocated.
An alternative way to allocate a number of data lines is
to set the default variable ndata to the desired number. If you
do that, the default variable count will not be recounted!
Syntax: alloc [number of lines]
or: ndata=[integer or integer variable]
Example:
prof> alloc 100
prof> ndata
100
prof> type kwadraat wortel $
prof> kwadraat = count*count
prof> wortel = sqrt(count)
Or:
prof> ndata=200
NOTE: if the default maximum number of data lines is not sufficient, a
larger number can be obtained by invoking Profile with option -n (see
help invoke). On the other hand, if there can not be declared a large
enough number of data types due to memory shortage, it may be possible
to reduce their default maximum length with option -n.
#type (3.3.) Declaration of a number of data types (columns).
Before using a data type (column of data), it must be declared to
profile with type.
Syntax: type [data types] $
^
|
dollar indicates end of types.
Example:
prof> type va vb vc ia ib ic ra rb rc $
Values may be assigned to a data type by reading data from file
(see also help get), or by evaluating an expression (see also
help expression) or by assigning values to the elements of the
data type separately (see also help assign).
The number of data lines is determined by the number of readable
lines that were present in the input file, or that were allocated
by the user (see also help alloc).
The maximum number of data lines in a data type, and therewith the maximum
number of data types given a certain memory size, can be changed by using
option -n (see also help invoke).
An overview of all user defined data types can be obtained by typing
prof> show types
Profile may refuse certain identifiers as type names. Most notably are
identifiers starting with a digit, or identifiers already in use, as
variables, data types, functions, command names or as recognized operating
system commands (e.g. ls and vi on UNIX).
#var (3.4.) Declaration of a number of program variables.
Program variables contain values that may be used in the evaluation
of expressions with data types. They may also be used for
computations that do not need data types.
Before using a variable, it must be declared to profile with var.
Profile knows both real and integer variables. They should be
declared separately.
Syntax: var [variable kind] [variables] $
^
|
dollar indicates and of variables
Example:
prof> var real vds id $
prof> var int nvolt ncount $
Values may be assigned to variables by evaluating an expression:
prof> vds=0.1
A number of variables is present by default. See also help defaults.
An overview of all user defined variables may be obtained by typing
prof> show vars
As with the decalartion of data types, not all identifiers are
acceptable as a variable name. See help type.
#assign (3.5.) Give values to individual elements of data types.
Assign makes it possible to approach the individual elements of the
data array consisting of a data type.
Syntax: assign [data type name] [index nr.] [value] [...] $
Example:
prof> type x3 $
prof> ndata=6
prof> assign x3 2 3.7 4 3.9 6 4.1 $
This will result in
x3 value
------+--------
[1] 0.0
[2] 3.7
[3] 0.0
[4] 3.9
[5] 0.0
[6] 4.1
#extract (3.5.) Obtain the value of one data type element.
Extract makes it possible to obtain the values of individual elements
of the data array consisting of a data type. Extracted values are
printed to the screen and may also be assigned to a real variable.
Syntax:
extract [data type name] [index nr.] [real variable name] or
extract [data type name] [index nr.] $ (printing only)
Example:
prof> type array $
prof> var real element $
prof> ndata=10
prof> array=count/2
prof> extract array 4 element
array[4]=1.5
prof> element
1.5
#clear (3.6.) Remove data from the data space.
Clear removes all data read from file from the programs data space.
However, it keeps all data type and variable declarations and
also the current values of the variables. Definitions of
expressions (see help define) are maintained as well.
Example:
prof> clear
#recount (3.7.) Reset the default data type count.
When data space is allocated, either by getting data from file
(see help get) or by using the alloc keyword (see help alloc),
automatically a data type named count, defined by default,
is enumerated from 0 to ndata-1. After removing, reducing or
sorting data, the enumeration in count will be garbled. Count
can be enumerated again from 0 to the (new) ndata-1 by giving
recount.
Syntax: recount
Example:
prof> recount
The default type count can be used to reorder data after sorting, but
also for data generation (see help example2). Count is set by using
the commands alloc or get to acquire data. Changing the default variable
ndata does not affect count.
#defaults (3.8.) Data types and variables present by default.
A number of data types are present immediately after the program
has been invoked.
They are called tmp1, tmp2, ... , tmp5 and may be used by either
profile data manipulation commands or by the user in definitions
of expressions as temporary storage of data. NOTE: the tmp types
easily get corrupted by using commands such as diff or map!
Another data type present by default is count. Count is enumerated
0 to ndata-1 when reading data from file (by using get) or when
allocating data space (by using alloc).
Count can be re-enumerated using the command recount.
The last default data type is weight. It is used by the polynomial
curve fitter fit, and also by the non-linear optimizer levmar, as a weight
function. Its default value is 1.0 for all elements.
A number of program variables are also default present. They are:
+---------+---------+-------------------------------------+
integers: | name | value | meaning |
+---------+---------+-------------------------------------+
| ndata | 0 | number of data lines available |
| nsmooth | 1 | order of moving average smoother. |
| npoly | 12 | highest order of polynomials |
| | | in curve-fit for differentiation. |
| nfit | ndata | last data line used for curve-fit. |
| wtype | 0 | kind of weight function in |
| | | polynomial curve fit. |
| verbose | 1 | fit talks (1) or is silent (0) |
| putprec | 6 | significant digits in output file |
+---------+---------+-------------------------------------+
| ticks | 0 | how many ticks in the 1D plot |
| line | 1 | lines are to be drawn in plot |
| marker | 0 | markers are to be drawn in plot |
| lstyle | 0 | solid lines (0) or different styles|
| color | 1 | different pens (1) or all pen #1 |
| asize | 4 | A3 or A4 papersize to be used |
| docadre | 10 | Level of framework in the plot |
| pencadre| 1 | Plotter pen used for framework |
| pendata | 8 | Plotter pen for data (color=0) |
+---------+-+-------+-------------------------------------+
| lprwidth | 130 | width of printer plot with graph |
| lprheight | 65 | height of printer plot with graph |
+-----------+-------+-------------------------------------+
+---------+-----------+-----------------------------------+
reals: | name | value | meaning |
+---------+-----------+-----------------------------------+
| q | 1.602E-19 | magnitude of electronic charge. |
| eps0 | 8.854E-14 | dielectric constant of vacuum. |
| epssi | 11.9 | relative eps of silicon. |
| epsox | 3.4 | relative eps of silicon-dioxide. |
| k | 1.381E-23 | Boltzmann's constant. |
| ni | 1.1e+10 | intrinsic concentration T=300K. |
| pi | 3.1415926 | mathematic pi. |
| e | 2.71828 | base of natural logarithm. |
| maxabb | 0.05 | maximal kept abberation in clip. |
+---------+-----------+-----------------------------------+
| xls | 0.0 | left x-axis scaling value (view) |
| xrs | 0.0 | right x-axis scaling value (view) |
| yls | 0.0 | lower y-axis scaling value (view) |
| yus | 0.0 | upper y-axis scaling value (view) |
| ryls | 0.0 | right y-axis scaling value (view) |
| ryus | 0.0 | right y-axis scaling value (view) |
+---------+-----------+-----------------------------------+
| xoffset | 0.0 | x-offset of data plot in cm |
| yoffset | 0.0 | y-offset of data plot in cm |
| xrelsize| 1.0 | relative size of plot in x-dir |
| yrelsize| 1.0 | relative size of plot in y-dir |
+---------+-----------+-----------------------------------+
#expression (4.1.) Evaluation of mathematical expressions.
Profile evaluates mathematical expressions that are typed to it.
These expressions may contain the following operands and operators:
1. Constant values (such as 2.3, 1E17);
2. Previously declared program variables (such as pi);
3. Previously declared data types (columns of data) (such as tmp1);
4. Previously defined expressions (see help define);
5. A number of mathematical functions (see help functions)
6. The following binary operators (with two arguments):
* <- multiplication
/ <- division
+ <- addition
- <- substraction
~ <- real power ( x~y = exp(y*ln(x)) )
@ <- integer power ( x~n = x*x*x*x* ... )
7. Left ('(') and righ (')') parentheses.
The preferent order of execution of binary operators is (by the
European convention): first ~,@, then *,/, then +,-. This preference
may be superseded by using parentheses.
The results of an expression may be either a data type or a program
variable. This difference is understood automatically by Profile.
Examples:
prof> 3-2/4 <--- this allows use of profile as a pocket calculator
2.5
prof> pi <--- pi is a program variable
3.1415
prof> a <--- a is a data type with four lines of data
0
2
4
8
prof> c=a*b <--- data type c gets the value of a * b (for each line)
prof> c=ln(a/pi) <--- variables, functions and data types may be mixed
See also:
help define <-- how to define and save an expression.
help functions <-- what mathematical functions are available.
help show <-- get an overview of data types, variables
and definitions.
#define (4.2.) Define an expression and save it for later use.
Profile allows the (hierarchical) definition of expressions
(see also help expression) in the following manner.
Example:
prof> define teller=a*b*c
prof> define noemer=e*f*g
prof> define breuk=teller/noemer
prof> d=breuk
This define mechanism is especially helpful if an expression
has to be used many times in a measurement data processing program.
It also helps in saving temporary storage:
prof> tmp1=a_very_long_expression
prof> tmp2=a_even_longer_expression
prof> result=tmp1~tmp2
can be replaced by (also gaining clarity)
prof> define root=a_very_long_expression
prof> define power=an_even_longer_expression
prof> result=root~power
An overview of all expression definitions can be obtained
by typing
prof> show defines
#functions (4.3.) Available mathematical functions.
The following functions of one argument may be used in expressions:
+----------+--------------------------------+
| name | description |
+----------+--------------------------------+
| min | complement: min(x) = -x |
| inv | inversion: inv(x) = 1/x |
| abs | absolute value: abs(x) = |x| |
| exp | natural exponent |
| ln | natural logarithm |
| log | logarithm with base 10 |
| sqr | square: sqr(x) = x*x |
| sqrt | square root |
| sin | sine |
| cos | cosine |
| tan | tangent |
| arcsin | inverse sine |
| arccos | inverse cosine |
| arctan | inverse tangent |
| sinh | hyperbolic sine |
| cosh | hyperbolic cosine |
| tanh | hyperbolic tangent |
| erf | error function |
| erfc | complementary error function |
| lngamma | natural log of gamma function |
| fac | factorial (rounds to integers) |
| trunc | truncation to integer number |
| pos | 1 if x > 0, otherwise zero |
| neg | 1 if x < 0, otherwise zero |
| sgn | 1 if x>0, 0 if x=0, -1 if x<0 |
| pls | 1 if x = 0, otherwise 0 |
| zdiv | 1 if x = 0, otherwise x |
+----------+--------------------------------+
The following functions of two arguments were taken from Numerical Recipes
(The Art of Scientific Computing) by W.H. Press et al. (Cambridge UP):
+---------------+---------------------------------------+
| name | description |
+---------------+---------------------------------------+
| pgamma (a,x) | incomplete gamma function |
| qgamma (a,x) | 1 - pgamma(a,x) |
| poisson(k,x) | cumulative Poisson distribution |
| pchisq (c,n) | chi-square distribution |
| qchisq (c,n) | 1 - pchisq(chi2,nu) |
| betaf (x,y) | F-distribution function |
| student(t,v) | Student distribution function |
| bessj (n,x) | Bessel function J of order n |
| bessy (n,x) | Bessel function Y of order n |
| bessk (n,x) | Modified Bessel function K of order n |
| bessi (n,x) | Modified Bessel function I of order n |
+---------------+---------------------------------------+
#show (4.4.) Give an overview of all declared variables and types.
The command show gives an overview of all user declared
data types or variables, or of all defined expressions.
Data types or variables present by default are not shown.
See also help defaults.
Examples:
prof> show vars
prof> show types
prof> show defines
#do (5.1.) Start a repetitive sequence.
Do can be used to tell Profile that all the commands following
do until the command od is found should be repeated n times.
It is a (rather primitive) way to implement iterative computations.
Do-od loops cannot be nested.
syntax: do [number of times]
example:
prof> b=starting_value_for_b
prof> do 5
prof> a=compute_a_from_b
prof> b=compute_b_from_a
prof> od
prof> print a b $
#od (5.1.) End of a repetitive sequence.
Od is used in conjunction with do to mark a command sequence that
should be executed n-times.
See help do for an example.
#get (6.1.) Read data types (columns of data) from a file.
Get is used to obtain the data that should be processed from a
file. It assumes the data to be organized columnwise.
Get ignores unreadable lines (such as headings) in these files.
A startmark (text strings occuring at the start of a line) and
endmark (idem) may be defined using the startmark and endmark
commands. If this is done, get starts reading after the first line
starting with the startmark, and stops reading directly after
the endmark.
If no start- or endmark are defined, get scans the whole file.
If the first non-empty line of the input file contains the names
of the data columns, these may be used as data type names.
The data type names that have been read are remembered and can be
used again by put, print and view (so-called last read types).
syntax:
get [data file] [data types] $
^
|
indicates end of data types.
or, if the file contains a heading with columnnames:
get [data file] $
Example:
prof> get data.dat vg i didv c $
prof> get data.dat $
If there are more data lines in the file than the maximum number
of lines per data type, only the maximum number will be read. The
current maximum can be asked for by giving the command status. It is
possible to change the maximum number of lines per data type using the
program option -n (see help invoke). This allows for a tradeof between
the maximum number of types and the maximum number of lines.
#startmark (6.2.) Define a starting marker for reading from file.
If a string is specified with startmark, the data reading command
get starts reading after the startmark string has occurred the
first time at the beginning of an input line. This input line itself
is not scanned.
The special startmark string bof (begin-of-file) indicates that
get should start reading at the first line of the file. Bof is
the default value of the starting marker.
Syntax: startmark [text string]
Example:
prof> startmark eerste_meting
prof> startmark bof
NOTE: once set, a startmark remains valid until it is reset by giving
startmark bof.
#endmark (6.3.) Define an ending marker for reading from file.
If a string is specified with endmark, the data reading command
get stops reading after the endmark string has occurred the
first time at the beginning of an input line. This input line
itself is not scanned.
The special endmark string eof (end-of-file) indicates that get
should read until the end of the input file. Eof is the default
value of the ending marker.
Syntax: endmark [text string]
Example:
prof> endmark tweede_meting
prof> endmark eof
NOTE: once set, an endmark remains valid until it is reset by giving
endmark eof.
#put (6.4.) Write data to a file.
Put writes the contents of named data types to a named file and
puts a heading with the names of the data types above the columns
of data.
The number of significant digits in the result is controlled by the
integer variable putprec. The default value is 6.
If the put command line ends in a dollar sign $, all data lines are
written to file. However, it is possible to select a range of lines
to be put by ending the command line in | [line-nr] [line-nr].
If no data types are specified, put will write the data types last
read in (see also help get).
Syntax: put [output file] [data types] $
^
|
indicates end of data types.
or (for selecting a certain part of the data lines)
put [output file] [data type names] | [start line nr] [end line nr]
or (for remembered last read data type names):
put [output file] $
or put [output file] | [start line nr] [end line nr]
Example:
prof> put data.out vg i dgdv ng $ : all lines
prof> put dat2.out vg i didv | 12 ndata : between 12 and ndata
prof> var int half $
prof> half=ndata/2
prof> putprec=8 : 8 significant digits
prof> put data.out $ : all lines
prof> put dat2.out | half ndata : only last half
#print (6.5.) Print columns of data on the screen.
Print writes the contents of named data types to the screen, and
puts a heading with the names of the data types above the columns
of data.
If the print command line ends in a dollar sign $, all data lines are
written to the screen. However, it is possible to select a range of lines
to be printed by ending the command line in | [line-nr] [line-nr].
If no data type names are given, the remembered names of the data
types last used will be printed.
Syntax: print [data types] $
^
|
indicates end of data types.
or (for selecting part of the data lines)
print [data types] | [first line nr] [last line nr]
Example:
prof> print vg i dgdv ng $ : all data lines are printed
prof> print vg i dgdv ng | 1 10 : only lines 1 to 10
prof> print $ : last read data types are printed
prof> print | 50 ndata : from line 50 to end
#putvar (6.6.) Write variable values to file.
See also: help exec, help var, help levmar.
Syntax: putvar [file name] [real or integer variables] $
Putvar is used to write values of Profile real and integer variables
to file in a format such that they can be read again by Profile
using the exec command:
[var1 name] = [var1 value]
[var2 name] = [var2 value]
... ...
This can be used to transfer data between two Profile programs,
or to communicate variable values to another program, e.g. Prof2d.
If an instance of Profile is used as a data conversion tool between
the levmar optimization driver and an external program, it may also
be used to write changed model parameters to the external program.
Example:
Profile program nr. 1:
prof> var real psi eps1 kappa gamma $
prof> var int ngates nfields $
prof> ...
prof> putvar examvars.dat ngates psi eps1 nfields kappa gamma $
Profile program nr. 2:
prof> var real psi eps1 kappa gamma $
prof> var int ngates nfields $
prof> exec examvars.dat : read variable values
#view (7.1.) Plot data types on video terminal or P.C. screens.
see also: help term.
View uses the (sometimes limited) graphical possibilities of video terminals
to draw a graph of one or more data types. The resolution of the obtained
pictures depends on the terminal type and is about 100*110 "pixels" on video
terminals which do not support graphics possibilities. This is enough to allow
previewing of plots to be made with the command plot.
Profile knows several terminal communication protocols, one of which may
be chosen by using the command term. An overview of the available types
can be found on the term manual page.
If no data type names are specified, the remembered names of the data
types last read will be used, with the first type as x-type (see help get).
Data types can be plotted on one y-axis (on the left side) or two
y-axes (on the left and right side). Both are scaled independently.
View provides both autoscaling facilities and forced scales. Scales can
be forced using the predefined real variables
xls <-- extreme left value of x-axis
xrs <-- extreme right value of x-axis
yls <-- extreme lower value of left y-axis
yus <-- extreme upper value of left y-axis
ryls <-- extreme lower value of right y-axis
ryus <-- extreme upper value of right y-axis
Autoscaling is presumed if xls >= xrs, etc. This is the default
situation. A grid is drawn in the graph if the predefined integer
variable gridon is set to 1.
Syntax: view [x-axis data type] [left y-axis data types] |
[right y-axis data types] $
Examples:
prof> type x y1 y2 y3 y4 $
.
.
.
prof> view x y1 y2 | y3 y4 $ : both left and right y-axes
prof> view x y1 $ : only the left y-axis
prof> xls=0.0 : \
prof> xrs=10.0 : | limit the
prof> yls=-1.5 : | displayed area
prof> yus=11.5 : /
prof> !view : repeat last view
prof> view $ : view last read data types
#graph (7.2.) make a graph to be printed on one line printer sheet.
See also: help view.
Graph operates in a fashion quite similar to view, except that the
resultant plot is composed of printable characters and can be printed
on exactly one standard page of the line printer.
The usual practice will be to preview a graph with view and than obtain a
hardcopy with plot or graph.
Graph is especially useful for those who desire hardcopy of their graph
but do not have available a HP-GL penplotter (see help plot).
On UNIX systems, the graphical information is written to the terminal
and can be caught in a file by standard UNIX shell redirect
(prof in non-interactive mode). It will be preceded and followed by
a Form-Feed character (ASCII decimal 12), thus simplifying alignment
on the line printer.
On MS-DOS PCs, the output is printed on a printer connected to the
parallel port #1 (LPT1). Form-Feeds are not used.
In addition to view, it is possible to specify a title to be printed
above the graph.
The size of the graph can be chosen using the default integer variables
lprwidth and lprheight. These are defaulted to a big one page (130*65)
graph (see also help defaults).
Syntax: graph [x-axis data type] [left y-axis data types] |
[right y-axis data types] $ title-text
Example (on UNIX systems):
In file graph.pro :
lprwidth=100
lprheight=40
graph x y1 y2 | y3 y4 $ this a plot of y1, y2, y3 and y4
or:
graph $ : last read data types
UNIX C-Shell prompt % profile graph.pro > lpr.out
UNIX C-Shell prompt % lpr lpr.out
#plot (7.3.) plot data on an HP-GL compatible penplotter.
See also: help view, help graph, help setplot, help defaults.
The installation manual page.
Syntax:
plot [x-axis] [left y-types] | [right y-types] $ comm1 | comm2 | comm3
Plot is the profile facility for making a hardcopy of what you see on
the screen when using view. All the features mentioned for view are also
available with plot. Obviously, plot offers a much better resolution for
the data to be plotted and also some extra features. These are regulated
by the following predefined integer variables:
- line (if 0 <- No lines are drawn, otherwise lines)
- marker (if 0 <- No markers are drawn, otherwise markers)
- lstyle (if 0 <- All lines are solid, otherwise different styles)
- color (if 0 <- All plotted with pen 1, otherwise all pens)
- asize (Chosen papersize. asize=4 <- A4, asize=3 <- A3)
- ticks (2 for 9 ticks, 1 for 1 tick and 0 for none)
The default setting is a colored plot in solid lines without markers.
It is also possible to specify exactly for each data type how it should
be plotted. This is done by the separate command setplot (see
help setplot).
The syntax is identical to that of view and graph. A title of the
plot (as in graph) may be specified and will be plotted.
For presentation graphics, it is possible to influence the plot's
appearance and size by using the following predefined variables:
- docadre (10 -> plot all, 5 no outer framework, 0 no text at all)
- pencadre (pen number to plot the outer and graph frameworks)
- pendata (pen number to plot data if color=0)
- xoffset (shift in cm of the plot in the x-direction)
- yoffset (shift in cm of the plot in the y-direction)
- xrelsize (relative size of the plot in the x-direction, normal = 1.0)
- yrelsize (relative size of the plot in the y-direction, normal = 1.0)
To get a plot on a terminal system, the plotter can be in between
the terminal and the computer and must operate in eavesdrop mode with
xon/xoff handshaking. Also, with the plotfile command a plotter
accessable as file in the file system can be selected.
On the IBM-PC, the plotter must be connected to the RS232 COM1 serial
data output and operate in standalone mode with hardwired handshaking.
The plot description (in HP-GL language) can be caught in a file
instead of sent to the plotter with the plotfile command.
Consult the installation manual page for more information and for the
correct plotter settings.
#setplot (7.4.) Set plotting style per data type separately.
Setplot can be used together with the plot command to
choose for each data type that is to be plotted on the HP-GL
plotter what plotting style is to be used. A setplot definition
completely overrules the choices made with the predefined variables
line, lstyle and color.
Syntax: setplot [pennr][lstyle][marker] [...] | [...] $
setplot $
The following attributes may be specified:
1. pen number - defines which pen must be taken to plot this
data type (and thus which color will be used).
2. line style - defines which line style must be used.
Available line styles are:
0 - no line is to be drawn
1 - solid line: ________________________________
2 - like this: ____ ____ ____ ____
3 - ______ ______ ______ _____
4 - ______ . ______ . ______ . _____
5 - ______ _ ______ _ ______ _ _____
6 - ____ _ _ ____ _ _ ____ _ _ ____ _
3. marker - defines what marker must be used. 0 indicates no
marker, 1-10 makes a choice out of:
1 - box 6 - octogon
2 - circle 7 - asterisk
3 - diamond 8 - triangle up
4 - plus 9 - triangle down
5 - times 10 - circle with plus
For each data type to be plotted, all three attributes are
specified by three integer number in one string. Left and right
data types are separated by |, as with view/plot itself. If only a
$ ending symbol is given, previous setplot settings are defaulted
and the line/lstyle/color variables regain control. If more data
types are plotted than specified, the non-specified ones get a
default specification 110.
Example:
prof> setplot 110 210 310 410 | 121 131 141 151 $
prof> plot x y1 y2 y3 y4 | z1 z2 z3 z4 $ demonstration setplot
prof> setplot $
prof> color=1
prof> lstyle=0
prof> plot x y1 y2 y3 y4 $
#term (7.5.) Select a video terminal protocol.
See also: help adapt (IBM-PC only).
Syntax: term [term-type]
or term ? to ask the current terminal type,
and a list of available types.
Example:
prof> term vt100
prof> term ?
The following device protocols for displaying graphs are available:
dialup : Plain 80*24 character terminal screen.
vt52 : DEC vt52 protocol (uses graphics charcters).
vt100 : DEC vt100 or ANSI protocol (uses graphics charcters).
vt200 : Reduces to vt100 protocol.
cit224 : Reduces to vt100 protocol.
vt102 : Equals vt100 but limited to 80 characters width.
cit101 : C. Itoh cit101 terminal protocol (special graphics charcters).
tek4010 : Tek4010 graphics protocol for Tek 4010 compatible terminals.
mskermit: Uses the Tek4010 mode of the MS-Kermit terminal emulator.
Automatic switching between vt102 and Tek4010 emulation.
xterm : Tek4010 emulation of the X-Windows xterm terminal emulator.
vt240 : Tek4010 emulation of the DEC vt240 terminal.
vt340 : Tek4010 emulation of the DEC vt340 terminal.
hp98550 : To be used on the console of the HP9000-350 workstation with
HP98550 graphics card. Invokes separate Starbase Tek emulator.
apollo : Uses GDL graphics on the Apollo Domain workstations.
ibmpc : Produces a graph on the IBM-PC. The resolution of this graph
depends on the Video Adaptor Card present. This card is sensed
automatically but may be set by the command adapt.
atari : 640x400 proprietary Atari ST graphics.
local : Locally implemented graphics device driver in file local.c
(see the Profile/Prof2d System Programmers Manual section 2.4).
On UNIX systems, Profile asks the system shell what the current terminal
type is and uses that type as a default. This default can be changed with
term within profile or with setenv profterm [term-type] in the C-Shell.
Only on mainframes (UNIX, VAX/VMS) all terminal types are supported;
on Personal Computers and workstations, the appropriate type is default.
#adapt (7.6.) Select an IBM-PC Video Adaptor Card (Graphics).
Syntax: adapt [adaptor name] <- set adaptor card type
adapt ? <- print current and possible adaptors
Profile automatically senses what Video Adaptor Card is present in your
IBM-PC or compatible. The following adaptors are recognized:
Color Graphics Adaptor (CGA) <- 640 x 200 resolution (mode 06H)
Compaq Graphics Adaptor <- Will be treated as CGA
Enhanced Graphics Adaptor (EGA) <- 640 x 350 resolution (mode 10H)
Olivetti/AT&T 6300 Adaptor <- 640 x 400 resolution (mode 40H)
VGA graphics adaptor <- 640 x 480 resolution (mode 12H)
Super VGA adaptor (HPVGA) <- 800 x 600 reoslution (mode 58H)
Hercules Monochrome Adaptor <- 720 x 348 resolution
Apparently no Graphics Adaptor <- Character Graphics (75 x 100)
If unexpectedly Profile senses the WRONG video adaptor, you may set one of
the above choices using the new Profile command adapt. Giving
prof> adapt ?
will provide you with a list of all adaptors. Be sure to type the adaptor
name exactly correct (capitals!).
Hardcopy of a graph on the screen may be obtained by typing
<shift><PrtSc>.
Be sure that the printer is switched on and on line, and be sure to
execute the MS-DOS program GRAPHICS before invoking Profile. It is
preferred to put a call to graphics in your autoexec.bat file.
#plotfile (7.7.) Specify an output file for (HP-GL) plotter data
Syntax: plotfile [filename]
plotfile $ <- Reset to default state
Examples:
prof> plotfile hpgl.dat
prof> plotfile /dev/plotter
prof> plotfile $
By default, HP-GL plot descriptions are sent to the terminal or
to the RS232 interface of the IBM-PC. Using the command plotfile
however makes it possible to store the plot description in a
named file. In this way the plotting can be performed later, or
the plot description can be saved.
The defined plotfile remains valid and will be overwritten until
a new one is defined or the default situation is restored (use $).
On UNIX systems, it may also be attractive to send the HP-GL data
stream to a plotter device present as a virtual file in the file
system. This file can be named using plotfile.
Note for system programmers: it is possible to change the
default plot destination in the source code.
#viewfile (7.7.) Specify an output file for graphical screen data
Syntax: viewfile [filename]
Examples:
prof> term tek4010
prof> viewfile tek4010.dat
prof> view x y z $
Viewfile can be used to catch the graphical description of a screen
image in a file. The nature of the description depends on the terminal
type selected with the command term. The definition of the viewfile
is only used once, afterwards the output is sent to the screen again.
Viewfile is especially useful to save a TEK4010 graphical image
description for later printing on a Laser printer that has a TEK4010
emulation mode. An example of such a printer is the LPS40 installed
at the DARF facilities of the Faculty of Electrical Engineering,
Delft University of Technology. This printer can be reached on the
VAX 11/750 with network name TUDEDV.
#sort (8.1.) Sort the data lines to a data type.
Sort shuffles the data lines (for all present data types)
in such a way that a named data type becomes sorted (from
small to large).
Often you will want to sort the default type count.
Syntax: sort [data type]
Examples:
prof> sort vg
prof> : sort in reverse order
prof> vg = min(vg)
prof> sort vg
prof> vg = min(vg)
To restore the previous order of the lines, use data type count:
prof> sort count
#remove (8.2.) Remove a given number of data lines.
Removes the data lines between to given boundaries.
The boundary $ is understood to be the last data line.
Syntax: remove [n1 n2]
Examples:
prof> remove 12 14
prof> remove 100 $
prof> remove 1 1 : <--- removes line #1 only.
prof> remove n1 n2 : <--- use integer variables.
#reduce (8.3.) Remove data lines at regular intervals.
Reduce n deletes from every n data lines the last n-1.
Reduce is especially useful to 'thin' data on which
numerical differentiation is difficult because of too small
intervals dx.
Syntax:
reduce [n]
Example:
prof> reduce 10
prof> reduce nreduct
#insert (8.4.) Insert empty data lines below a certain line.
Insert inserts a given number of lines containing value 0.0 below
a given line. It can be used to reshape data to a form e.g. more
useful to do a curvefit or a comparison with other data.
Syntax:
insert [below-line-nr] [nr-of-lines]
Examples:
prof> ndata
25
prof> insert 2 7
Number of data elements set to 32.
prof> insert nbelow ninsert : <-- use integer variables
#smooth (8.5.) Make data smooth with a moving average filter.
Smooth applies a moving average filter to a given data
type. The order of this filter is given by the default variable
nsmooth. At the edges of the data type, the smoothing order
is asymmetrically reduced.
Syntax: smooth [data type]
Example:
prof> nsmooth=3
prof> smooth didv
#mono (8.6.) Make a data type (column of data) completely monotonous.
Mono removes noise from data by making a data type
completely monotonous. The first data element is
compared with the last to determine if the type is
ascending or descending. Plain linear interpolation
is used.
Syntax: mono [data type]
Example: prof> mono dgdv
#clip (8.7.) Remove noise peaks by linear interpolation.
Clip removes data points that are abberant more than a certain
relative value (maintained in the real constant maxabb)
from the average of their neighbours. It is then replaced
by exactly this average.
Clip can be used to remove strange peaks from data (caused
by electrical disturbances etc.)
Syntax: clip [data type]
Example: prof> maxabb=0.02
prof> clip noisy_data
#polar (8.8.) Convert rectangular to polar coordinates.
The command polar converts the contents of two data types that describe
a two-dimensional or a complex quantity in rectangular coordinates to
two data types representing the same quantity in polar coordinates, or
(x,y) -> (r,phi)
by r = sqrt(x**2 + y**2) and phi = arctan(y/x).
If x=0 and y!=0, phi is set to either pi/2 or -pi/2, depending
on the sign of y. If both x and y are 0, phi is set to 0 as well.
Syntax: polar [x-type] [y-type] [r-type] [phi-type]
Example: prof> type time real imag amplitude phase $ : declare types
prof> get data.data time real imag $ : read complex data
prof> polar real imag amplitude phase : convert
prof> view time amplitude | phase $ : show data
#rect (8.8.) Convert rectangular to polar coordinates.
The command rect converts the contents of two data types that describe
a two-dimensional or a complex quantity in polar coordinates to two data
types representing the same quantity in rectangular coordinates, or
(r,phi) -> (x,y)
by x = r*cos(phi) and y = r*sin(phi).
Syntax: rect [r-type] [phi-type] [x-type] [y-type]
Example: prof> type time real imag amplitude phase $ : declare types
prof> ndata=100 : \
prof> time=count/(ndata-1) : | data
prof> amplitude = 4*exp(-time/1.23) : | generation
prof> phase=time*2*pi : /
prof> rect amplitude phase real imag : convert
prof> view time real imag $ : show data
#fit (9.1.) Do a polynomial curve-fit on measurement data.
The command fit allows you to fit a recursively defined
polynomial to measured or otherwise generated data. The method used
was developed by Ralston (see reference) and is quite reliable.
It minimizes the sum of the squared errors between the fitted and the
measured data. A weight function for the sum of errors can be used.
It operates correctly on unequally spaced x-axis data.
The best fits are obtained if you first do a coordinate-transformation
that makes your data look as much as possible like a straight line
(i.e. y=ax+b.) Often a physical model is present that allows this.
In the example (below) such a coordinate transformation is decribed.
It may be desired to give a different weight to the data element
values. This is possible through default variable wtype and the default
data type weight. The latter is initiated to 1.0 for all elements.
As a weight function value w[i] the absolute value of weight[i]
will be used (see also below).
As the Ralston polynomials (and their derivatives) are computed
recursively, the polynomial coefficients are not explicitly known.
This version of profile does not compute them.
After the fitting process, data types tmp1-tmp4 will contain the
following information:
tmp1 - the first analytical derivative of the fitted polynomial
tmp2 - the second analytical derivative of the fitted polynomial
tmp3 - the numerical values of the weight function used
tmp4 - the numerical values of the fitted polynomial itself
Several default variables are available to control the fitting:
- The maximal order of the Ralston polynomials
is given by the variable npoly.
If you choose npoly=1, linear regression is effected.
- The weight function of the squared errors is
chosen by the variable wtype:
wtype = 0: w(x) = absolute value of data type weight(x)
(defaulted to 1.0);
wtype = 1: w(x) = (2*max(|y|) - |y|)/max(|y|);
wtype = 2: w(x) = min(|y|)/|y|.
The last two weight functions favour the accuracy
of the fit on smaller data values. A user-defined weight
function may be computed and put in data type weight.
- The variable nfit sets the last data element that
used in the fit. It may be used to exclude bad elements
in data tails from fitting without throwing them away.
- The variable verbose lets fit talk to you (if verbose > 0)
or be silent (verbose=0). If fit talks, it will give you
a performance indicator in the form of the fitting variance.
If the variance starts to increase (ratio > 1), the optimal
fitting order has been reached (in rough approximation).
Syntax:
fit [y data type] [x data type] [fitted y data type]
Example:
A fit is made on measured C(V) data. It is known from theory
that the C(V) curve behaves approximately as
C(V) = K/sqrt(V-Vbi).
In fact it are the deviations from this ideal formula that attracts
our interest. We will first do a coordinate transformation, then choose a
suitable weight function, perform the curve fit and transform back.
prof> type c v x y cfit yfit dcdv $
prof> var real vbi $
prof> get cv.dat v c $
prof> vbi=0.8
prof> x=sqrt(v-vbi)
prof> y=1/c
prof> weight=sqrt(y)
prof> wtype=0
prof> fit y x yfit
prof> cfit=1/yfit
prof> diff num cfit v dcdv
prof> view v c cfit | dcdv $
Reference: Anthony Ralston, A first course in Numerical Analysis,
McGraw-Hill, New York 1965, pp. 235-243.
#diff (9.2.) Differentiate by subtraction or by curve-fit.
Diff computes the derivative of data type <y> with respect
to data type <x> and stores the result in data type <dydx>.
Two methods of differentiation are available:
1. Numerical, by subtraction.
A symmetrical difference formula is used:
dydx(i) =[y(i+1)-y(i-1)]/[y(i+1)-y(i-1)],
except at the edges where forward (i=0) resp. backward
(i=ndata) differences are taken.
If the measurement accuracy of your data is not very high,
or if the data are distorted by noise, previous smoothing
is highly recommended. See also help smooth.
2. By polynomial curve-fit.
Differentiation is also possible by fitting a
polynomial to the data, and computing analytically
the 1st (and even 2nd) derivative of this polynomial.
Due to the curve-fitting, this method smoothes itself.
A polynomial curve-fit differentiation method is
provided with the help of the Ralston polynomials
fitter that is described in detail under help fit.
All default data types and variables that are used
for fit can also be used here.
Experience has shown, that the best way to differentiate
measurement data is the following procedure:
a. first fit a data type to your data using fit;
b. then differentiate the fitted result numerically
using diff num.
Syntax: diff [method] [ytype] [xtype] [dydxtype]
Example: prof> diff fit i vg didv
prof> diff num ifit vg didv
#inte (9.3.) Perform numerical integration by Trapezium Rule.
Inte asks for the data type which represents x, the data
type which represents y, and the data type that has
to contain the integral over all the data lines of ydx.
Then it computes this integral with the trapezium rule, or
x
/
ydxtype = | ydx'
/
0
The starting value of y is considered to be zero.
It can be added to y separately, if desired.
Syntax: inte [y type] [x type] [ydx type]
Example:
prof> type rho xe charge $
...
prof> inte rho xe charge
prof> charge = charge + start_charge
#sum (9.4.) Perform summation of a data type's element values.
Sum computes the cumulative sum of the contents of a data type
for all the lines of the data space. It asks for the data type that must
be summed, and for the data type that must contain the result.
The final sum may be obtained by assigning the result data type to
a real variable (the last data element is then used).
Syntax: sum [data type] [result data type]
Example:
prof> type money cumusum $
prof> var real treasure $
...
prof> sum money cumusum
prof> treasure=cumusum
#compare (9.5.) Make a squared difference comparison.
Compare makes a squared differences comparison between two
data types. The absolute value of the sum of differences
is printed. The sum of the differences relative to the
data type named secondly is also printed.
Compare may be useful to study the effect of an iterative
process on a data type.
Absolute difference: sum(sqr(y1(i)-y2(i)))
Relative difference: sum(sqr(y1(i)-y2(i)))/sum(sqr(y2))
Syntax: compare <type1> <type2>
Example: prof> compare didv tmp5
#map (9.6.) Map data from an existing x-axis to another one.
Map can be used for transferring an (x,y) set of data types to
another set (x',y') by linear interpolation. This can be useful for
- Simultaneously processing data that have been acquired separately
and thus are given as a function of different x-axes;
- Zooming in (or out) on data or a piece of data, e.g. for more
accurate determination of the x-value for which two y data types
are equal.
Map allows the x-axes to be of different size (expressed in number
of data lines) and to run in opposite directions. The two x-axes
need not fully coincide. If the mapping x-axis exceeds the
existing x-axis, the first or the last existing y-value will be
used to expand the mapping y-axis. If the existing x-axis exceeds the
mapping x-axis, only the appropriate part is mapped.
Syntax:
map [existing x] [existing y] [nr of lines] [map x] [map y] [nr of lines]
Example:
Two files are read with equivalent data on different x-axes. The
information from the second file is mapped to the x-axis of the first
file.
prof> type x1 x2 y1 y2 y2map $
prof> var int n1 n2 $
prof> get file1 x1 y1 $
prof> n1=ndata
prof> get file2 x2 y2 $
prof> n2=ndata
prof> map x2 y2 n2 x1 y2map n1
prof> ndata=n1
prof> view x1 y1 y2map $
#minmax (9.7.) Determine extremes of a data type.
Minmax determines the minimum and maximum values of the data array
that is represented by a data type. The values are printed to the
screen and may also be assigned to (previously declared) real variables.
Syntax:
minmax [data type name] [minimum real variable] [maximum real variable]
minmax [data type name] $ : printing only
Example:
prof> type data $
prof> get file.dat data $
25 lines.
prof> var real minval maxval $
prof> minmax data minval maxval
Minimum data(7)=-3.2211, maximum data(15)=12.3412.
prof> minval
-3.2211
#poisson (9.8) - Solve Poisson's equation in a Schottky diode.
As an example of how to add a proprietary command to Profile with
the <extra> mechanism, a Poisson solver for a reversed biased
Schottky diode was implemented. It is NOT available on the IBM-PC
unless by recompilation!
Syntax:
extra poisson x dope elec psi vbi vbias emax temp eps miter
Here, <poisson> is called through <extra> because the extra command
was used to link the code of the Poisson solver to Profile. This is
described in section 2.1 of the Profile/Prof2d System Programmers
Manual. The arguments have the following meaning:
type x : one-dimensional x-axis in the diode in cm
type dope : doping concentration in cm-3 (n-type assumed)
type elec : electron concentration (to be computed) in cm-3
type psi : electrostatic potential (to be computed) in Volt
var real vbi : built-in voltage of the Schottky contact in Volt
var real vbias : currently applied bias voltage in Volt
var real emax : maximally tolerable electric field in V/cm
var real temp : absolute temperature in Kelvin
var real eps : acceptable error in potential solution in Volt
var int miter : maximum number of Poisson solution iterations
An example application, the simulation of a Capacitance-Voltage
measurement on a reversed biased Schottky diode, is given by the
Profile program <poisson.pro> that is included with the Profile
example set.
The junction is supposed to be at the beginning of the x-axis. Minority
carriers (holes) are neglected and Boltzmann statistics are used. The
global Newton solution algorithm is detailed in the fully commented
source code to be found in the standard extra.c source code file.
#levmar (10.1) Extraction of non-linear model parameters from data.
See also:
help define <-- How to define an internal non-linear model
help fit <-- How to choose the fitting weight function
help setext <-- Set parameters of the external non-linear model
help setlm <-- Set parameters of the numerical levmar procedure
help constrain <-- Constrain parameter values within fixed bounds
help tpled <-- Template editor for external model's input file
And: hartley.pro, camel.pro, nasecode.pro in the Profile example set.
Levmar fits a non-linear model to measurement data. The model may be both
non-linear in its parameters and in its dependence on the data x-axis.
This can be used to
- extract physical parameters from measurement data
- assess the correctness of a physical model
- remove noise from measurement data
The fit is made by minimizing the squared sum of differences between
measurement data and computed data. A weight function may be used, and
is specified with the default Profile data type weight (see help fit).
The model parameters must be known as Profile real variables.
The model can be internal (defined as an expression with the command define)
or external. An external model is formed by another computer program,
that reads the parameters from a file written by levmar and writes its
output to a file read by levmar. The external model program may well be
Profile itself. More information about external models is on the next
pages.
Syntax: levmar def [define] [ym-type] [x-type] [yc-type] [pars | fixed] $
or: levmar pro [ym-type] [x-type] [yc-type] [pars | fixed] $
or: levmar prd [ym-type] [x-type] [yc-type] [pars | fixed] $
In which:
levmar def <-- Use a defined expression as a non-linear model
levmar pro <-- Use an external program as a non-linear model
levmar prd <-- Use a program that also generates derivatives of the
data with respect to the model parameters
[define] <-- Name of the expression defined with define
[ym-type] <-- Data type that contains the measurement data
[x-type] <-- Data type that contains the x-axis
[yc-type] <-- Data type that will contain the fit data
[pars] <-- Real variables that are variable parameters of the model
[fixed] <-- Real variables that are fixed parameters of the model
$ <-- Indicates end of parameters
Example: (internal model):
prof> type x ym yc $ : Declare data types
prof> var real a1 a2 a3 $ : Declare model parameters
prof> define nlmod = a1 + a2*exp(x*a3) : The non-linear model
prof> get meas.dat x ym $ : Read measurement data
prof> weight = 1/(abs(ym)+0.01) : Set weight function
prof> a1 = 580 : \
prof> a2 = -180 : | Initial parameter values
prof> a3 = -0.16 : /
prof> setlm talk 1 : Some more output from levmar
prof> levmar def nlmod ym x yc a1 a2 a3 $ : The fit itself
prof> view x yc ym $ : Look at the result
After this fit, the parameters a1-a3 contain the optimized values.
An external non-linear model may be used to optimize parameters of models
that can only be represented in numerical form, and not by an analytical
expression. Such a model might be a series of Profile commands (including
such things as integration and differentiation) but also an entirely
different computer program. If the cost of computing the derivative of
the computed y-axis with respect to the parameters is much less than the
cost of computing the y-axis itself, these derivatives may be handed to
levmar (levmar pro <--> levmar prd). Otherwise, levmar will compute these
derivatives by using a perturbation technique.
Levmar communicates with the external model program through files:
+---------------------------------------+
| |
| Profile running Levmar |----+
| | |
+---------------------------------------+ |
| | ^ |
v v | |
+--------+ +-----------+ +--------------+ |
| x-axis | | parameter | | model output | v The model program
| file | | file | | file | | is invoked by Profile
+--------+ +-----------+ +--------------+ |
| | ^ |
v v | |
+---------------------------------------+ |
| | |
| Non-linear model program |<---+
| |
+---------------------------------------+
The x-axis file contains a listing of the x-axis (as generated by the
Profile command put) to be used by the model program. This file is written
only once for each call of levmar.
The parameter file contains a listing of the parameters to be used by the
model program in the form
[parameter name]=[parameter value] (e.g. a1=3.0)
If the model also generates derivatives (levmar prd), the parameter statement
dodiff=1
will head the parameter file. The parameter file is written everytime
the external model program is invoked.
The external program output file must contain (in the first column) the
y-values computed by the program, and, if derivatives are used, in the
next columns the derivatives with respect to the parameters in the order
in which the parameters where specified to levmar, or
if levmar was invoked as: levmar prd y x yfit a1 a2 a3 $
then the output file columns: y_computed dy_da1 dy_da2 dy_da3
The external program output file should be in a format readable by the
Profile command get.
The names of the three files and the exact call of the non-linear model
program can be asked for and changed with the command setext.
If the external model creates a file called "error.flg" (the so-called
error flag file), the optimization procedure is halted. Old error.flg
files are removed automatically before the optimization begins.
Example:
In this example we will use Profile itself as an external non-linear
model program. The names of the files and the program call are the
default settings:
x-axis file: nlmin.dat
parameter file: params.dat
model output file: nlmout.dat
program call: profile nlm.pro > nlm.out
The Profile command file nlm.pro is understood to be the Profile description
of the non-linear model evaluation. Profile should get nlmin.dat, execute
params.dat (!) and put nlmout.dat. Output of the non-linear model Profile is
redirected to nlm.out, to avoid streams of data on the screen.
A very simple example of nlm.pro, comprising exactly the same model as in
the example given above for the internal model, is
type x yc dy_da1 dyda_2 dy_da3 $ : Declare data types
var real dodiff a1 a2 a3 $ : Declare model parameters
define nlmod = a1 + a2*exp(x*a3) : The non-linear model
define dm_da1 = 1.0 : Derivative with respect to a1
define dm_da2 = exp(x*a3) : Derivative with respect to a2
define dm_da1 = a2*x*exp(x*a3) : Derivative with respect to a3
get nlmin.dat x $ : Read x-axis
exec params.dat : Set parameter values for this run
yc = nlmod : \
dy_da1 = dm_da1 : | Evaluate the model
dy_da2 = dm_da2 : | and derivatives
dy_da3 = dm_da3 : /
put nlmout.dat
yc dy_da1 dy_da2 dy_da3 $ : Write the output file
quit : Exit model Profile
The call of levmar in the main Profile should now look something like this:
prof> type x ym yc $ : Declare data types
prof> var real a1 a2 a3 $ : Declare model parameters
prof> get meas.dat x ym $ : Read measurement data
prof> weight = 1/(abs(ym)+0.01) : Set weight function
prof> a1 = 580 : \
prof> a2 = -180 : | Initial parameter values
prof> a3 = -0.16 : /
prof> levmar prd ym x yc a1 a2 a3 $ : The fit itself
prof> view x yc ym $ : Look at the result
It should be noted that the use of an external program is necessary only if
the non-linear model cannot be caught into an analytical expression. From
this point of view, our simple example is not an efficient solution.
If an existing external model program is used (e.g. some kind of simulation
program), this may not always exactly fit in the scheme scetched above. In
this case additional effort will be required to effect the communication
between the optimization driver (levmar) and the model program. The Profile
command <tpled> can be used to generate a parametrized input file of
arbitrary format for an external model program; this is illustrated with
a Spice example in the tpled manual page. In this case, a second instance
of Profile acts as a shell around the external model program.
For reading the models output, it may be necessary to write a data conversion
program that changes the model output to a format readible by the Profile
<get> command. Often, this can be achieved using Unix commands like ed, sed
and awk.
Also, it is often possible to create an external model by adding a
(usually relatively simple) command to Profile with the "extra" mechanism
as described in section 2.2 of the Profile/Prof2d System Programmer's
Manual. This command acts as the numerical core of the external model;
all data input/output can then be effected by the usual Profile commands.
More information on the use of Profile as an optimization driver for
parameter extraction can be found in:
- G.J.L. Ouwerling, H.M. Wentinck, F. van Rijs, J.C. Staalenburg
and W. Crans, "Physical Parameter Extraction by Inverse Modelling
of Semiconductor Devices," Proceedings SISDEP-88, Bologna, Sept. 1988.
- G.J.L. Ouwerling, F. van Rijs, B.F.P. Jansen and W. Crans,
"Inverse Modelling with the PROFILE Optimization Driver", Digest of
the Short Course on Software Tools for Process, Device and Circuit
Modelling, NASECODE VI Conference, Dublin, Boole Press, July 1989.
- G.J.L. Ouwerling, "One- and Two-Dimensional Doping Profiling by
Inverse Methods", Ph.D. Thesis, Delft University of Technology, 1989.
Of which appendix C: Algorithm of the MDLS optimization method.
#setext (10.2) Define the communication with the external model.
See also:
help levmar <-- Optimization driver for internal and external models
help tpled <-- Template editor for external model input files
Setext is used to define the file and program names for the communication
between the non-linear optimization driver levmar and an external non-
linear model (typically a simulation program, conceivably Profile itself).
Syntax:
setext ? <- show all current values
setext [name] [string] <- set name to 'string'
setext [name] $ <- reset name to default value (see below)
Here [name] represents one of the following:
call <- set the invocation string of the external model program
par <- set the name of the levmar parameter values output file
axs <- set the name of the levmar x-axis values output file
nlm <- give the name of the external model's output data file
The default values are chosen for the use of Profile itself as an external
non-linear model:
(axs) x-axis file: nlmin.dat
(par) parameter file: params.dat
(nlm) model output file: nlmout.dat
(call) program call: profile nlm.pro > nlm.out (Unix, PC)
profile/output=nlm.out nlm.pro (VAX/VMS)
The Profile command file nlm.pro is understood to be the Profile description
of the non-linear model evaluation. The external Profile should read the
data in nlmin.dat (command get), execute params.dat (!) to set the parameter
values (command exec) and write the results to nlmout.dat (command put).
In the external Profile's call, output from running nlm.pro is redirected
to nlm.out, to avoid streams of data on the screen.
NOTE: the execution of the optimization procedure is halted if the
external model creates a file called "error.flg" (the so-called
error-flag file). Before the optimization starts, Levmar removes
old error flag files.
This can be used to communicate an error condition from the
external model to the optimization driver.
#setlm (10.3) Set the operational parameters of the levmar procedure.
See also:
help levmar <-- Optimization driver for internal and external models
Setlm is used to change the values of operational parameters that govern
the behaviour of the non-linear optimization driver levmar.
Syntax:
setlm $ <- reset all values to default (see below)
setlm ? <- show all current values
setlm [name] [value] <- set name to value
setlm [name] $ <- reset name to default value (see below)
Here [name] represents one of the following:
name default summarized meaning
----------+---------+--------------------------------------------------
talk 0 output level of the optimization procedure
ill 1.0E-12 max condition number for ill conditioned matrix
alambda 1.0E-02 starting value of Marquardt lambda
eps1 0.5E-06 min largest gradient element for singular matrix
eps2 0.5E-14 min length of update in scaled parameter vector
eps3 1.0E-05 min relative change in squared error sum
eps4 0.0 absolute value of error (use WEIGHTED error!)
beta 1.0E-05 measure of linear search accuracy
itermax 20 maximum number of parameter vector updates
deltapa 1.0E-06 absolute perturbance of scaled parameter
deltapr 0.001 relative perturbance of scaled parameter
liniter 10 maximum number of iterations in linear search
maxbroyd -1 max number of Broyden updates. If -1, equals npars
----------+---------+--------------------------------------------------
Some additional information about the parameter talk:
talk=0 Only print table of original and ending parameter values.
talk=1 Include some comments and statistics.
talk=2 Also print information for each parameter update.
talk=3 Draw a curve of the fit (with view) for each iteration
talk=4 Dump the Hessian matrix and the Jacobian matrix.
More detailed information about the numerical procedure and the
statistical analysis of the parameter solution can be found in
the reference given on the <levmar> manual page.
#constrain (10.4) Specify constraints for non-linear parameters.
See also: help levmar.
Constrain specifies the interval that the value of a levmar parameter
may reach. If no constraints are specified for a certain parameter, it
may take any real value. Constraint specifications remain valid until
cancelled.
Syntax:
constrain [real var name] [lower value] [higher value]
constrain [real var name] $ <- remove this constraint
constrain ? <- show all constraints
constrain $ <- remove all constraints
Example:
prof> var real a1 a2 a3 a4 $
prof> constrain $
prof> constrain a1 -1.0 2.0
prof> constrain a2 1.0e14 1.0e15
prof> constrain a3 pi e
prof> a1 = 0.0
prof> a2 = 5e14
prof> a3 = (pi+e)/2.0
Constraints are implemented by using a coordinate transformation:
p[model] = Low + (High-Low)*sqr(sin(p[internal]))
with Low and High the constraint values.
#callext (10.5) Call the external non-linear model once.
See also: help levmar, help setext.
Callext does one call to an external non-linear model as defined by the
command setext (or by the default settings). This may be used to test the
interface between Profile and the external model, or to obtain a starting
profile of the simulated data using the starting parameters. Callext does
not request nor read derivatives from the external model.
Syntax:
callext [x-type] [y-type] [variable parameters] [| [fixed parameters]] $
The x-axis and all parameters are written to the intermediate files and
the y-axis is read from the model's output file as described in the levmar
help page.
Example:
prof> type x ystart ym yc $
prof> var real a1 a2 a3 $
prof> get meas.dat x ym $ : read x-axis and data
prof> setext call ext_mod params.dat nlmout.dat : set external model call
prof> a1=1.0
prof> a2=2.0
prof> a3=3.0
prof> callext x ystart a1 a2 | a3 $ : a3 will remain fixed
prof> view x ystart ym $ : look at starting guess
prof> levmar pro ym x yc a1 a2 | a3 $ : find parameters a1 & a2
#scanspace (10.6) Scan a least squares error space.
See also: help levmar, help setext.
Scanspace evaluates the non-linear model (either internal or external)
for a series of parameter values that are taken from equivalent data types
containing the required parameter values. The call of scanspace is similar
to that of levmar, with this respect that for every variable parameter an
equivalent data type must be given.
The parameter data type values may have been previously generated by using
Profile (1D) or Prof2d (2D) to create a parameter space. The computed error
function is subject to the weight values in the default data type weight
(like with levmar). If an error occurs during the model evaulation, the
error function value -1 is returned.
Syntax:
scanspace [model kind] [[model name]]
[ym-type] [x-type] [yc-type] [error value type]
ndata nparams
[parameter value types] | [parameters] [| fixed parameters]] $
Here ndata is an integer (variable) giving the number of data lines, and
nparams an integer (variable) giving the number of parameter values to
be scanned.
Example:
prof> var real a1 a2 $
prof> type a1val a2val x ym yc error $
prof> var integer datlines parlines $
prof> define nlm=a1*a2
prof> get meas.dat x ym $
prof> datlines=ndata
prof> get params.dat a1val a2val $
prof> parlines=ndata
prof> scanspace def nlm ym x yc error datlines parlines a1val a2val | a1 a2 $
prof> put error.dat a1val a2val error $
#tpled (10.7) - Template editor to parametrize external model input files.
See also: help levmar, help setext
With the template editor tpled it is possible to create parametrized
input files of arbitrary format for use with external models.
Unfortunately, the template editor is not available on the IBM-PC
unless by recompilation of the Profile source code.