12.18. - sp
, sP
, sf
, sF
save parameters
The save parameters commands let you write out the current parameters to the screen or to a file in several formats.
sp sp filename [a|w] or sP, sf and sF (same options)With no arguments,
sp
, sP
, sf
and
sF
all write
the current set of parameters to the screen in the same format as
the last iteration of the fit.
The meaning of the values printed is
explained under the command
fi
. The commands
sP
and
sF
print out the calculated errors in the fitted parameters, rounding
the fitted parameter values to two significant figures of the error.
The commands
sp
and
sf
don't print the errors, but do
print out six significant figures of each parameter.
With a
filename
argument, the format produced by these commands
is quite different and is intended to be used with the annotation
feature of the plot program.
The command
sp
filename
writes
to the file:
\H@13@\W@-\(*x\u\s2\b\l\d @\(*x\u\s2\b\l\d = 1.088 \H@13@\W@-Constant term@Constant term = 10.2309 \(lh \H@13@\W@-Linear term@Linear term = 4.01735 \(lhwhich, when interpreted by C-PLOT by typing
pn
filename
,
writes on the plot:
The hand symbols indicate which were the fitted parameters.
The formatting sequences on the parameter lines will make the equals signs line up when used with the annotation command, even with nonproportional fonts. The delimiter character
@
used in the formatting sequences
cannot be used in your parameter names, without causing problems for
the
rp
command and for the user function
fitpar.4
described
in Appendix C.
The command
sP
filename
produces:
\H@13@\W@-\(*x\u\s2\b\l\d @\(*x\u\s2\b\l\d = 1.088 \H@13@\W@-Constant term@Constant term = 10.\(+-12. \H@13@\W@-Linear term@Linear term = 4.02\(+-0.83which, when interpreted by C-PLOT by typing
pn
filename
,
writes on the plot:
The command
sF
filename
produces:
Fit 11 points with `line.5' Fit to a line: y = c + m * x Statistical weights Converged by \(*e test (\(*e = 0.001) 10 \(<= x \(<= 20 \H@13@\W@-\(*x\u\s2\b\l\d @\(*x\u\s2\b\l\d = 1.088 \H@13@\W@-Constant term@Constant term = 10.\(+-12. \H@13@\W@-Linear term@Linear term = 4.02\(+-0.83which, when interpreted by C-PLOT by typing
pn
filename
,
writes on the plot:
The first line includes the name of the fitting function. The second line is a comment set in the prototype file. The third line indicates the method of weighting. The fourth line shows how the fit terminated. The next line or lines show the range of each of the independent variables. (In this example there is just one.)
The output from
sf
filename
is similar, but the errors
are not printed with the parameters.
By indicating
a
or
w
after the file name, you tell the
program either to append to the file or to write over the current
contents of the file.
If the file already exists, you must explicitly
indicate you wish to write over the file, otherwise the file will
not be changed.
The output format that appears on the screen also can be directed to a file using the >filename syntax, as explained in the notes to the list of commands at the beginning of this chapter.
The public user function fitpar.4, described in Appendix C, lets you read a file containing many parameter sets created using any of the save-parameter commands to produce plots of any parameter versus any other.