home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computerworld 1996 March
/
Computerworld_1996-03_cd.bin
/
idg_cd3
/
aplikace
/
cad
/
wplot211
/
longtime.fit
< prev
next >
Wrap
Text File
|
1994-11-24
|
2KB
|
89 lines
* Start Nonlinear Curve Fitter program then type command: LOAD LONGTIME.FIT
*
* Read the data that is to be fit.
read 51
0 .1001
.0588 2.23
.1176 3.85
.1764 4.78
.2352 4.66
.2941 3.90
.3529 2.15
.4117 .509
.4705 -1.53
.5294 -2.70
.5882 -3.87
.6470 -3.73
.7058 -3.40
.7647 -2.03
.8235 -.844
.8823 .7845
.9411 1.954
1 2.79
1.058 3.07
1.117 2.69
1.176 2.10
1.235 .703
1.294 -.183
1.352 -1.55
1.411 -1.81
1.470 -2.69
1.529 -2.03
1.588 -1.91
1.647 -.830
1.705 -.153
1.764 .965
1.823 1.44
1.882 1.94
1.941 1.84
2 1.51
2.058 .929
2.117 .116
2.176 -.463
2.235 -1.23
2.294 -1.39
2.352 -1.58
2.411 -1.19
2.470 -1.12
2.529 -.130
2.588 .152
2.647 .951
2.705 .947
2.764 1.30
2.823 .981
2.882 .870
2.941 .316
*
* Set the number of parameters (p1, p2 & p3).
numpar 3
*
* Enter initial estimates of the parameters.
p1 = 10
p2 = 10
p3 = 10
*
* Enter the equation that is to be fit to the data.
y(x)= p1 * exp(-p2*x) * sin(p3*x)
*
* Partial derivatives will be numerically approximated.
partials off
*
* Plot the fit using the initial parameter values;
* shows that the initial parameter values give a poor fit.
wait
plotfit
*
* Find a better fit.
*
* WARNING: It may take a while to find a better fit (48 seconds on a
* 25 MHz 386 PC without a co-processor but less that 4 seconds
* on a 33 MHz 486 PC); press ESC key to abort.
fit
*
* Plot the improved fit.
wait
plotfit
*
* Output fit parameters (optionally to a file).
outfit