forked from johannesgerer/jburkardt-f
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dqed.html
548 lines (492 loc) · 16.4 KB
/
dqed.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
<html>
<head>
<title>
DQED - Bounded Constrained Least Squares/Nonlinear Equations
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
DQED <br> Bounded Constrained Least Squares/Nonlinear Equations<br>
Double precision version
</h1>
<hr>
<p>
<b>DQED</b>
is a FORTRAN90 library which
solves (square) systems of nonlinear equations, or minimizes the
residual in a set of nonlinear equations, using least squares,
by Richard Hanson and Fred Krogh.
</p>
<p>
The user may include simple bounds or linear constraints on variables.
</p>
<p>
<b>DQED</b> can solve, in the least squares sense, systems of linear
or nonlinear equations, with inequality bounds or equality constraints.
</p>
<p>
<b>DQED</b> was written by Richard Hanson and Fred Krogh of Sandia
National Laboratory.
</p>
<p>
The original FORTRAN77 source code is available through NETLIB at<br>
<a href = "http://www.netlib.org/opt/dqed.f">
http://www.netlib.org/opt/dqed.f</a>.
</p>
<h3 align = "center">
Overview
</h3>
<p>
DQED solves the constrained nonlinear least squares problem:
</p>
<p>
Minimize the sum of squares of MEQUA generally nonlinear equations,
<blockquote>
f(1:MEQUA)(x) = 0, Equation (1)
</blockquote>
where x is a set of NVARS unknowns. The vector function with these MEQUA
components is called f(x) in the discussion that follows.
</p>
<p>
The components of x may have upper and lower bounds given by the user. In
fact, all of the possible cases can be specified:
<ul>
<li>
no bounds on X;
</li>
<li>
bounds at one end only;
</li>
<li>
upper and lower bounds.
</li>
</ul>
</p>
<p>
Linear constraints on the unknowns, more general than simple bounds, can also
be given. These linear constraints can be of the equality or inequality type:
<blockquote>
a(L,1) x(1)+ ... + a(L,NVARS) x(NVARS) = y(L), L = 1,...,MCON, Equation (2)
</blockquote>
with bounds specified on the right hand side values y(L), again given by the
user. The constraints can actually be slightly nonlinear. In this case
the constraints can be described as:
<blockquote>
g(L)(x) = y(L), L = 1,...,MCON, Equation (2')
</blockquote>
where bounds are specified on each y(L). The functions g(L)(x) must be defined
for all x in the set described by the simple bounds.
</p>
<p>
Experienced users may wish to turn directly to the examples before reading the
subprogram documentation.
</p>
<p>
There is no size relation required for the problem dimensions MEQUA, NVARS, and
MCON except that MEQUA and NVARS are both positive, and MCON is nonnegative.
</p>
<p>
DQED will do a decent job of solving most nonlinear
least squares problems that can be expressed as Equations (1) and (2)
above, provided that continuous derivatives of the functions
with respect to the parameters can be computed. This can also
include problems where the derivatives must be computed using
some form of numerical differentiation. Numerical
differentiation is not provided with this software for solving
nonlinear least squares problems.
</p>
<p>
The authors also plan to develop methods that will do a much
better job of coping with constraints more general than the
essentially linear ones indicated above in Equations (2)-(2'). There
are nonlinear least squares problems with innocent-looking but
highly nonlinear constraints where this package will fail to
work. The authors also hope to reduce the overhead required by
the software. This high overhead is due primarily to the method
used to solve the inner-loop quadratic model problem. The
authors recommend that users consider using the option number
14, to suppress use of the quadratic model. The
user may find that the software works quite well without the
quadratic model. This may be important when the function and
derivatives evaluations are not expensive but many individual
problems are being solved.
</p>
<p>
There are two fundamental ways to use the subprogram DQED.
</p>
<p>
The most straightforward way is to make one call to DQED and obtain values
for the unknowns, x. The user provides a subprogram DQEDEV that gives
DQED the values of the functions f(x) and g(x), and the derivative or Jacobian
matrices for f(x) and g(x) at each desired point x. This usage is called
'forward communication.'
</p>
<p>
An alternate way to use DQED is to provide an option that allows the user to
communicate these values by 'reverse communication.' DQED returns to the
user calling program and requests values for f(x) and g(x), and the Jacobian
matrices for f(x) and g(x) for a given value of x. This framework is often
required in applications that have complicated algorithmic requirements for
evaluation of the functions.
</p>
<p>
Examples using both 'forward' and 'reverse' communication are provided.
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>DQED</b> is available in
<a href = "../../f77_src/dqed/dqed.html">a FORTRAN77 version</a> and
<a href = "../../f_src/dqed/dqed.html">a FORTRAN90 version.</a>
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../f_src/bvls/bvls.html">
BVLS</a>,
a FORTRAN90 library which
applies least squares methods to solve a linear system for which
lower and upper constraints may have been placed on every variable.
</p>
<p>
<a href = "../../f77_src/lawson/lawson.html">
LAWSON</a>,
a FORTRAN77 library which
contains routines for solving least squares problems and singular value
decompositions, by Lawson and Hanson.
</p>
<p>
<a href = "../../f_src/minpack/minpack.html">
MINPACK</a>,
a FORTRAN90 library which
solves systems
of nonlinear equations, or the least squares minimization of the
residual of a set of linear or nonlinear equations.
</p>
<p>
<a href = "../../f_src/nl2sol/nl2sol.html">
NL2SOL</a>,
a FORTRAN90 library which
implements an adaptive nonlinear least-squares algorithm.
</p>
<p>
<a href = "../../f_src/praxis/praxis.html">
PRAXIS</a>,
a FORTRAN90 routine which
minimizes a scalar
function of several variables.
</p>
<p>
<a href = "../../f_src/qr_solve/qr_solve.html">
QR_SOLVE</a>,
a FORTRAN90 library which
computes the least squares solution of a linear system A*x=b.
</p>
<p>
<a href = "../../f_src/test_opt/test_opt.html">
TEST_OPT</a>,
a FORTRAN90 library which
defines test problems
requiring the minimization of a scalar function of several variables.
</p>
<p>
<a href = "../../f_src/test_opt_con/test_opt_con.html">
TEST_OPT_CON</a>,
a FORTRAN90 library which
defines test problems for the minimization of a scalar function
of several variables, with the search constrained to lie within a specified hyper-rectangle.
</p>
<p>
<a href = "../../f_src/test_optimization/test_optimization.html">
TEST_OPTIMIZATION</a>,
a FORTRAN90 library which
defines test problems for the minimization of a scalar function
of several variables, as described by Molga and Smutnicki.
</p>
<p>
<a href = "../../f_src/toms611/toms611.html">
TOMS611</a>,
a FORTRAN90 library which
can be used to seek the minimizer of a scalar functional
of multiple variables.
</p>
<p>
<a href = "../../f_src/xerror/xerror.html">
XERROR</a>,
a FORTRAN90 library which
handles error messages.
</p>
<h3 align = "center">
Author:
</h3>
<p>
Richard Hanson and Fred Krogh.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
Jack Dongarra, Jim Bunch, Cleve Moler, Pete Stewart,<br>
LINPACK User's Guide,<br>
SIAM, 1979,<br>
ISBN13: 978-0-898711-72-1,<br>
LC: QA214.L56.
</li>
<li>
Richard Hanson,<br>
Least Squares with Bounds and Linear Constraints,<br>
SIAM Journal of Scientific and Statistical Computing,<br>
Volume 7, number 3, July 1986, pages 826-834.
</li>
<li>
Ron Jones, David Kahaner,<br>
XERROR, The SLATEC Error Handling Package,<br>
Technical Report SAND82-0800,<br>
Sandia National Laboratories, 1982.
</li>
<li>
Ron Jones, David Kahaner,<br>
XERROR, The SLATEC Error Handling Package,<br>
Software: Practice and Experience,<br>
Volume 13, Number 3, 1983, pages 251-257.
</li>
<li>
Charles Lawson, Richard Hanson, David Kincaid, Fred Krogh,<br>
Algorithm 539:
Basic Linear Algebra Subprograms for Fortran Usage,<br>
ACM Transactions on Mathematical Software,<br>
Volume 5, Number 3, September 1979, pages 308-323.
</li>
<li>
Robert Schnabel, Paul Frank, <br>
Tensor Methods for Nonlinear Equations,<br>
SIAM Journal on Numerical Analysis, <br>
Volume 21, Number 5, October 1984, pages 815-843.
</li>
<li>
<a href = "dqed.txt">dqed.txt</a>, some online documentation.
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "dqed.f90">dqed.f90</a>, the source code.
</li>
<li>
<a href = "dqed.sh">dqed.sh</a>, commands to compile the source code.
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<b>Problem 1</b> tries to fit data for a model of the heart. Several
datasets are examined, exact and approximate jacobians are
compared, and two equations are tried as constraints instead
of equations. Files you may copy include:
<ul>
<li>
<a href = "dqed_prb1.f90">dqed_prb1.f90</a>, a sample problem.
</li>
<li>
<a href = "dqed_prb1.sh">dqed_prb1.sh</a>, commands to compile the source code.
</li>
<li>
<a href = "dqed_prb1_input.txt">dqed_prb1_input.txt</a>, input for the
sample problem.
</li>
<li>
<a href = "dqed_prb1_output.txt">dqed_prb1_output.txt</a>, sample problem output.
</li>
<li>
<a href = "dqed_prb1_good_output.txt">dqed_prb1_good_output.txt</a>,
"good" output for this problem, from the original publication.
</li>
</ul>
</p>
<p>
<b>Problem 2</b> tries to fit data. Files you may copy include:
<ul>
<li>
<a href = "dqed_prb2.f90">dqed_prb2.f90</a>, a sample problem.
</li>
<li>
<a href = "dqed_prb2.sh">dqed_prb2.sh</a>, commands to compile the source code.
</li>
<li>
<a href = "dqed_prb2_output.txt">dqed_prb2_output.txt</a>, sample problem output.
</li>
</ul>
</p>
<p>
<b>Problem 3</b> tries to fit data. Files you may copy include:
<ul>
<li>
<a href = "dqed_prb3.f90">dqed_prb3.f90</a>, a sample problem.
</li>
<li>
<a href = "dqed_prb3.sh">dqed_prb3.sh</a>, commands to compile the source code.
</li>
<li>
<a href = "dqed_prb3_output.txt">dqed_prb3_output.txt</a>, sample problem output.
</li>
</ul>
</p>
<p>
<b>Problem 4</b> is like problem 3, but is set up to solve a problem
involving the absorption of carbon and nitrogen isotopes by
an alligator from its prey.
<ul>
<li>
<a href = "dqed_prb4.f90">dqed_prb4.f90</a>, a sample problem.
</li>
<li>
<a href = "dqed_prb4.sh">dqed_prb4.sh</a>, commands to compile the source code.
</li>
<li>
<a href = "dqed_prb4.csh">dqed_prb4.csh</a>, commands to run
the sample problem.
</li>
<li>
<a href = "dqed_prb4_output.txt">dqed_prb4_output.txt</a>, sample problem
output.
</li>
</ul>
</p>
<p>
<b>Problem 5</b> shows how, if the nonlinear constrained system to be solved
is actually a LINEAR constrained system, the user may call the DBOLS routine
directly.
<ul>
<li>
<a href = "dqed_prb5.f90">dqed_prb5.f90</a>, a sample problem.
</li>
<li>
<a href = "dqed_prb5.sh">dqed_prb5.sh</a>, commands to run
the sample problem.
</li>
<li>
<a href = "dqed_prb5_output.txt">dqed_prb5_output.txt</a>, sample problem
output.
</li>
</ul>
</p>
<h3 align = "center">
List of Routines:
</h3>
<p>
<ul>
<li>
<b>DIFCEN</b> estimates a jacobian using central differences.
</li>
<li>
<b>DIFFOR</b> estimates a jacobian using forward differences.
</li>
<li>
<b>IDAMAX</b> finds the index of the vector element of maximum absolute value.
</li>
<li>
<b>IVOUT</b> prints integer vectors.
</li>
<li>
<b>DAMAX</b> returns the maximum absolute value of the entries in a vector.
</li>
<li>
<b>DASUM</b> sums the absolute values of the entries of a vector.
</li>
<li>
<b>DAXPY</b> adds a constant times one vector to another.
</li>
<li>
<b>DBOCLS</b> solves a bounded and constrained least squares problem.
</li>
<li>
<b>DBOLS</b> solves the linear system E*X = F in the least squares sense.
</li>
<li>
<b>DBOLSM</b> solves E*X = F in the least squares sense with bounds on some X values.
</li>
<li>
<b>DCOPY</b> copies one vector into another.
</li>
<li>
<b>DDOT</b> forms the dot product of two vectors.
</li>
<li>
<b>DGECO</b> factors a double precision matrix and estimates its condition.
</li>
<li>
<b>DGEFA</b> factors a double precision matrix.
</li>
<li>
<b>DGESL</b> solves a system factored by DGECO or DGEFA.
</li>
<li>
<b>DMOUT</b> prints double precision matrices.
</li>
<li>
<b>DNRM2</b> computes the Euclidean norm of a vector.
</li>
<li>
<b>DPCHEK</b> checks the user's jacobian routine.
</li>
<li>
<b>DQED</b> solves bounded and constrained least squares
and nonlinear equations.
</li>
<li>
<b>DQEDEV</b> evaluates functions being treated by DQED.
</li>
<li>
<b>DQEDGN</b> is a simplified version of the QED algorithm
for the model problem.
</li>
<li>
<b>DQEDIP</b> carries out the work of DQEDGN.
</li>
<li>
<b>DQEDMN</b> is the main solution routine.
</li>
<li>
<b>DROT</b> applies a plane rotation.
</li>
<li>
<b>DROTG</b> constructs a Givens plane rotation.
</li>
<li>
<b>DSCAL</b> scales a vector by a constant.
</li>
<li>
<b>DSWAP</b> interchanges two vectors.
</li>
<li>
<b>DVOUT</b> prints double precision vectors.
</li>
<li>
<b>TIMESTAMP</b> prints the current YMDHMS date as a time stamp.
</li>
<li>
<b>XERRWV</b> is an error output message routine.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../f_src.html">
the FORTRAN90 source codes</a>.
</p>
<hr>
<i>
Last revised on 02 January 2011.
</i>
<!-- John Burkardt -->
</body>
</html>