1 |
\section{The line search optimisation algorithm |
\section{The line search optimisation algorithm |
2 |
\label{sectionoptim}} |
\label{sectionoptim}} |
3 |
|
\begin{rawhtml} |
4 |
|
<!-- CMIREDIR:lsearch_optim: --> |
5 |
|
\end{rawhtml} |
6 |
|
|
7 |
\subsection{General features} |
\subsection{General features} |
8 |
|
|
9 |
The line search algorithm is based on a quasi-Newton |
The line search algorithm is based on a quasi-Newton |
10 |
variable storage method which was implemented by |
variable storage method which was implemented by |
11 |
\cite{gil-mar:89}. |
\cite{gil-lem:89}. |
12 |
|
|
13 |
TO BE CONTINUED... |
TO BE CONTINUED... |
14 |
|
|
89 |
\] |
\] |
90 |
that serves as input |
that serves as input |
91 |
in a new forward and adjoint run, yielding {\tt gg(i,2)}. |
in a new forward and adjoint run, yielding {\tt gg(i,2)}. |
92 |
If now, both Wolfe tests are successfull, |
If now, both Wolfe tests are successful, |
93 |
the updated solution is given by |
the updated solution is given by |
94 |
\[ |
\[ |
95 |
\tt |
\tt |
223 |
|
|
224 |
\newpage |
\newpage |
225 |
|
|
226 |
\begin{figure}[b!] |
\begin{figure} |
227 |
\input{part8/lsopt_flow_1} |
%\input{part8/lsopt_flow_1} |
228 |
|
{\scriptsize |
229 |
|
\begin{verbatim} |
230 |
|
lsopt_top |
231 |
|
| |
232 |
|
|---- check arguments |
233 |
|
|---- CALL INSTORE |
234 |
|
| | |
235 |
|
| |---- determine whether OPWARMI available: |
236 |
|
| * if no: cold start: create OPWARMI |
237 |
|
| * if yes: warm start: read from OPWARMI |
238 |
|
| create or open OPWARMD |
239 |
|
| |
240 |
|
|---- check consistency between OPWARMI and model parameters |
241 |
|
| |
242 |
|
|---- >>> if COLD start: <<< |
243 |
|
| | first simulation with f.g. xx_0; output: first ff_0, gg_0 |
244 |
|
| | set first preconditioner value xdiff_0 to 1 |
245 |
|
| | store xx(0), gg(0), xdiff(0) to OPWARMD (first 3 entries) |
246 |
|
| | |
247 |
|
| >>> else: WARM start: <<< |
248 |
|
| read xx(i), gg(i) from OPWARMD (first 2 entries) |
249 |
|
| for first warm start after cold start, i=0 |
250 |
|
| |
251 |
|
| |
252 |
|
| |
253 |
|
|---- /// if ITMAX > 0: perform optimization (increment loop index i) |
254 |
|
| ( |
255 |
|
| )---- save current values of gg(i-1) -> gold(i-1), ff -> fold(i-1) |
256 |
|
| (---- CALL LSUPDXX |
257 |
|
| ) | |
258 |
|
| ( |---- >>> if jmax=0 <<< |
259 |
|
| ) | | first optimization after cold start: |
260 |
|
| ( | | preconditioner estimated via ff_0 - ff_(first guess) |
261 |
|
| ) | | dd(i-1) = -gg(i-1)*preco |
262 |
|
| ( | | |
263 |
|
| ) | >>> if jmax > 0 <<< |
264 |
|
| ( | dd(i-1) = -gg(i-1) |
265 |
|
| ) | CALL HESSUPD |
266 |
|
| ( | | |
267 |
|
| ) | |---- dd(i-1) modified via Hessian approx. |
268 |
|
| ( | |
269 |
|
| ) |---- >>> if <dd,gg> >= 0 <<< |
270 |
|
| ( | ifail = 4 |
271 |
|
| ) | |
272 |
|
| ( |---- compute step size: tact(i-1) |
273 |
|
| ) |---- compute update: xdiff(i) = xx(i-1) + tact(i-1)*dd(i-1) |
274 |
|
| ( |
275 |
|
| )---- >>> if ifail = 4 <<< |
276 |
|
| ( goto 1000 |
277 |
|
| ) |
278 |
|
| (---- CALL OPTLINE / LSLINE |
279 |
|
| ) | |
280 |
|
... ... ... |
281 |
|
\end{verbatim} |
282 |
|
} |
283 |
\caption{Flow chart (part 1 of 3)} |
\caption{Flow chart (part 1 of 3)} |
284 |
\label{fig:lsoptflow1} |
\label{fig:lsoptflow1} |
285 |
\end{figure} |
\end{figure} |
286 |
|
|
287 |
\begin{figure}[b!] |
\begin{figure} |
288 |
\input{part8/lsopt_flow_2} |
%\input{part8/lsopt_flow_2} |
289 |
|
{\scriptsize |
290 |
|
\begin{verbatim} |
291 |
|
... ... |
292 |
|
| ) |
293 |
|
| (---- CALL OPTLINE / LSLINE |
294 |
|
| ) | |
295 |
|
| ( |---- /// loop over simulations |
296 |
|
| ) ( |
297 |
|
| ( )---- CALL SIMUL |
298 |
|
| ) ( | |
299 |
|
| ( ) |---- input: xdiff(i) |
300 |
|
| ) ( |---- output: ff(i), gg(i) |
301 |
|
| ( ) |---- >>> if ONLINE <<< |
302 |
|
| ) ( runs model and adjoint |
303 |
|
| ( ) >>> if OFFLINE <<< |
304 |
|
| ) ( reads those values from file |
305 |
|
| ( ) |
306 |
|
| ) (---- 1st Wolfe test: |
307 |
|
| ( ) ff(i) <= tact*xpara1*<gg(i-1),dd(i-1)> |
308 |
|
| ) ( |
309 |
|
| ( )---- 2nd Wolfe test: |
310 |
|
| ) ( <gg(i),dd(i-1)> >= xpara2*<gg(i-1),dd(i-1)> |
311 |
|
| ( ) |
312 |
|
| ) (---- >>> if 1st and 2nd Wolfe tests ok <<< |
313 |
|
| ( ) | 320: update xx: xx(i) = xdiff(i) |
314 |
|
| ) ( | |
315 |
|
| ( ) >>> else if 1st Wolfe test not ok <<< |
316 |
|
| ) ( | 500: INTERpolate new tact: |
317 |
|
| ( ) | barr*tact < tact < (1-barr)*tact |
318 |
|
| ) ( | CALL CUBIC |
319 |
|
| ( ) | |
320 |
|
| ) ( >>> else if 2nd Wolfe test not ok <<< |
321 |
|
| ( ) 350: EXTRApolate new tact: |
322 |
|
| ) ( (1+barmin)*tact < tact < 10*tact |
323 |
|
| ( ) CALL CUBIC |
324 |
|
| ) ( |
325 |
|
| ( )---- >>> if new tact > tmax <<< |
326 |
|
| ) ( | ifail = 7 |
327 |
|
| ( ) | |
328 |
|
| ) (---- >>> if new tact < tmin OR tact*dd < machine precision <<< |
329 |
|
| ( ) | ifail = 8 |
330 |
|
| ) ( | |
331 |
|
| ( )---- >>> else <<< |
332 |
|
| ) ( update xdiff for new simulation |
333 |
|
| ( ) |
334 |
|
| ) \\\ if nfunc > 1: use inter-/extrapolated tact and xdiff |
335 |
|
| ( for new simulation |
336 |
|
| ) N.B.: new xx is thus not based on new gg, but |
337 |
|
| ( rather on new step size tact |
338 |
|
| ) |
339 |
|
| (---- store new values xx(i), gg(i) to OPWARMD (first 2 entries) |
340 |
|
| )---- >>> if ifail = 7,8,9 <<< |
341 |
|
| ( goto 1000 |
342 |
|
| ) |
343 |
|
... ... |
344 |
|
\end{verbatim} |
345 |
|
} |
346 |
\caption{Flow chart (part 2 of 3)} |
\caption{Flow chart (part 2 of 3)} |
347 |
\label{fig:lsoptflow2} |
\label{fig:lsoptflow2} |
348 |
\end{figure} |
\end{figure} |
349 |
|
|
350 |
\begin{figure}[b!] |
\begin{figure} |
351 |
\input{part8/lsopt_flow_3} |
%\input{part8/lsopt_flow_3} |
352 |
|
{\scriptsize |
353 |
|
\begin{verbatim} |
354 |
|
... ... |
355 |
|
| ) |
356 |
|
| (---- store new values xx(i), gg(i) to OPWARMD (first 2 entries) |
357 |
|
| )---- >>> if ifail = 7,8,9 <<< |
358 |
|
| ( goto 1000 |
359 |
|
| ) |
360 |
|
| (---- compute new pointers jmin, jmax to include latest values |
361 |
|
| ) gg(i)-gg(i-1), xx(i)-xx(i-1) to Hessian matrix estimate |
362 |
|
| (---- store gg(i)-gg(i-1), xx(i)-xx(i-1) to OPWARMD |
363 |
|
| ) (entries 2*jmax+2, 2*jmax+3) |
364 |
|
| ( |
365 |
|
| )---- CALL DGSCALE |
366 |
|
| ( | |
367 |
|
| ) |---- call dostore |
368 |
|
| ( | | |
369 |
|
| ) | |---- read preconditioner of previous iteration diag(i-1) |
370 |
|
| ( | from OPWARMD (3rd entry) |
371 |
|
| ) | |
372 |
|
| ( |---- compute new preconditioner diag(i), based upon diag(i-1), |
373 |
|
| ) | gg(i)-gg(i-1), xx(i)-xx(i-1) |
374 |
|
| ( | |
375 |
|
| ) |---- call dostore |
376 |
|
| ( | |
377 |
|
| ) |---- write new preconditioner diag(i) to OPWARMD (3rd entry) |
378 |
|
| ( |
379 |
|
|---- \\\ end of optimization iteration loop |
380 |
|
| |
381 |
|
| |
382 |
|
| |
383 |
|
|---- CALL OUTSTORE |
384 |
|
| | |
385 |
|
| |---- store gnorm0, ff(i), current pointers jmin, jmax, iterabs to OPWARMI |
386 |
|
| |
387 |
|
|---- >>> if OFFLINE version <<< |
388 |
|
| xx(i+1) needs to be computed as input for offline optimization |
389 |
|
| | |
390 |
|
| |---- CALL LSUPDXX |
391 |
|
| | | |
392 |
|
| | |---- compute dd(i), tact(i) -> xdiff(i+1) = x(i) + tact(i)*dd(i) |
393 |
|
| | |
394 |
|
| |---- CALL WRITE_CONTROL |
395 |
|
| | | |
396 |
|
| | |---- write xdiff(i+1) to special file for offline optim. |
397 |
|
| |
398 |
|
|---- print final information |
399 |
|
| |
400 |
|
O |
401 |
|
\end{verbatim} |
402 |
|
} |
403 |
\caption{Flow chart (part 3 of 3)} |
\caption{Flow chart (part 3 of 3)} |
404 |
\label{fig:lsoptflow3} |
\label{fig:lsoptflow3} |
405 |
\end{figure} |
\end{figure} |